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

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

% edit raw data
n=find(z<800);
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 C3xyz  x y z

