%  overplot_ship_panels - plot shipboard data
% normally, this is the overplot, with the buoy being the primary plot
% set-up. But after we leave the area, we want the ship to return as the
% main plot routine, so this has the needed code for that
% see overplotshippanelsreal for the original.

%%%% get some (all?) user-supplied params
if strfind(argostype,'none') > 0
    atitle=[];
end
nextwin=6;
atitle=' ';
stitle = 'VOS: black ';
cyear=' 2011';

%
%%%% get all the data first
% truncate as you load, for better auto-axis ranges
%
% %get hourly, then minute vos data
% load vos1hr.mat; vos1h=vos;
% load( 'vos.mat');

load vos1hr.mat;
vos.yday=vos.mday-day1;    
iidx=find(vos.yday > (pmaxx - daystoplot));
% fprintf('vos: %d cut to %d\n', length(vos.yday),...
%     length(iidx));
vos=structtrunc(vos,iidx);



%%%% Now plot 
%%% add editing clauses as needed
%
% 1.atmp hrh  2.bpr prc  3.sst sal  4 lwr swr  5. wind
%% 
figure(1); clf;  % atmp, hrh
set(gcf,'Name','AT_RH');
subplot(2,1,1);    %atmp
hold on
line(vos.yday,vos.atmp,'Color','black','LineStyle',':')
title([titlemain atitle stitle]);
ax=axis;
axis([ pminx pmaxx ax(3:4) ]);
ylabel('atmp');

subplot(2,1,2);  %hrh
hold on
line(vos.yday,vos.hrh,'Color','black',...
    'LineStyle',':')
ax=axis;
axis([ pminx pmaxx ax(3:4)]);
ylabel('hrh');
xlabel(['Yearday ' cyear]);


figure(2); clf; % sst & sal
set(gcf,'Name','SST SSS');
subplot(2,1,1);   %sst
% % line(vos.yday,vos.sst,'Color','yellow','LineStyle',':'); 
% % %      if exist('sstH','var'),
% % %         line(sstH.yday,sstH.sst,'r.'); end 
% %  ax=axis;
% %  axis([ pminx pmaxx ax(3:4)]);
% % hold on

% subplot(2,1,2);  %sal
% hold on
% gsal=find(tsg.sal > 20);
% line(tsg.yday(gsal),tsg.sal(gsal),'Color','black','LineStyle',...
%     ':');
% 
% %      if exist('tsgH','var'),
% %         line(tsgH.yday,tsgH.sal,'r.'); end
% ax=axis;
% axis([ pminx pmaxx ax(3:4)]);

%% 
figure(3); clf; % bpr & prc
set(gcf,'Name','BPR PRC');
subplot(2,1,1); %bpr
hold on
line(vos.yday,vos.bpr,'Color','black','LineStyle',':');
 ax=axis;
 ax(4)=max([ax(4);vos.bpr]);
 axis([ pminx pmaxx ax(3:4)]);
title([titlemain atitle stitle]);
ylabel('bpr');

subplot(2,1,2);    % rain
% get rate from hourly vos precip (level)
rrate=[0; diff(vos.precip)];
%gr=find(rrate > -.1);
hold on;
%line(vos.yday(gr),rrate(gr),'Color','black',...
line(vos.yday,rrate,'Color','black',...
    'LineStyle',':');
ax=axis;
axis([ pminx pmaxx -1 ax(4)]);
ylabel('rain rate');
xlabel(['Yearday ' cyear]);


%%
figure(4); clf; % swr, lwr
set(gcf,'Name','SWR LWR');
subplot(2,1,1);  % swr
hold on
line(vos.yday,vos.swr,'Color','black', 'LineStyle',...
    ':');
ax=axis;
axis([ pminx pmaxx ax(3:4)]);
title([titlemain atitle stitle]);
ylabel('swr')

subplot(2,1,2);    % lwr
hold on
line(vos.yday,vos.lwr,'Color','black','LineStyle',':');
% ,...     'Marker','.','MarkerSize',2);
ax=axis;
axis([ pminx pmaxx ax(3) ax(4)]);
ylabel('lwr');
xlabel(['Yearday ' cyear]);


%% 
figure(5); clf; % wind spd & dir
set(gcf,'Name','Wind');
subplot(2,1,1);   % wind speed wnds
hold on
line(vos.yday,vos.wnds,'Color','black','LineStyle',':');
ax=axis;
axis([ pminx pmaxx ax(3:4)]);
title([titlemain atitle stitle]);
ylabel('wspd');

subplot(2,1,2);  %wdir
hold on
line(vos.yday,(vos.wndd),'Color','black','LineStyle',':');
ax=axis;
axis([ pminx pmaxx ax(3:4)]);
ylabel('wdir');
xlabel(['Yearday ' cyear]);

