[w1,jd1]=getv2('3221-a1h.cdf');   %surface 8m
[w2,jd2]=getv2('3191-a1h.cdf');   %tripod  37.5m
start=gregorian(jd1(1));
stop=gregorian(last(jd1));
i1=near(jd1,jd2(1),1);
i2=near(jd1,last(jd2),1);
w=w1(:);
w(:,2)=w(:,1)*NaN;
w(i1:i2,2)=w2(:);
[wlp,jdlp]=plfilt(w,jd1);
jdlp=jdlp(6:6:2184)';
wlp=wlp(6:6:2184,:);
 
% wind
uwind=getts('bulk8607.cdf','east_str',start,stop);
vwind=getts('bulk8607.cdf','north_str',start,stop);
bbwind=uwind+i*vwind;
clear uwind vwind
[windlp]=plfilt(bbwind,jd1);
windlp=windlp(6:6:2184);

% runoff
ans=ss(jdlp);
startlp=ans(1,:);
stoplp=ans(2,:);
[runoff,jdr]=getts('merrimack.cdf','merrimack',startlp,stoplp);
runoff=interpm(jdr,runoff,jdlp)';
% salt
salt=NaN*bbwind;
[salty,jd2]=getts('3191-a1h.cdf','salinity',start,stop);
i1=near(jd1,jd2(1),1);
i2=near(jd1,last(jd2),1);
salt(i1:i2)=salty;
clear salty
saltlp=plfilt(salt);
saltlp=saltlp(6:6:2184);

