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

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

% edit raw data
n=find(z<800);
z(n)=[];x(n)=[];y(n)=[];
n=find(z>920);
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;
xA=x;yA=y;zA=z;

save C2xyzA  xA yA zA

