% TSCAST - 
%
%    B. A. Moran, 04-Feb-1998

%    Copyright (C) 1995-1998
%    Massachussetts Institute of Technology
%    Sea Grant AUV Laboratory
%    $Id: navplot.m,v 1.3 1998/01/09 17:08:18 bamoran Exp $	

function tscast( depth, temp, salt, svel, going_up, going_down )

figure;

if nargin > 3
   subplot(1,3,1)
else
   subplot(1,2,1)
end

h1 = gca;

abc = temp;
abc(going_down) = NaN;
plot( abc, depth, 'r');
hold on
abc = temp;
abc(going_up) = NaN;
plot( abc, depth, 'b' ); 

clrs = get( h1, 'ColorOrder' );

xlabel( 'Temperature (^{o}C)')
ylabel( 'Depth (m)' );

if nargin > 3
   subplot(1,3,2)
else
   subplot(1,2,2)
end

h2 = gca
abc = salt;
abc(going_down) = NaN;
plot( abc, depth, 'r' );
abc = salt;
hold on;
abc(going_up) = NaN;
plot( abc, depth, 'b' );
xlabel( 'Salinity (psu)')

set( [h1 h2], 'YDir', 'reverse' );

if nargin > 3
   subplot( 1, 3, 3 )
   
   plot( svel, depth ); set( gca, 'YDir', 'rev' );
   xlabel( 'Sound Velocity (m/s)' )
end

zoom on;