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 [] = automaticQC( hTsgGUI )
%
% function [] = automaticQC( hTsgGUI )
%
% Automatic controlon TSG time series
%
% Test for :
% No date or time
% SSS < 0 and SSS > 40
%
% Get application data : TSG structure
% --------------------------------------
tsg = getappdata( hTsgGUI, 'tsg_data');
% Delete records with date and time at NaN
% ----------------------------------------
indNaN = find( isnan(tsg.DAYD) == 1 );
tsg.DAYD(indNaN) = [];
tsg.DATE(indNaN,:) = [];
tsg.LATX(indNaN) = [];
tsg.LONX(indNaN) = [];
tsg.SSJT(indNaN) = [];
tsg.SSPS(indNaN) = [];
tsg.SSPS_QC(indNaN) = [];
tsg.SPDC(indNaN) = [];
if ~isempty( tsg.SSJT_FREQ )
tsg.SSJT_FREQ(indNaN) = [];
tsg.CNDC_FREQ(indNaN) = [];
end
% Get BAD code value
% ------------------
badCode = get(tsg.qc.hash, 'BAD', 'code');
% Set salinity QC to BAD for SSS > 40
% -----------------------------------
ind = find(tsg.SSPS > 40);
tsg.SSPS_QC(ind) = badCode*ones(size(ind),1);
% Set salinity QC to BAD for SSS < 0
% -----------------------------------
ind = find(tsg.SSPS < 0);
tsg.SSPS_QC(ind) = badCode*ones(size(ind),1);
% Save the data in the application GUI
% ------------------------------------
setappdata( hTsgGUI, 'tsg_data', tsg );
end