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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
function [minerror] = tsg_accuracy(hMainFig, PARA, dtTsg)
%
% Give the accuracy of TSG salinity/temperature measurement based on
% SeaBird specifications, to use as the minimum error on measurements
% see http://www.seabird.com/products/spec_sheets/38data.htm
% http://www.seabird.com/products/spec_sheets/3Sdata.htm
% http://www.seabird.com/products/spec_sheets/21data.htm
% http://www.seabird.com/products/spec_sheets/45data.htm
%
% Get the tsg and sample structures from the application
% ------------------------------------------------------
tsg = getappdata( hMainFig, 'tsg_data');
if strcmp( PARA, 'SSTP')
if strcmp( tsg.TYPE_TINT, 'SBE38') | strcmp( tsg.TYPE_TINT, 'SBE3S')
% Accuracy of intake temperature is 0.001C for SBE38/SBE3S sensors
minerror=0.001;
else
% Assume the same for other sensors
minerror=0.001;
end
end
if strcmp( PARA, 'SSJT')
if strcmp( tsg.TYPE_TSG, 'SBE45')
% Accuracy of jacket temperature is 0.002C for SBE45 TSG
minerror=0.002;
else
% Accuracy of jacket temperature is 0.01C for SBE21 TSG
minerror=0.01;
end
end
if strcmp( PARA, 'SSPS')
if strcmp( tsg.TYPE_TSG, 'SBE45')
% Accuracy of temperature/conductivity is 0.002C/0.005mS/cm for SBE45 TSG
errT=0.002;
errC=0.005;
else
% Accuracy of temperature/conductivity is 0.01C/0.01mS/cm for SBE21 TSG
errT=0.01;
errC=0.01;
end
if ~isempty( tsg.SSJT_CAL)
T = tsg.SSJT_CAL(dtTsg);
else
T = tsg.SSJT(dtTsg);
end
if ~isempty( tsg.CNDC_CAL)
C = tsg.CNDC_CAL(dtTsg);
else
C = tsg.CNDC(dtTsg);
end
% salinity error is computed from temperature/conductivity errors
% by error propagation in the salinity equation
% see Emery and Thomson, Data analysis methods in phys. oceano., p.273
R=C/sw_c3515();
rt = sw_salrt(T);
Rt=R./rt;
%Rt is a function of C,T
%error on Rt : err(Rt)^2=(d(Rt)/dC*errC)^2+(d(Rt)/dT*errT)^2
dRtdC=1./(rt*sw_c3515());
c68 = 1.00024;
c0 = 0.6766097;
c1 = 2.00564e-2;
c2 = 1.104259e-4;
c3 = -6.9698e-7;
c4 = 1.0031e-9;
dRtdT=c68*R.*(c1+(2*c2+(3*c3+4*c4*T).*T*c68).*T*c68)./(rt.^2);
errRt=sqrt((dRtdC*errC).^2+(dRtdT*errT).^2);
%S is a function of Rt,T
%error on S: err(S)^2=(dS/dRt*errRt)^2+(dS/dT*errT)^2
del_T68 = T * 1.00024 - 15;
Rtx = sqrt(Rt);
a0 = 0.0080;
a1 = -0.1692;
a2 = 25.3851;
a3 = 14.0941;
a4 = -7.0261;
a5 = 2.7081;
b0 = 0.0005;
b1 = -0.0056;
b2 = -0.0066;
b3 = -0.0375;
b4 = 0.0636;
b5 = -0.0144;
k = 0.0162;
dSdRt=(a1+(2*a2+(3*a3+(4*a4+5*a5*Rtx).*Rtx).*Rtx).*Rtx)./(2*Rtx)...
+(del_T68./(1+k*del_T68)).*(b1+(2*b2+(3*b3+(4*b4+5*b5*Rtx).*Rtx).*Rtx).*Rtx)./(2*Rtx);
dSdT=(b0+(b1+(b2+(b3+(b4+b5.*Rtx).*Rtx).*Rtx).*Rtx).*Rtx)./((1+k*del_T68).^2);
errS=sqrt((dSdRt.*errRt).^2+(dSdT.*errT).^2);
minerror=errS;
end
end
function [minerror] = tsg_accuracy(hMainFig, PARA)
%
% Give the accuracy of TSG salinity/temperature measurement based on
% SeaBird specifications, to use as the minimum error on measurements
% see http://www.seabird.com/products/spec_sheets/38data.htm
% http://www.seabird.com/products/spec_sheets/3Sdata.htm
% http://www.seabird.com/products/spec_sheets/21data.htm
% http://www.seabird.com/products/spec_sheets/45data.htm
%
% Get the tsg and sample structures from the application
% ------------------------------------------------------
tsg = getappdata( hMainFig, 'tsg_data');
if strcmp( PARA, 'SSTP')
if strcmp( tsg.TYPE_TINT, 'SBE38') | strcmp( tsg.TYPE_TINT, 'SBE3S')
% Accuracy of intake temperature is 0.001C for SBE38/SBE3S sensors
minerror=0.001;
else
% Assume the same for other sensors
minerror=0.001;
end
end
if strcmp( PARA, 'SSJT')
if strcmp( tsg.TYPE_TSG, 'SBE45')
% Accuracy of jacket temperature is 0.002C for SBE45 TSG
minerror=0.002;
else
% Accuracy of jacket temperature is 0.01C for SBE21 TSG
minerror=0.01;
end
end
if strcmp( PARA, 'SSPS')
if strcmp( tsg.TYPE_TSG, 'SBE45')
% Accuracy of temperature/conductivity is 0.002C/0.005mS/cm for SBE45 TSG
errT=0.002;
errC=0.005;
else
% Accuracy of temperature/conductivity is 0.01C/0.01mS/cm for SBE21 TSG
errT=0.01;
errC=0.01;
end
T=tsg.SSJT;
C=tsg.CNDC;
% salinity error is computed from temperature/conductivity errors
% by error propagation in the salinity equation
% see Emery and Thomson, Data analysis methods in phys. oceano., p.273
R=C/sw_c3515();
rt = sw_salrt(T);
Rt=R./rt;
%Rt is a function of C,T
%error on Rt : err(Rt)^2=(d(Rt)/dC*errC)^2+(d(Rt)/dT*errT)^2
dRtdC=1./(rt*sw_c3515());
c68 = 1.00024;
c0 = 0.6766097;
c1 = 2.00564e-2;
c2 = 1.104259e-4;
c3 = -6.9698e-7;
c4 = 1.0031e-9;
dRtdT=c68*R.*(c1+(2*c2+(3*c3+4*c4*T).*T*c68).*T*c68)./(rt.^2);
errRt=sqrt((dRtdC*errC).^2+(dRtdT*errT).^2);
%S is a function of Rt,T
%error on S: err(S)^2=(dS/dRt*errRt)^2+(dS/dT*errT)^2
del_T68 = T * 1.00024 - 15;
Rtx = sqrt(Rt);
a0 = 0.0080;
a1 = -0.1692;
a2 = 25.3851;
a3 = 14.0941;
a4 = -7.0261;
a5 = 2.7081;
b0 = 0.0005;
b1 = -0.0056;
b2 = -0.0066;
b3 = -0.0375;
b4 = 0.0636;
b5 = -0.0144;
k = 0.0162;
dSdRt=(a1+(2*a2+(3*a3+(4*a4+5*a5*Rtx).*Rtx).*Rtx).*Rtx)./(2*Rtx)...
+(del_T68./(1+k*del_T68)).*(b1+(2*b2+(3*b3+(4*b4+5*b5*Rtx).*Rtx).*Rtx).*Rtx)./(2*Rtx);
dSdT=(b0+(b1+(b2+(b3+(b4+b5.*Rtx).*Rtx).*Rtx).*Rtx).*Rtx)./((1+k*del_T68).^2);
errS=sqrt((dSdRt.*errRt).^2+(dSdT.*errT).^2);
minerror=errS;
end
end