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

correct some initialisation of <var_QC (use of NaN not allowed for QC, use code BAD instead

parent bbe92237
Branches
Tags
No related merge requests found
...@@ -23,9 +23,10 @@ nbFieldNames = length( tsgNames ); ...@@ -23,9 +23,10 @@ nbFieldNames = length( tsgNames );
% Get NO_CONTROL, GOOD, PROBABLY_BAD codes % Get NO_CONTROL, GOOD, PROBABLY_BAD codes
% ---------------------------------------- % ----------------------------------------
NO_CONTROL = tsg.qc.hash.NO_CONTROL.code; %NO_CONTROL = int8(tsg.qc.hash.NO_CONTROL.code);
GOOD = tsg.qc.hash.GOOD.code; GOOD = int8(tsg.qc.hash.GOOD.code);
PROBABLY_BAD = tsg.qc.hash.PROBABLY_BAD.code; PROBABLY_BAD = int8(tsg.qc.hash.PROBABLY_BAD.code);
BAD = int8(tsg.qc.hash.BAD.code);
% Display read file info on console % Display read file info on console
% --------------------------------- % ---------------------------------
...@@ -128,9 +129,9 @@ mm = repmat(NaN, [nn 1]); ...@@ -128,9 +129,9 @@ mm = repmat(NaN, [nn 1]);
yy = repmat(NaN, [nn 1]); yy = repmat(NaN, [nn 1]);
for it = 1:nn for it = 1:nn
ddmmyy_str = sprintf('%06d', ddmmyy(it)); ddmmyy_str = sprintf('%06d', ddmmyy(it));
dd(it) = str2num(ddmmyy_str(:,1:2)); dd(it) = str2num(ddmmyy_str(:,1:2)); %#ok<ST2NM>
mm(it) = str2num(ddmmyy_str(:,3:4)); mm(it) = str2num(ddmmyy_str(:,3:4)); %#ok<ST2NM>
yy(it) = 2000 + str2num(ddmmyy_str(:,5:6)); yy(it) = 2000 + str2num(ddmmyy_str(:,5:6)); %#ok<ST2NM>
end end
% Warning: for post-2000 files only! % Warning: for post-2000 files only!
...@@ -179,19 +180,18 @@ miss=-90; ...@@ -179,19 +180,18 @@ miss=-90;
% ------------------------------------------------------- % -------------------------------------------------------
if ~isempty(tsg.SSTP) if ~isempty(tsg.SSTP)
tsg.SSTP(tsg.SSTP<miss)=nan; tsg.SSTP(tsg.SSTP < miss) = NaN;
tsg.SSTP_QC(isnan(tsg.SSTP))=nan; tsg.SSTP_QC = castByteQC( GOOD, tsg.DAYD );
tsg.SSTP_QC=repmat(GOOD,[length(tsg.DAYD) 1]); tsg.SSTP_QC(isnan(tsg.SSTP)) = BAD;
end end
tsg.SSPS_QC=repmat(PROBABLY_BAD,[length(tsg.DAYD) 1]); tsg.SSPS_QC = castByteQC(PROBABLY_BAD, tsg.DAYD);
tsg.SSPS_ADJUSTED_QC=repmat(GOOD,[length(tsg.DAYD) 1]); tsg.SSPS_ADJUSTED_QC = castByteQC(GOOD, tsg.DAYD);
tsg.SSPS(tsg.SSPS<miss)=nan; tsg.SSPS(tsg.SSPS < miss) = NaN;
tsg.SSJT(tsg.SSJT<miss)=nan; tsg.SSJT(tsg.SSJT < miss) = NaN;
tsg.SSPS_ADJUSTED(tsg.SSPS_ADJUSTED<miss)=nan; tsg.SSPS_ADJUSTED(tsg.SSPS_ADJUSTED < miss) = NaN;
tsg.SSPS_QC(isnan(tsg.SSPS))=nan; tsg.SSPS_QC(isnan(tsg.SSPS)) = BAD;
tsg.SSPS_ADJUSTED_QC(isnan(tsg.SSPS))=nan; tsg.SSPS_ADJUSTED_QC(isnan(tsg.SSPS)) = BAD;
% populate tsg.file structure % populate tsg.file structure
% --------------------------- % ---------------------------
......
...@@ -126,18 +126,18 @@ tsg.report.badvelocity = 0; % Records deleted because of bad velocity ...@@ -126,18 +126,18 @@ tsg.report.badvelocity = 0; % Records deleted because of bad velocity
% Quality flags reference table, see GOSUD, DATA FORMAT TSG V1.6, table 4 % Quality flags reference table, see GOSUD, DATA FORMAT TSG V1.6, table 4
% ----------------------------------------------------------------------- % -----------------------------------------------------------------------
% Code Meaning % Code Key Meaning
% %
% 0 No QC was performed % 0 NO_CONTROL No QC was performed
% 1 Good data % 1 GOOD Good data
% 2 Probably good data % 2 PROBABLY_GOOD Probably good data
% 3 Bad data that are potentially correctable % 3 PROBABLY_BAD Bad data that are potentially correctable
% 4 Bad data % 4 BAD Bad data
% 5 Value changed % 5 VALUE_CHANGED Value changed
% 6 Data acquired in harbour % 6 HARBOUR Data acquired in harbour
% 7 Not used % 7 NOT_USED Not used
% 8 Interpolated value % 8 INTERPOLATED_VALUE Interpolated value
% 9 Missing value % 9 MISSING_VALUE Missing value
% Quality definition, we use an instance of dynaload object % Quality definition, we use an instance of dynaload object
% --------------------------------------------------------- % ---------------------------------------------------------
......
...@@ -20,8 +20,7 @@ shipVelocity( hMainFig ); ...@@ -20,8 +20,7 @@ shipVelocity( hMainFig );
% ------------------------------------- % -------------------------------------
tsg = getappdata( hMainFig, 'tsg_data'); tsg = getappdata( hMainFig, 'tsg_data');
nPARA = 3; PARA = {'SSPS', 'SSJT', 'SSTP'};
PARA = ['SSPS'; 'SSJT'; 'SSTP'];
% Get NO_CONTROL and INTERPOLATED_VALUE codes % Get NO_CONTROL and INTERPOLATED_VALUE codes
% a modifier !!!!!!!!!!!!! % a modifier !!!!!!!!!!!!!
...@@ -42,7 +41,8 @@ if ~isempty(tsg.indcross) ...@@ -42,7 +41,8 @@ if ~isempty(tsg.indcross)
tsg.loncross = sign(dlon(tsg.indcross)) * 360; tsg.loncross = sign(dlon(tsg.indcross)) * 360;
tsg.indcross = deflon(tsg.indcross); tsg.indcross = deflon(tsg.indcross);
for i=1:length(tsg.indcross) for i=1:length(tsg.indcross)
tsg.LONX(tsg.indcross(i)+1:end) = tsg.LONX(tsg.indcross(i)+1:end) - tsg.loncross(i); tsg.LONX(tsg.indcross(i)+1:end) = ...
tsg.LONX(tsg.indcross(i)+1:end) - tsg.loncross(i);
end end
end end
tsg.lonplus = 0; tsg.lonplus = 0;
...@@ -69,23 +69,23 @@ tsg.DATE_END = [date(1:8) date(10:15)]; ...@@ -69,23 +69,23 @@ tsg.DATE_END = [date(1:8) date(10:15)];
% Variables must exists % Variables must exists
% --------------------- % ---------------------
for i = 1: nPARA for para = PARA
para1 = PARA(i,:); para = char(para);
if ~isempty( tsg.(para1) ) && isempty( tsg.([para1 '_QC']) ) if ~isempty( tsg.(para) ) && isempty( tsg.([para '_QC']) )
% If QC variables are emptied, fill them with NO_CONTROL code value % If QC variables are emptied, fill them with NO_CONTROL code value
% ----------------------------------------------------------------- % -----------------------------------------------------------------
tsg.([para1 '_QC']) = castByteQC( NO_CONTROL, tsg.DAYD ); tsg.([para '_QC']) = castByteQC( NO_CONTROL, tsg.DAYD );
end end
if ~isempty( tsg.(para1) ) && isempty( tsg.([para1 '_ADJUSTED_QC']) ) if ~isempty( tsg.(para) ) && isempty( tsg.([para '_ADJUSTED_QC']) )
% If QC variables are emptied, fill them with NO_CONTROL code value % If QC variables are emptied, fill them with NO_CONTROL code value
% ----------------------------------------------------------------- % -----------------------------------------------------------------
tsg.([para1 '_ADJUSTED_QC']) = castByteQC( NO_CONTROL, tsg.DAYD ); tsg.([para '_ADJUSTED_QC']) = castByteQC( NO_CONTROL, tsg.DAYD );
end end
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment