for i=1:9;
 [u(:,i),v(:,i),t(:,i)]=velts('ecomts.cdf',i,1);
end
% t is time in days, as it should be for tidefit
%
[m,n]=size(u);
u=u(m-144:m,:);
v=v(m-144:m,:);

ucoef=tidefit(t,u);
vcoef=tidefit(t,v);
% mean
w=ucoef(1,:)+j*vcoef(1,:);
mean_amp=abs(w);
mean_inc=angled(w);
% M2
m2_ell=ellipse(ucoef(2,:),ucoef(3,:),vcoef(2,:),vcoef(3,:));
% M4
m4_ell=ellipse(ucoef(4,:),ucoef(5,:),vcoef(4,:),vcoef(5,:));
