Newer
Older
function tsg_initialisation(hTsgGUI, hQcCmenu)
%
% Input
% -----
% hTsgGUI ............ Handel to the main user interface
Yves Gouriou
committed
% hQcCmenu ........... Handel to the QC code context menu
%
% -------------------------------------------------------------------------
% Constants for NetCDF DATA FORMAT TSG
% -------------------------------------------------------------------------
% netcdf file version
FORMAT_VERSION = '1.4';
% date of reference for julian days, is 1st january 1950
REFERENCE_DATE_TIME = '19500101000000';
% -------------------------------------------------------------------------
% Levitus field for climatology
% -------------------------------------------------------------------------
tsg.levitus.data = [];
tsg.levitus.type = [];
% -------------------------------------------------------------------------
% Constants for the quality control procedure
% -------------------------------------------------------------------------
% Quality Code and color
qc.Color.NO_CONTROL = 'k';
qc.Color.GOOD = 'b';
qc.Color.PROBABLY_GOOD = 'g';
qc.Color.PROBABLY_BAD = 'm';
qc.Color.BAD = 'r';
qc.Code.NO_CONTROL = 1;
qc.Code.GOOD = 2;
qc.Code.PROBABLY_GOOD = 3;
qc.Code.PROBABLY_BAD = 4;
qc.Code.BAD = 5;
% Store default value 'quality' a application data - It's not useful
% ------------------------------------------------------------------
quality.Code = qc.Code.GOOD;
quality.Color = qc.Color.GOOD;
set( hQcCmenu, 'UserData', quality );
% Store the 'qc' structure as application data
% --------------------------------------------
setappdata( hTsgGUI, 'qcColor', qc);
% -------------------------------------------------------------------------
% Constants for the Correction procedure
% -------------------------------------------------------------------------
% Smoothing of tsg time series over 1 hour interval
% 1 hour interval expressed in MATLAB serial Number
% -------------------------------------------------
Yves Gouriou
committed
cst.TSG_DT_SMOOTH = datenum(0, 0, 0, 1, 0 , 0);
% Smoothing of tsg time series :
% Salinity, in one 1 hour interval, should not depart the average for more
% than SAL_STD_MAX standard deviation
% -----------------------------------------------------------------------
Yves Gouriou
committed
cst.TSG_STDMAX = 0.1;
% Correction is estimated by computing the median value of X tsg-sample
% differences
% Amount of days used to compute the correction
% ---------------------------------------------------------------------
Yves Gouriou
committed
cst.COR_TIME_WINDOWS = 10;
% store the 'const' structure as an application data
% --------------------------------------------------
Yves Gouriou
committed
setappdata( hTsgGUI, 'constante', cst);
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
% store tsg NetCDF data structure
% -------------------------------
% get actual date
date = datestr(now,30);
% dimensions
tsg.DAYD = 0;
tsg.DAYD_WS = 0;
tsg.DAYD_EXT = 0;
% globals attributes
tsg.PLATFORM_NAME = '';
tsg.SHIP_CALL_SIGN = '';
tsg.SHIP_MMSI = '';
tsg.TSG_TYPE = '';
tsg.TSG_NUMBER = '';
tsg.TINT_TYPE = '';
tsg.TINT_NUMBER = '';
tsg.DATA_TYPE = '';
tsg.DATA_MODE = '';
tsg.SAMPLING_PERIOD = '';
tsg.PROCESSING_STATUS = '';
tsg.DATE_START = '';
tsg.DATE_END = '';
tsg.SOUTH_LATX = '';
tsg.NORTH_LATX = '';
tsg.WEST_LONX = '';
tsg.EAST_LONX = '';
tsg.FORMAT_VERSION = FORMAT_VERSION;
tsg.DATE_CREATION = [date(1:8) date(10:15)];;
tsg.DATE_UPDATE = tsg.DATE_CREATION;
tsg.DATA_RESTRICTIONS = '';
tsg.CITATION = '';
tsg.COMMENT = '';
tsg.PROJECT_NAME = '';
tsg.PI_NAME = '';
tsg.DATA_CENTRE = '';
tsg.DATA_ACQUISITION = '';
tsg.PROCESSING_CENTRE = '';
tsg.PROCESSING_STATES = '';
% variables describing TSG installation (Salinity, SSPS et Jacket
% Temperature SSJT)
tsg.SSPS_DEPH = 0;
tsg.SSPS_DEPH_MIN = 0;
tsg.SSPS_DEPH_MAX = 0;
tsg.CNDC_CALCOEF = [99999 99999 99999 99999 99999];
tsg.CNDC_LINCOEF = [99999 99999];
tsg.SSJT_CALCOEF = [99999 99999 99999 99999 99999];
tsg.SSJT_LINCOEF = [99999 99999];
% variables describing Temperature sensor at intake (SSJT) installation
tsg.SSTP_DEPH = 0;
tsg.SSTP_DEPH_MIN = 0;
tsg.SSTP_DEPH_MAX = 0;
tsg.SSTP_CALCOEF = [99999 99999 99999 99999 99999];
tsg.SSTP_LINCOEF = [99999 99999];
% Coordinates
tsg.DATE = [];
tsg.DAYD = [];
tsg.LATX = [];
tsg.LONX = [];
tsg.POSITION_QC = [];
tsg.SPDC = [];
tsg.REFERENCE_DATE_TIME = REFERENCE_DATE_TIME;
% variables
tsg.PRES = [];
tsg.SSJT = [];
tsg.SSJT_STD = [];
tsg.SSJT_CAL = [];
tsg.SSJT_ADJUSTED = [];
tsg.SSJT_ADJUSTED_ERROR = [];
tsg.SSJT_ADJUSTED_QC = [];
tsg.SSJT_ADJUSTED_HIST = [];
tsg.CNDC = [];
tsg.CNDC_STD = [];
tsg.CNDC_CAL = [];
%% a verifier !!!!!
tsg.SSTP = [];
tsg.SSTP_QC = [];
tsg.SSTP_CAL = [];
tsg.SSTP_ADJUSTED = [];
tsg.SSTP_ADJUSTED_ERROR = [];
tsg.SSTP_ADJUSTED_QC = [];
tsg.SSTP_ADJUSTED_HIST = [];
tsg.SSPS = [];
tsg.SSPS_QC = [];
tsg.SSPS_CAL = [];
tsg.SSPS_ADJUSTED = [];
tsg.SSPS_ADJUSTED_ERROR = [];
tsg.SSPS_ADJUSTED_QC = [];
tsg.SSPS_ADJUSTED_HIST = [];
% Water Sample Coordinates
tsg.DATE_WS = [];
tsg.DAYD_WS = [];
tsg.LATX_WS = [];
tsg.LONX_WS = [];
% Water Sample variables
tsg.SSPS_WS = [];
tsg.SSPS_WS = [];
tsg.SSPS_WS_QC = [];
%tsg.SSPS_WS_DIF = [];
%tsg.SSPS_WS_SMOOTH = []; % a verifier
tsg.SSPS_WS_ANALDATE = [];
tsg.SSPS_WS_BOTTLE = [];
% External data coordinates
tsg.DATE_EXT = [];
tsg.DAYD_EXT = [];
tsg.LATX_EXT = [];
tsg.LONX_EXT = [];
% External data variables
tsg.SSTP_EXT = [];
tsg.SSTP_EXT_QC = [];
tsg.SSTP_EXT_TYPE = [];
tsg.SSPS_EXT = [];
tsg.SSPS_EXT_QC = [];
tsg.SSPS_EXT_TYPE = [];
% Save structure tsg
setappdata( hTsgGUI, 'tsg_data', tsg);