Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
function minSSJTQC(hMainFig)
%
% This function is called after option/preferences menu has been activated
% and flag salinity data where SSJT < min as BAD if test is on
%
% Input
% -----
% hMainFig ............ Handle to the main user interface
%
% $Id$
% Get the data from the application GUI
% -------------------------------------
tsg = getappdata( hMainFig, 'tsg_data');
% Get BAD code value
% ----------------------
badCode = tsg.qc.hash.BAD.code;
ssjt_min = tsg.preference.ssjt_min_string;
% If necessary replace a comma by a point
% ---------------------------------------
ssjt_min = regexprep(ssjt_min, ',', '.');
% If bias not a numeric, str2double return a NaN
% ----------------------------------------------
ssjt_min = str2double( ssjt_min );
if isnumeric( ssjt_min ) && ~isnan( ssjt_min )
% Set salinity QC to BAD for ssps < ssps_max
% -----------------------------------------------------
ind = find(tsg.SSJT < ssjt_min);
if ~isempty( ind )
tsg.SSJT_QC(ind) = castByteQC( badCode, ind );
end
% Save tsg structure
% ------------------
setappdata( hMainFig, 'tsg_data', tsg);
else
msgbox('Enter a numeric value in the REFERENCE menu', 'ssjt QC',...
'error', 'modal');
end
end