if 1
file = 'hale4001';
p_range = [2800 6400];

[ts, vel, dd] = adp(file, 'ts', 'vel',  p_range );
ss = (dd-dd(1))*86400;
[enu, xyze] = beam_enu(vel, ts);


end %%%temporary

dt = [0; diff(ss)];
w = squeeze(enu(:,3,:));
ncells = size(enu,1);
zz = cumsum(dt(:,ones(1,ncells)).*w.').';

figure
subplot(2,1,1)
plot(ss, ts(:,5));
xlabel('seconds');
ylabel('Pressure');
title(file);
grid

subplot(2,1,2)
plot(ss, zz(1:4:20,:).')
xlabel('seconds');
ylabel('integrated W');
title(file);
grid
date_it('wzcheck')
print -dps2c wzcheck.ps

dw = diff(w);
mdw = mean(dw.');
icell = 1:length(mdw);
figure
subplot(1,2,1)
plot(mdw, icell)
grid
xlabel('mean delta-W')
ylabel('cell number')
title(file)
subplot(1,2,2)
plot(cumsum(mdw), icell)
grid
xlabel('cumsum of mean delta-W')
ylabel('cell number')
title(file)
date_it('wzcheck')
print -dps2c -a wzcheck.ps
