From 5e97f003282304e3ff3193afeeeaa827d29a6baf Mon Sep 17 00:00:00 2001
From: Jacques Grelet <jacques.grelet@ird.fr>
Date: Tue, 8 Jan 2008 14:43:02 +0000
Subject: [PATCH] =?UTF-8?q?renomm=C3=A9=20tsg=5Fplot=5FSalTempVel.m=20en?=
 =?UTF-8?q?=20plot=5FSalTempVel.m?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 tsg_util/plot_SalTempVel.m | 73 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)
 create mode 100644 tsg_util/plot_SalTempVel.m

diff --git a/tsg_util/plot_SalTempVel.m b/tsg_util/plot_SalTempVel.m
new file mode 100644
index 0000000..12bbafc
--- /dev/null
+++ b/tsg_util/plot_SalTempVel.m
@@ -0,0 +1,73 @@
+function tsg_plot_SalTempVel( hTsgGUI, hAxes )
+% Function to plot the Salinity, Temperature TSG data as well as the
+% ship velocity
+%
+% Input
+% -----
+% hTsgGUI ............ Handel to the main user interface
+% hPlotAxes .......... Handels to the 3 graphic axes
+%
+% Output
+% ------
+% $Id$
+
+% Retrieve named application data
+% -------------------------------
+tsg = getappdata( hTsgGUI, 'tsg_data');
+qc  = getappdata( hTsgGUI, 'qcColor');
+
+% Plot the Salinity with the right color code
+% -------------------------------------------
+axes( hAxes(1));
+
+ind = find(tsg.SSPS_QC <= qc.Code.NO_CONTROL );
+plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ...
+               strcat('.',qc.Color.NO_CONTROL));
+
+hold on;
+
+ind = find(tsg.SSPS_QC == qc.Code.GOOD );
+plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ...
+               strcat('.',qc.Color.GOOD));
+           
+ind = find(tsg.SSPS_QC == qc.Code.PROBABLY_GOOD );
+plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ...
+               strcat('.',qc.Color.PROBABLY_GOOD));
+           
+ind = find(tsg.SSPS_QC == qc.Code.PROBABLY_BAD );
+plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ...
+               strcat('.',qc.Color.PROBABLY_BAD));
+           
+ind = find(tsg.SSPS_QC == qc.Code.BAD );
+plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ...
+               strcat('.',qc.Color.BAD));
+hold off;             
+
+% Plot Temperature and ship velocity with no qc color code
+% ---------------------------------------------------------
+plot(hAxes(2), tsg.DAYD, tsg.SSJT, '.');
+plot(hAxes(3), tsg.DAYD, tsg.SPDC, '.k');
+
+% Formatted x-TIME axes
+% ---------------------
+datetick(hAxes(1), 'x');
+datetick(hAxes(2), 'x');
+datetick(hAxes(3), 'x');
+
+% Write some 'Y' label
+% ------------------
+set(get(hAxes(1), 'Ylabel'), 'String', 'Salinity');
+set(get(hAxes(2), 'Ylabel'), 'String', 'Temperature (°C)');
+set(get(hAxes(3), 'Ylabel'), 'String', 'Ship Velocity (knots)');
+
+% Make the axes visible
+% ---------------------
+set(hAxes(1), 'Visible', 'on' );
+set(hAxes(2), 'Visible', 'on' );
+set(hAxes(3), 'Visible', 'on' );
+
+% The 3 axes will behave identically when zoomed and panned
+% ---------------------------------------------------------
+linkaxes([hAxes(1),hAxes(2),hAxes(3)], 'x');
+
+end
-- 
GitLab