%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% PURPOSE: Plot raw CTD data
% AUTHOR:  Initial; rsm, nst
% DATE:    01/06/24
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Units and Fundamental Constants:
  units

  if exist('ctdlog') ~= 1, disp('CTD data not available'), return, end

  str = [' ',titleStr,' ',myDate];
  PaperPosn = [.5 .5 3.75 2.5];
  FigurePosn = [5 30 815 760];
  i = 0;

  if exist( 'ctdFig' ) ~= 1
      ctdFig = figure;
  else 
      figure( ctdFig ); 
  end
    
  set( ctdFig, 'Name', 'Dorado/ALTEX CTD Plot', ...
       'DeleteFcn', 'clear ctdFig' );
  set(gcf,'position',position)
  clf

    subplot(3,1,1)
    [xx,yy] = stairs( ctdlog(:,1), ctdlog(:,conductivity));
    plot(xx,yy);
    ylabel('S/m')
    title(['Conductivity',str]);
    grid on

    subplot(3,1,2)
    [xx,yy] = stairs( ctdlog(:,1), ctdlog(:,temperature));
    plot(xx,yy);
    ylabel('Degrees Celsius')
    title(['Temperature',str]);
    grid on

    subplot(3,1,3)
    [xx,yy] = stairs( dataNav(:,1), dataNav(:,mDepth));
    plot(xx,yy);
    set( gca, 'ydir', 'reverse' );
    ylabel('Meters')
    title(['Depth',str]);
    grid on


