clear all
load ArgosAndESRL/Argos
T1 = datenum(2015,4,22,22,0,0);
T2 = datenum(2015,4,24,12,0,0);
n1=find(sys3.mday>T1 & sys3.mday<T2);
n2=find(sys4.mday>T1 & sys4.mday<T2);

figure(1), clf
plot(sys3.mday(n1), sys3.wndd(n1), '.-', sys4.mday(n2),sys4.wndd(n2),'.-r')

load ArgosAndESRL/esrlflux
% hourly averaging
[mewnde, mte] = navdata(esrl.wnde', datevec(esrl.mday'), 4);
[mewndn, mte] = navdata(esrl.wndn', datevec(esrl.mday'), 4);
mte = mte+30/1440;
[mewspd, mewdir] = vect2md(mewnde, mewndn);
ne = find(mte>T1 & mte<T2);
hold on
plot(mte(ne), mewdir(ne), '.-g')
myticks(gca,1/24,4), grid on
title('WDIR at Stratus 13 from WHOI buoy and ship''s ESRL and Vaisala  ')
% ne = find(esrl.mday>T1 & esrl.mday<T2);
% hold on
% plot(esrl.mday(ne), esrl.wndd(ne), '.-g')

load ship
[ship.wspd,junk,junk] = convert_knot(ship.wspd);
ship.wdir = mod(ship.wdir+180, 360);
[ship.wnde, ship.wndn]= md2vect(ship.wspd, ship.wdir);
[mswnde, mts] = navdata(ship.wnde', datevec(ship.mday'), 4);
[mswndn, mts] = navdata(ship.wndn', datevec(ship.mday'), 4);
mts = mts+30/1440;
[mswspd, mswdir] = vect2md(mswnde, mswndn);
ns = find(mts>T1 & mts<T2);

plot(mts(ns), mswdir(ns), '.-k')
legend('sys3','sys4','esrl','ship')

%% Same for WSPD
figure(2), clf
plot(sys3.mday(n1), sys3.wnds(n1), '.-', sys4.mday(n2),sys4.wnds(n2),'.-r')
hold on
plot(mte(ne), mewspd(ne), '.-g')
plot(mts(ns), mswspd(ns), '.-k')
myticks(gca,1/24,4), grid on
title('WSPD at Stratus 13 from WHOI buoy and ship''s ESRL and Vaisala  ')
legend('sys3','sys4','esrl','ship')



