Newer
Older
function 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');
% Plot the Salinity with the right color code
% -------------------------------------------
axes( hAxes(1));
% plot all data in white to draw first axes before hold on if ind of
% tsg.SSPS_QC == NO_CONTROL is empty
% ----------------------------------
plot(hAxes(1), tsg.DAYD, tsg.SSPS, '.w');
hold on;
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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
% get list of keys from hashtable tsg.qc.hash, defined inside
% tsg_initialisation.m
% -----------------------------------------------------------
qc_list = get(tsg.qc.hash);
% iterate (loop) on each key store inside hastable
% ------------------------------------------------
for i=1:numel(qc_list)
% get key and some values in hashtable
% ------------------------------------
key = qc_list{i};
state = get(tsg.qc.hash, key, 'state');
code = get(tsg.qc.hash, key, 'code');
color = get(tsg.qc.hash, key, 'color');
% plot only for valid context menu (set to 'on')
% -------------------------------_______-------
if strcmp( state, 'on')
% plot tsg salinity sample with right code/color
% ----------------------------------------------
ind = find(tsg.SSPS_QC == code );
plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ...
strcat('.', color));
end
end
% ind = find(tsg.SSPS_QC == tsg.qc.Code.GOOD );
% plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ...
% strcat('.',tsg.qc.Color.GOOD));
%
% 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), ...
% strcat('.',tsg.qc.Color.BAD));
hold off;
% set HandleVisibility 'On' to 'Callback' on first axes
% -----------------------------------------------------
% set(hAxes(1), 'HandleVisibility', 'Callback');
% 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