Skip to content
Snippets Groups Projects
Commit 8f56122e authored by jacques.grelet_ird.fr's avatar jacques.grelet_ird.fr
Browse files

creation dynamique de la structure tsg a partir des objets tsg_nc

Renumerotation des codes de qualités suivant le document GOSUD 1.4
Ajout d'un code (6), HARBOUR
parent 6d5ce556
No related branches found
No related tags found
No related merge requests found
...@@ -14,11 +14,17 @@ function tsg_initialisation(hTsgGUI, hQcCmenu) ...@@ -14,11 +14,17 @@ function tsg_initialisation(hTsgGUI, hQcCmenu)
% Constants for NetCDF DATA FORMAT TSG % Constants for NetCDF DATA FORMAT TSG
% ------------------------------------------------------------------------- % -------------------------------------------------------------------------
% netcdf file version % netcdf file version
% -------------------
FORMAT_VERSION = '1.4'; FORMAT_VERSION = '1.4';
% date of reference for julian days, is 1st january 1950 % date of reference for julian days, is 1st january 1950
% ------------------------------------------------------
REFERENCE_DATE_TIME = '19500101000000'; REFERENCE_DATE_TIME = '19500101000000';
% get actual date
% ---------------
date = datestr(now,30);
% ------------------------------------------------------------------------- % -------------------------------------------------------------------------
% Levitus field for climatology % Levitus field for climatology
% ------------------------------------------------------------------------- % -------------------------------------------------------------------------
...@@ -41,12 +47,29 @@ tsg.qc.Color.GOOD = 'b'; ...@@ -41,12 +47,29 @@ tsg.qc.Color.GOOD = 'b';
tsg.qc.Color.PROBABLY_GOOD = 'g'; tsg.qc.Color.PROBABLY_GOOD = 'g';
tsg.qc.Color.PROBABLY_BAD = 'm'; tsg.qc.Color.PROBABLY_BAD = 'm';
tsg.qc.Color.BAD = 'r'; tsg.qc.Color.BAD = 'r';
tsg.qc.Color.HARBOUR = 'c';
tsg.qc.Code.NO_CONTROL = 1; % Quality flags reference table, see GOSUD, DATA FORMAT TSG V1.4, table 4
tsg.qc.Code.GOOD = 2; % -----------------------------------------------------------------------
tsg.qc.Code.PROBABLY_GOOD = 3; % Code Meaning
tsg.qc.Code.PROBABLY_BAD = 4; %
tsg.qc.Code.BAD = 5; % 0 No QC was performed
% 1 Good data
% 2 Probably good data
% 3 Bad data that are potentially correctable
% 4 Bad data
% 5 Value changed
% 6 Data acquired in harbour
% 7 Not used
% 8 Interpolated value
% 9 Missing value
tsg.qc.Code.NO_CONTROL = 0;
tsg.qc.Code.GOOD = 1;
tsg.qc.Code.PROBABLY_GOOD = 2;
tsg.qc.Code.PROBABLY_BAD = 3;
tsg.qc.Code.BAD = 4;
tsg.qc.Code.HARBOUR = 6;
tsg.qc.Code.ACTIVE = tsg.qc.Code.NO_CONTROL; tsg.qc.Code.ACTIVE = tsg.qc.Code.NO_CONTROL;
tsg.qc.Color.ACTIVE = tsg.qc.Color.NO_CONTROL; tsg.qc.Color.ACTIVE = tsg.qc.Color.NO_CONTROL;
...@@ -75,130 +98,156 @@ cst.COR_TIME_WINDOWS = 10; ...@@ -75,130 +98,156 @@ cst.COR_TIME_WINDOWS = 10;
% -------------------------------------------------- % --------------------------------------------------
setappdata( hTsgGUI, 'constante', cst); setappdata( hTsgGUI, 'constante', cst);
% Get variables list codes from class tsg_nc with file 'tsg_ncvar.csv'
% --------------------------------------------------------------------
ncv = tsg_nc('tsg_ncvar.csv');
ncv_keys = keys(ncv);
% Get global attributes list from class tsg_nc with file 'tsg_ncattr.csv'
% -----------------------------------------------------------------------
nca = tsg_nc('tsg_ncattr.csv');
nca_keys = keys(nca);
% store tsg NetCDF data structure % store tsg NetCDF data structure
% ------------------------------- % -------------------------------
% get actual date
date = datestr(now,30);
% dimensions % dimensions
tsg.DAYD = 0; % ----------
tsg.DAYD_WS = 0; tsg.DAYD = [];
tsg.DAYD_EXT = 0; tsg.DAYD_WS = [];
tsg.DAYD_EXT = [];
% initialise tsg structure from tsg_nc objects
% --------------------------------------------
% variables
% ---------
for i=1:numel(ncv_keys)
variable = ncv_keys{i};
tsg.(variable) = [];
end
% globals attributes % globals attributes
tsg.PLATFORM_NAME = ''; % ------------------
tsg.SHIP_CALL_SIGN = ''; for i=1:numel(nca_keys)
tsg.SHIP_MMSI = ''; global_att = nca_keys{i};
tsg.TSG_TYPE = ''; tsg.(global_att) = '';
tsg.TSG_NUMBER = ''; end
tsg.TINT_TYPE = '';
tsg.TINT_NUMBER = ''; % tsg.PLATFORM_NAME = '';
tsg.DATA_TYPE = ''; % tsg.SHIP_CALL_SIGN = '';
tsg.DATA_MODE = ''; % tsg.SHIP_MMSI = '';
tsg.SAMPLING_PERIOD = ''; % tsg.TSG_TYPE = '';
tsg.PROCESSING_STATUS = ''; % tsg.TSG_NUMBER = '';
tsg.DATE_START = ''; % tsg.TINT_TYPE = '';
tsg.DATE_END = ''; % tsg.TINT_NUMBER = '';
tsg.SOUTH_LATX = ''; % tsg.DATA_TYPE = '';
tsg.NORTH_LATX = ''; % tsg.DATA_MODE = '';
tsg.WEST_LONX = ''; % tsg.SAMPLING_PERIOD = '';
tsg.EAST_LONX = ''; % 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.FORMAT_VERSION = FORMAT_VERSION;
tsg.DATE_CREATION = [date(1:8) date(10:15)]; tsg.DATE_CREATION = [date(1:8) date(10:15)];
tsg.DATE_UPDATE = tsg.DATE_CREATION; tsg.DATE_UPDATE = tsg.DATE_CREATION;
tsg.DATA_RESTRICTIONS = ''; tsg.REFERENCE_DATE_TIME = REFERENCE_DATE_TIME;
tsg.CITATION = ''; % tsg.DATA_RESTRICTIONS = '';
tsg.COMMENT = ''; % tsg.CITATION = '';
tsg.PROJECT_NAME = ''; % tsg.COMMENT = '';
tsg.PI_NAME = ''; % tsg.PROJECT_NAME = '';
tsg.DATA_CENTRE = ''; % tsg.PI_NAME = '';
tsg.DATA_ACQUISITION = ''; % tsg.DATA_CENTRE = '';
tsg.PROCESSING_CENTRE = ''; % tsg.DATA_ACQUISITION = '';
tsg.PROCESSING_STATES = ''; % tsg.PROCESSING_CENTRE = '';
% tsg.PROCESSING_STATES = '';
% variables describing TSG installation (Salinity, SSPS et Jacket % variables describing TSG installation (Salinity, SSPS et Jacket
% Temperature SSJT) % Temperature SSJT)
tsg.SSPS_DEPH = 0; % tsg.SSPS_DEPH = [];
tsg.SSPS_DEPH_MIN = 0; % tsg.SSPS_DEPH_MIN = [];
tsg.SSPS_DEPH_MAX = 0; % tsg.SSPS_DEPH_MAX = [];
tsg.CNDC_CALCOEF = [99999 99999 99999 99999 99999]; % tsg.CNDC_CALCOEF = [];
tsg.CNDC_LINCOEF = [99999 99999]; % tsg.CNDC_LINCOEF = [];
tsg.SSJT_CALCOEF = [99999 99999 99999 99999 99999]; % tsg.SSJT_CALCOEF = [];
tsg.SSJT_LINCOEF = [99999 99999]; % tsg.SSJT_LINCOEF = [];
%
% variables describing Temperature sensor at intake (SSJT) installation % % variables describing Temperature sensor at intake (SSJT) installation
tsg.SSTP_DEPH = 0; % tsg.SSTP_DEPH = [];
tsg.SSTP_DEPH_MIN = 0; % tsg.SSTP_DEPH_MIN = [];
tsg.SSTP_DEPH_MAX = 0; % tsg.SSTP_DEPH_MAX = [];
tsg.SSTP_CALCOEF = [99999 99999 99999 99999 99999]; % tsg.SSTP_CALCOEF = [];
tsg.SSTP_LINCOEF = [99999 99999]; % tsg.SSTP_LINCOEF = [];
%
% Coordinates % % Coordinates
tsg.DATE = []; % tsg.DATE = [];
tsg.DAYD = []; % tsg.DAYD = [];
tsg.LATX = []; % tsg.LATX = [];
tsg.LONX = []; % tsg.LONX = [];
tsg.POSITION_QC = []; % tsg.POSITION_QC = [];
tsg.SPDC = []; % tsg.SPDC = [];
tsg.REFERENCE_DATE_TIME = REFERENCE_DATE_TIME; % tsg.REFERENCE_DATE_TIME = REFERENCE_DATE_TIME;
%
% variables % % variables
tsg.PRES = []; % tsg.PRES = [];
tsg.SSJT = []; % tsg.SSJT = [];
tsg.SSJT_STD = []; % tsg.SSJT_STD = [];
tsg.SSJT_CAL = []; % tsg.SSJT_CAL = [];
tsg.SSJT_ADJUSTED = []; % tsg.SSJT_ADJUSTED = [];
tsg.SSJT_ADJUSTED_ERROR = []; % tsg.SSJT_ADJUSTED_ERROR = [];
tsg.SSJT_ADJUSTED_QC = []; % tsg.SSJT_ADJUSTED_QC = [];
tsg.SSJT_ADJUSTED_HIST = []; % tsg.SSJT_ADJUSTED_HIST = [];
tsg.CNDC = []; % tsg.CNDC = [];
tsg.CNDC_STD = []; % tsg.CNDC_STD = [];
tsg.CNDC_CAL = []; % tsg.CNDC_CAL = [];
%
%% a verifier !!!!! % %% a verifier !!!!!
tsg.SSTP = []; % tsg.SSTP = [];
tsg.SSTP_QC = []; % tsg.SSTP_QC = [];
tsg.SSTP_CAL = []; % tsg.SSTP_CAL = [];
tsg.SSTP_ADJUSTED = []; % tsg.SSTP_ADJUSTED = [];
tsg.SSTP_ADJUSTED_ERROR = []; % tsg.SSTP_ADJUSTED_ERROR = [];
tsg.SSTP_ADJUSTED_QC = []; % tsg.SSTP_ADJUSTED_QC = [];
tsg.SSTP_ADJUSTED_HIST = []; % tsg.SSTP_ADJUSTED_HIST = [];
%
tsg.SSPS = []; % tsg.SSPS = [];
tsg.SSPS_QC = []; % tsg.SSPS_QC = [];
tsg.SSPS_CAL = []; % tsg.SSPS_CAL = [];
tsg.SSPS_ADJUSTED = []; % tsg.SSPS_ADJUSTED = [];
tsg.SSPS_ADJUSTED_ERROR = []; % tsg.SSPS_ADJUSTED_ERROR = [];
tsg.SSPS_ADJUSTED_QC = []; % tsg.SSPS_ADJUSTED_QC = [];
tsg.SSPS_ADJUSTED_HIST = []; % tsg.SSPS_ADJUSTED_HIST = [];
%
% Water Sample Coordinates % % Water Sample Coordinates
tsg.DATE_WS = []; % tsg.DATE_WS = [];
tsg.DAYD_WS = []; % tsg.DAYD_WS = [];
tsg.LATX_WS = []; % tsg.LATX_WS = [];
tsg.LONX_WS = []; % tsg.LONX_WS = [];
%
% Water Sample variables % % Water Sample variables
tsg.SSPS_WS = []; % tsg.SSPS_WS = [];
tsg.SSPS_WS_QC = []; % tsg.SSPS_WS_QC = [];
%tsg.SSPS_WS_DIF = []; % %tsg.SSPS_WS_DIF = [];
%tsg.SSPS_WS_SMOOTH = []; % a verifier % %tsg.SSPS_WS_SMOOTH = []; % a verifier
tsg.SSPS_WS_ANALDATE = []; % tsg.SSPS_WS_ANALDATE = [];
tsg.SSPS_WS_BOTTLE = []; % tsg.SSPS_WS_BOTTLE = [];
%
% External data coordinates % % External data coordinates
tsg.DATE_EXT = []; % tsg.DATE_EXT = [];
tsg.DAYD_EXT = []; % tsg.DAYD_EXT = [];
tsg.LATX_EXT = []; % tsg.LATX_EXT = [];
tsg.LONX_EXT = []; % tsg.LONX_EXT = [];
%
% External data variables % % External data variables
tsg.SSTP_EXT = []; % tsg.SSTP_EXT = [];
tsg.SSTP_EXT_QC = []; % tsg.SSTP_EXT_QC = [];
tsg.SSTP_EXT_TYPE = []; % tsg.SSTP_EXT_TYPE = [];
tsg.SSPS_EXT = []; % tsg.SSPS_EXT = [];
tsg.SSPS_EXT_QC = []; % tsg.SSPS_EXT_QC = [];
tsg.SSPS_EXT_TYPE = []; % tsg.SSPS_EXT_TYPE = [];
% Save structure tsg % Save structure tsg
setappdata( hTsgGUI, 'tsg_data', tsg); setappdata( hTsgGUI, 'tsg_data', tsg);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment