From 8f2f8e432a4807934fdcf818c5eae6d9f72d482c Mon Sep 17 00:00:00 2001
From: Jacques Grelet <jacques.grelet@ird.fr>
Date: Tue, 8 Jan 2008 14:54:30 +0000
Subject: [PATCH] =?UTF-8?q?utilise=20les=20conventions=20NetCDF=20V1.4=20i?=
 =?UTF-8?q?l=20existait=20un=20conflit=20avec=20la=20version=2061,=20a=20v?=
 =?UTF-8?q?erifier=20la=20validit=C3=A9=20des=20trac=C3=A9s?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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

diff --git a/tsg_util/plot_SalTsgSample.m b/tsg_util/plot_SalTsgSample.m
new file mode 100644
index 0000000..242610f
--- /dev/null
+++ b/tsg_util/plot_SalTsgSample.m
@@ -0,0 +1,117 @@
+function plot_SalTsgSample( hGUI, hAxes )
+%
+% Function to plot the Salinity from TSG and smaple meausrements
+%
+% Input
+% -----
+% hGUI ............... Handel to the user interface
+% hPlotAxes .......... Handels to the graphic axes
+%
+% Output
+% ------
+%
+
+% Retrieve named application data
+% -------------------------------
+tsg    = getappdata( hGUI, 'tsg_data');
+%sample = getappdata( hGUI, 'sample' );
+qc     = getappdata( hGUI, '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));
+           
+% Plot salinity sample on TSG plot
+% --------------------------------
+if ~isempty(tsg.SSPS_WS)
+    plot(hAxes(1), tsg.DAYD_WS, tsg.SSPS_WS, 'r*');
+end
+ 
+
+% Plot sample measurements
+% ------------------------
+% ind = find( tsg.SSPS_WS);
+% if ~isempty( ind )
+%     plot(hAxes(2), tsg.DAYD_WS(ind), tsg.SSPS_WS(ind), '.');
+% end
+% ind = find( tsg.SSPS_WS_EXT);
+% if ~isempty( ind )
+%     plot(hAxes(2), tsg.DAYD_EXT(ind), tsg.SSPS_EXT(ind), 'o');
+% end
+
+% Plot ship velocity
+% ------------------
+plot(hAxes(3), tsg.DAYD, tsg.SPDC, '.');
+
+%ind = find(sample.PSAL_QC <= qc.Code.NO_CONTROL );
+%plot(hAxes(2), sample.TIME(ind), sample.PSAL_DIF(ind), ...
+%               strcat('o',qc.Color.NO_CONTROL));
+
+%hold on;
+
+%ind = find(sample.PSAL_QC == qc.Code.GOOD );
+%plot(hAxes(2), sample.TIME(ind), sample.PSAL_DIF(ind), ...
+%               strcat('o',qc.Color.GOOD));
+           
+%ind = find(sample.PSAL_QC == qc.Code.PROBABLY_GOOD );
+%plot(hAxes(2), sample.TIME(ind), sample.PSAL_DIF(ind), ...
+%               strcat('o',qc.Color.PROBABLY_GOOD));
+           
+%ind = find(sample.PSAL_QC == qc.Code.PROBABLY_BAD );
+%plot(hAxes(2), sample.TIME(ind), sample.PSAL_DIF(ind), ...
+%               strcat('o',qc.Color.PROBABLY_BAD));
+           
+%ind = find(sample.PSAL_QC == qc.Code.BAD );
+%plot(hAxes(2), sample.TIME(ind), sample.PSAL_DIF(ind), ...
+%               strcat('o',qc.Color.BAD));
+
+%plot(hAxes(3), tsg.TIME, tsg.TEMP_TSG, '.');
+
+% Formatted x-TIME axes
+% ---------------------
+datetick(hAxes(1), 'x');
+get(hAxes(1), 'Xlim');
+datetick(hAxes(2), 'x');
+set(hAxes(2), 'Xlim', get(hAxes(1), 'Xlim'));    
+datetick(hAxes(3), 'x');
+
+% Write some 'Y' label
+% ------------------
+set(get(hAxes(1), 'Ylabel'), 'String', 'Salinity');
+set(get(hAxes(2), 'Ylabel'), 'String', 'Salinity Difference');
+set(get(hAxes(3), 'Ylabel'), 'String', 'Ship Velocity');
+
+% 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