% intercomp: make multiple plots

vos=load ('vos.mat');
ship=load ('shipmet.mat');

day1=datenum(2008,1,0);
vos.yday=vos.mday - day1;
ship.yday=ship.mday-day1;
load  'Y:\ntas6d.mat'
%  Name           Size             Bytes  Class     Attributes
%
% imet_1        14x117            13104  double
% imet_2        14x116            12992  double
% imet_3        14x1                112  double
% imet_4        14x1                112  double
% varnames       1x55               110  char
% SN 12 and 16
% minx= 196.2;
startyd=startmd-datenum(2008,1,0);
endyd=datenum(now)-day1 +.55;
nt8lgr1=AO_to_variables(imet_1,startyd,endyd);
nt8lgr2=AO_to_variables(imet_2,startyd,endyd);
minx= startyd; maxx=endyd;
fprintf('plotting %.2f to %.2f\n', startyd, endyd);
figure(1);   
clf; clear stplh
subplot(4,1,1)
plot(vos.yday,vos.swr,'b');
ylabel('swr');  hold on
plot(ship.yday,ship.swr,'k');
plot(nt8lgr1.yday,nt8lgr1.swr,'m.');
plot(nt8lgr2.yday,nt8lgr2.swr,'c.');
% plot(s6lgr1.yday,s6lgr1.swr,'k');
% plot(s6lgr2.yday,s6lgr2.swr,'g');
ax=axis; axis([ minx maxx ax(3:4)])
  axis([minx maxx -20 1100 ])
  title('Oceanus Athena (black) and VOS (blue) Systems')


subplot(4,1,2)
plot(vos.yday,vos.atmp,'b')
ylabel('atmp');  hold on
plot(ship.yday,ship.atmp,'k')
plot(nt8lgr1.yday,nt8lgr1.atmp,'m.');
plot(nt8lgr2.yday,nt8lgr2.atmp,'c.');
% plot(s6lgr1.yday,s6lgr1.atmp,'k');
% plot(s6lgr2.yday,s6lgr2.atmp,'g')
ax=axis;axis([ minx maxx ax(3:4)])
 axis([ minx maxx 25 30 ]);
%  title('Stratus 2006 Shipboard/Buoy Comparison');


%
subplot(4,1,3)
plot(ship.yday,ship.sbetemp,'b');
ylabel('sst');  hold on
plot(ship.yday,ship.tsgsst ,'k');
plot(nt8lgr1.yday,nt8lgr1.sst,'m.');
plot(nt8lgr2.yday,nt8lgr2.sst,'c.');
% plot(s6lgr1.yday,s6lgr1.sst,'k');
% plot(s6lgr2.yday,s6lgr2.sst,'g');
ax=axis; axis([minx maxx ax(3:4)])
 axis([ minx maxx  27 29 ])
stplh=text(minx+.02,27.2,'sbe black,tsg blue');

subplot(4,1,4);
plot(vos.yday,vos.hrh,'b');
ylabel('hrh');  hold on;
plot(ship.yday,ship.hrh,'k');
hold on;
 plot(nt8lgr1.yday,nt8lgr1.hrh,'m.');
 plot(nt8lgr2.yday,nt8lgr2.hrh,'c.');
% plot(s6lgr1.yday,s6lgr1.hrh,'k');
% plot(s6lgr2.yday,s6lgr2.hrh,'g');
ax=axis; axis([minx maxx ax(3:4)]);
axis([ minx maxx 62 95 ]);
% 
figure(2); clf

 subplot(4,1,1);
plot(vos.yday,vos.bpr,'b');
ylabel('bpr');  hold on
plot(ship.yday,ship.bpr,'k');
plot(nt8lgr1.yday,nt8lgr1.bpr,'m.');
plot(nt8lgr2.yday,nt8lgr2.bpr, 'c.');
% % plot(s6lgr1.yday,s6lgr1.bpr,'k');
% % plot(s6lgr2.yday,s6lgr2.bpr,'g');
ax=axis;axis([ minx maxx ax(3:4)]);
 axis([minx maxx 1010 1018]);
title('Oceanus Athena (black) and VOS (blue) Systems');

subplot(4,1,2)
% [mag,dir] = vect2md(vx,vy);
% converts vectors east and north (vx,vy) to speed and heading
%[vos.wspd, vos.wdir ] = vect2md(vos.wndu,vos.wndv);
%[vx,vy] = md2vect(mag,dir);
% converts speed and heading to vectors east and north (vx,vy)

% was relwspd, relwdir (rotated)
plot(ship.yday,ship.wspd,'k'); 
ylabel('wspd');  hold on
plot(nt8lgr1.yday,nt8lgr1.wnds,'m.');
plot(nt8lgr2.yday,nt8lgr2.wnds,'c.');
% [ship.urel, ship.vrel] = md2vect(ship.relwspd,ship.relwdir);
% [ship.wndu, ship.wndv] = md2vect(ship.wspd,ship.wdir);
ax=axis; axis([minx maxx ax(3:4)])
axis([minx maxx 0 18]);

 subplot(4,1,3)
%  ship.relwdir=ship.relwdir+180;  blah=find( ship.relwdir > 360);
%  ship.relwdir(blah) = ship.relwdir(blah)-360;
 ship.wdir=ship.wdir+180;  blah=find( ship.wdir > 360);
 ship.wdir(blah) = ship.wdir(blah)-360;
plot(ship.yday,ship.wdir,'k');
ylabel('wdir');  hold on
plot(nt8lgr1.yday,nt8lgr1.wndd,'m.');
plot(nt8lgr2.yday,nt8lgr2.wndd,'c.');

%plot(vos.yday,vos.wdir,'b');
ax=axis; axis([minx maxx ax(3:4)])
axis([minx maxx 20 360]);

subplot(4,1,4)
plot(vos.yday,vos.lwr,'b');
ylabel('lwr');  hold on
plot(nt8lgr1.yday,nt8lgr1.lwr,'m.');
plot(nt8lgr2.yday,nt8lgr2.lwr,'c.');
ax=axis; axis([minx maxx ax(3:4)])
axis([minx maxx  375 455]);

get_new_axies
clear get_new_axies
% 
% ylabel('wndv');  hold on
% plot(nt8lgr1.yday,nt8lgr1.wndn,'m.');
% ylabel('wndu');  hold on
% % plot(nt8lgr1.yday,nt8lgr1.wnde,'m.');
% % plot(nt8lgr2.yday,nt8lgr2.wnde,'c.');
% %  plot(s6lgr1.yday,s6lgr1.wnde,'k');
% % plot(s6lgr2.yday,s6lgr2.wnde,'g');
% ax=axis; axis([minx maxx ax(3:4)]);
% % axis([minx maxx -12 12])
% % title('Stratus 2006 Shipboard/Buoy Comparison');
% %
% subplot(4,1,2)
% plot(vos.yday,vos.wndv,'b');
% ylabel('wndv');  hold on
% plot(nt8lgr1.yday,nt8lgr1.wndn,'m.');
% plot(nt8lgr2.yday,nt8lgr2.wndn,'c.');
% % plot(s6lgr1.yday,s6lgr1.wndn,'k');
% % plot(s6lgr2.yday,s6lgr2.wndn,'g');
% ax=axis; axis([minx maxx ax(3:4)]);
% % axis([minx maxx  -4 8])
% %

% 
% 
