Newer
Older
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');
% Plot the Salinity with the right color code
% -------------------------------------------
axes( hAxes(1));
ind = find(tsg.SSPS_QC <= tsg.qc.Code.NO_CONTROL );
plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ...
strcat('.',tsg.qc.Color.NO_CONTROL));
ind = find(tsg.SSPS_QC == tsg.qc.Code.GOOD );
plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ...
ind = find(tsg.SSPS_QC == tsg.qc.Code.PROBABLY_GOOD );
plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ...
strcat('.',tsg.qc.Color.PROBABLY_GOOD));
ind = find(tsg.SSPS_QC == tsg.qc.Code.PROBABLY_BAD );
plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ...
strcat('.',tsg.qc.Color.PROBABLY_BAD));
ind = find(tsg.SSPS_QC == tsg.qc.Code.BAD );
plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ...
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
% 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