diff --git a/tsg_util/diffTsgSample.m b/tsg_util/diffTsgSample.m index 19b3c573542293acb63f04bef5588742577d8656..77898cfaf4f5176df6871b3c553fcc353b389fb9 100644 --- a/tsg_util/diffTsgSample.m +++ b/tsg_util/diffTsgSample.m @@ -26,10 +26,12 @@ errDif = 0; % ------------------------------------------------------ tsg = getappdata( hMainFig, 'tsg_data'); -% Get PROBABLY_GOOD code -% ---------------------- +% Get QC codes +% ------------ probablyGoodCode = tsg.qc.hash.PROBABLY_GOOD.code; -defaultValueCode = tsg.qc.hash.MISSING_VALUE.code; +GoodCode = tsg.qc.hash.GOOD.code; +harbourCode = tsg.qc.hash.HARBOUR.code; +noControlCode = tsg.qc.hash.NO_CONTROL.code; % For temperature : % IF PARA = 'SSJT' use 'SSTP' to get the samples @@ -39,9 +41,12 @@ if strcmp( SAMPLE, 'SSJT') SAMPLE = 'SSTP'; end -% Consider only tsg data with NO_CONTROL, GOOD and PROBABLY_GOOD code -% ------------------------------------------------------------------- -indTsg = find( tsg.([PARA{1} '_QC']) <= probablyGoodCode ); +% Consider only tsg data with NO_CONTROL, HARBOUR, GOOD or PROBABLY_GOOD code +% --------------------------------------------------------------------------- +indTsg = find( tsg.([PARA{1} '_QC']) == probablyGoodCode | ... + tsg.([PARA{1} '_QC']) == GoodCode | ... + tsg.([PARA{1} '_QC']) == harbourCode | ... + tsg.([PARA{1} '_QC']) == noControlCode); if ~isempty( indTsg ) diff --git a/tsg_util/tsg_average.m b/tsg_util/tsg_average.m index 6df2f10bdccd9aec50fa311d22afd8e4a56acaa1..62ff1f663fb899adab34863bb5f0f0f936d7138a 100644 --- a/tsg_util/tsg_average.m +++ b/tsg_util/tsg_average.m @@ -22,9 +22,12 @@ function [smooth] = tsg_average(hMainFig, PARA, iTsg) % ------------------------------------------ tsg = getappdata( hMainFig, 'tsg_data'); -% Get PROBABLY_GOOD code -% ---------------------- +% Get QC codes +% ------------ probablyGoodCode = tsg.qc.hash.PROBABLY_GOOD.code; +GoodCode = tsg.qc.hash.GOOD.code; +harbourCode = tsg.qc.hash.HARBOUR.code; +noControlCode = tsg.qc.hash.NO_CONTROL.code; % Select the param data over 'tsg.cst.TSG_DT_SMOOTH' time interval % taking into account the TSG quality code @@ -33,7 +36,10 @@ probablyGoodCode = tsg.qc.hash.PROBABLY_GOOD.code; % ----------------------------------------------------------------------- ind1 = find( tsg.DAYD >= tsg.DAYD(iTsg) - tsg.cst.TSG_DT_SMOOTH/2 & ... tsg.DAYD <= tsg.DAYD(iTsg) + tsg.cst.TSG_DT_SMOOTH/2 & ... - tsg.([PARA{1} '_QC']) <= probablyGoodCode); + (tsg.([PARA{1} '_QC']) == probablyGoodCode | ... + tsg.([PARA{1} '_QC']) == GoodCode | ... + tsg.([PARA{1} '_QC']) == harbourCode | ... + tsg.([PARA{1} '_QC']) == noControlCode)); ind2 = ind1; if ~isempty(ind2)