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
51
52
53
54
55
56
57
58
59
function updateAdjustedVariable( hMainFig )
%
% Update adjusted SSPS and SSJT arrays once calibration has been
% applied to these variable.
%
% The TRICK :
% Test ADJUSTED_ERROR - Only records corrected compared to water sample
% get error values
%
% Get tsg application data
% ------------------------
tsg = getappdata( hMainFig, 'tsg_data' );
% Get VALUE_CHANGED
% -------------------------------------------------------
VALUE_CHANGED = get(tsg.qc.hash, 'VALUE_CHANGED', 'code');
% SSPS
% Get Adjusted records that were not corrected using Water samples
% Only records corrected get error values
% ----------------------------------------------------------------
ind = find( isnan(tsg.SSPS_ADJUSTED_ERROR ) == 1);
if ~isempty(tsg.SSPS_CAL)
tsg.SSPS_ADJUSTED(ind) = tsg.SSPS_CAL(ind);
tsg.SSPS_ADJUSTED_QC(ind) = VALUE_CHANGED;
else
% If the calibration has been canceled the ADJUSTED value is equal to
% the raw value
% -------------------------------------------------------------------
tsg.SSPS_ADJUSTED(ind) = tsg.SSPS(ind);
tsg.SSPS_ADJUSTED_QC(ind) = tsg.SSPS_QC(ind);
end
% SSJT
% Get Adjusted records that were not corrected using Water samples
% Only records corrected get error values
% ----------------------------------------------------------------
ind = find( isnan(tsg.SSJT_ADJUSTED_ERROR ) == 1);
if ~isempty(tsg.SSJT_CAL)
tsg.SSJT_ADJUSTED(ind) = tsg.SSJT_CAL(ind);
tsg.SSJT_ADJUSTED_QC(ind) = VALUE_CHANGED;
else
% If the calibration has been canceled the ADJUSTED value is equal to
% the raw value
% -------------------------------------------------------------------
tsg.SSJT_ADJUSTED(ind) = tsg.SSJT(ind);
tsg.SSJT_ADJUSTED_QC(ind) = tsg.SSJT_QC(ind);
end
% Save tsg application data
% --------------------------
setappdata( hMainFig, 'tsg_data', tsg );
end