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
function calibration( hMainFig )
%
% Compute salinity from calibrated conductivity and jacket temperature
%
% Get tsg application data
% ------------------------
tsg = getappdata( hMainFig, 'tsg_data' );
if ~isempty( tsg.CNDC )
cndcCal = tsg.CNDC_LINCOEF(1) * tsg.CNDC + tsg.CNDC_LINCOEF(2);
else
msgbox( 'Conductivity not loaded',...
'Function ''Calibration''',...
'warn', 'modal');
end
if ~isempty( tsg.SSJT )
ssjtCal = tsg.SSJT_LINCOEF(1) * tsg.SSJT + tsg.SSJT_LINCOEF(2);
else
msgbox( 'Jacket temperature not loaded',...
'Function ''Calibration''',...
'warn', 'modal');
end
% Compute salinity - Use CSIRO functions
% --------------------------------------
tsg.SSPS_CAL = sw_salt( ...
cndcCal/sw_c3515(), t90TOt68(ssjtCal), zeros(size(cndcCal)));
% Keep SSJT calibrated
% --------------------
tsg.SSJT_CAL = ssjtCal;
% Save tsg application data
% --------------------------
setappdata( hMainFig, 'tsg_data', tsg );
end