%  plot_ship_8 panel - plot  shipboard data
%%%% get some (all?) user-supplied params

title2=[atitle ' VOS: black'];

addpath([matlabroot '/work']);

%%%% get the data, truncate   for better auto-axis ranges
%
load( 'vos1hr.mat');
vos.yday=vos.mday-day1;
pmaxx=maxx + (1/24);
    
iidx=find(vos.yday <= pmaxx & 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
%


subplot(4,2,3);    %atmp
line(vos.yday,vos.atmp,'Color','black','LineStyle','--')
hold on
title(titlemain);
%       if exist('vosH','var'),
%          line(vosH.yday,vosH.atmp,'r.'); end
ax=axis;
axis([ pminx pmaxx ax(3:4) ]);
% %   axis([ pminx pmaxx 5 27 ]);

%subplot(4,2,4);   %sst
% line(sst.yday,sst.sst,'Color','yellow','LineStyle',':');
% hold on
title(title2);
%      if exist('sstH','var'),
%         line(sstH.yday,sstH.sst,'r.'); end
%line(vos.yday,vos.stmp,'Color','black','LineStyle','--');
%      if exist('vosH','var'),
%         line(vosH.yday,vosH.stmp,'r.'); end
 ax=axis;
 axis([ pminx pmaxx ax(3:4)]);
% maxty=max(vos.stmp(find(vos.stmp < 50)));
% minty=min(vos.stmp(find(vos.stmp> 10)));
% axis([ pminx pmaxx minty maxty ]);
hold on

subplot(4,2,5); %bpr
line(vos.yday,vos.bpr,'Color','black','LineStyle','--');
ylabel('bpr');
hold on
 ax=axis;
 axis([ pminx pmaxx ax(3:4)]);
% axis([ pminx pmaxx 1005 1025]);

subplot(4,2,6);  %hrh
line(vos.yday,vos.hrh,'Color','black',...
    'LineStyle','--')
ylabel('hrh');
hold on
ax=axis;
axis([ pminx pmaxx ax(3:4)]);
% minty=min(vos.hrh(find(vos.hrh > 30))) -5;
% maxty=max(vos.hrh(find(vos.hrh < 110))) +5;
% axis([ pminx pmaxx minty maxty ]);

subplot(4,2,7);  % swr
line(vos.yday,vos.swr,'Color','black', 'LineStyle',...
    '--');
ylabel('swr')
hold on
ax=axis;
axis([ pminx pmaxx ax(3:4)]);
% axis([ pminx pmaxx -5 1050 ]);

subplot(4,2,8);    % lwr
line(vos.yday,vos.lwr,'Color','black','LineStyle','--');
% ,...     'Marker','.','MarkerSize',2);
ylabel('lwr')
hold on
ax=axis;
axis([ pminx pmaxx ax(3) ax(4)]);
% minty=min(vos.lwr(find(vos.lwr > 90))) -40;
%      axis([ pminx pmaxx 320 450 ]);

% subplot(4,2,7);    % rain
% gr=find(vos.precip < 60);
% 
% line(vos.yday(gr(2:end)),diff(vos.precip(gr)),'Color','black',...
%     'LineStyle','--');
% ylabel('rain');
% hold on
% 
% ax=axis;
% axis([ pminx pmaxx -1 ax(4)]);
% % %  axis([ pminx pmaxx -1 2]);
% 
% % subplot(4,2,8);  %sal
% % gsal=find(vos.sal > 20);
% % line(vos.yday(gsal),vos.sal(gsal),'Color','black','LineStyle',...
% %     '--');
% % ylabel('sal');
% % hold on
% % %      if exist('vosH','var'),
% % %         line(vosH.yday,vosH.sal,'r.'); end
% % ax=axis;
% % axis([ pminx pmaxx ax(3:4)]);
% 
% 
% % 
% % subplot(4,2,1);   % wspd
% % line(wind.yday,wind.wspd,'Color','black','LineStyle','--');
% % ylabel('WSPD');
% % hold on
% % %      if exist('windH','var'),
% % %         line(windH.yday,windH.rwspd,'r.'); end
% % title(titlemain);
% % % ax=axis;
% % % axis([ pminx pmaxx ax(3:4)]);
% % % axis([ pminx pmaxx -1 2]);
% % subplot(4,2,2);  %wdir
% % line(wind.yday,wind.wdir,'Color','black','LineStyle','--');
% % ylabel('WDIR');
% % hold on
% % %      if exist('windH','var'),
% % %         line(windH.yday,windH.rwdir,'r.'); end
% % title(title2);
% % % ax=axis;
% % % axis([ pminx pmaxx ax(3:4)]);
% % % % axis([ pminx pmaxx -5 365 ]);
% % 


