function clean_B2A
% clean_B2A removes bad values from
% original B2 depth file. Cleaned data
% used to make mooring location map
% 2/23/02

clf
load depthB2deploy.dat
z=depthB2deploy; z(1:1,:)=[];
x=z(:,1);y=z(:,2);z=z(:,3);
m=1:length(z);
plot(m,z)
pause

% edit raw data
n=find(z<750);
z(n)=[];x(n)=[];y(n)=[];
n=find(z>890);
z(n)=[];x(n)=[];y(n)=[];
m=1:length(z);

bad=wild(z,5,3);
z1=replace(z,bad);

z2=smoothmed(z1,15);

plot(m,z,'b',m,z1,'g',m,z2,'r')
z=z2;

save B2xyz  x y z

