Skip to content
Snippets Groups Projects
Commit c4bd8b4f authored by Yves Gouriou's avatar Yves Gouriou
Browse files

La variable ADJUSTED est calcule en utilisant :

soit la variable SSPS ou SSJT, SSTP
soit les variables _CAL si elles existent.
parent 07d09d4e
No related branches found
No related tags found
No related merge requests found
No preview for this file type
No preview for this file type
...@@ -4,7 +4,10 @@ function [error] = corTsgLinear(hMainFig, PARA, dateMin, dateMax) ...@@ -4,7 +4,10 @@ function [error] = corTsgLinear(hMainFig, PARA, dateMin, dateMax)
% %
% Input % Input
% hMainFig ..... Handle to the main GUI % hMainFig ..... Handle to the main GUI
% PARA ......... Parameter % PARA ..........Cell array
% PARA{1} contains the characters (SSP, SSJT, SSTP)
% PARA{2} contains either the cahracters (SSPS, SSJT, SSTP)
% or (SSPS_CAL, SSJT_CAL, SSTP_CAL)
% dateMin ...... the correction is applied between dateMin and date Max % dateMin ...... the correction is applied between dateMin and date Max
% dateMax ...... the correction is applied between dateMin and date Max % dateMax ...... the correction is applied between dateMin and date Max
% %
...@@ -66,10 +69,10 @@ VALUE_CHANGED = tsg.qc.hash.VALUE_CHANGED.code; ...@@ -66,10 +69,10 @@ VALUE_CHANGED = tsg.qc.hash.VALUE_CHANGED.code;
% Intialisation % Intialisation
% 01/09/2009 : intialisation to NaN % 01/09/2009 : intialisation to NaN
% --------------------------------- % ---------------------------------
if isempty( tsg.([PARA '_ADJUSTED']) ) if isempty( tsg.([PARA{1} '_ADJUSTED']) )
tsg.([PARA '_ADJUSTED']) = NaN*ones(size(tsg.(PARA))); tsg.([PARA{1} '_ADJUSTED']) = NaN*ones(size(tsg.(PARA{1})));
tsg.([PARA '_ADJUSTED_QC']) = NaN*ones(size(tsg.([PARA '_QC']))); tsg.([PARA{1} '_ADJUSTED_QC']) = NaN*ones(size(tsg.([PARA{1} '_QC'])));
tsg.([PARA '_ADJUSTED_ERROR']) = NaN*ones(size(tsg.(PARA))); tsg.([PARA{1} '_ADJUSTED_ERROR']) = NaN*ones(size(tsg.(PARA{1})));
end end
if dateMax > dateMin if dateMax > dateMin
...@@ -102,24 +105,24 @@ if dateMax > dateMin ...@@ -102,24 +105,24 @@ if dateMax > dateMin
% ------------------------------------------------------------------------ % ------------------------------------------------------------------------
for icode = 1 : length( keptCode ) for icode = 1 : length( keptCode )
dtTsg = find( tsg.DAYD >= dateMin & tsg.DAYD <= dateMax &... dtTsg = find( tsg.DAYD >= dateMin & tsg.DAYD <= dateMax &...
tsg.([PARA '_QC']) == keptCode( icode )); tsg.([PARA{1} '_QC']) == keptCode( icode ));
if ~isempty( dtTsg ) if ~isempty( dtTsg )
% Compute the correction + the error % Compute the correction + the error
% ---------------------------------- % ----------------------------------
[tsg.([PARA '_ADJUSTED'])(dtTsg),... [tsg.([PARA{1} '_ADJUSTED'])(dtTsg),...
tsg.([PARA '_ADJUSTED_ERROR'])(dtTsg)] =... tsg.([PARA{1} '_ADJUSTED_ERROR'])(dtTsg)] =...
polyval( p, tsg.DAYD(dtTsg), S, mu); polyval( p, tsg.DAYD(dtTsg), S, mu);
% Compute the corrected value : orignal value + correction % Compute the corrected value : orignal value + correction
% -------------------------------------------------------- % --------------------------------------------------------
tsg.([PARA '_ADJUSTED'])(dtTsg) =... tsg.([PARA{1} '_ADJUSTED'])(dtTsg) =...
tsg.(PARA)(dtTsg) + tsg.([PARA '_ADJUSTED'])(dtTsg); tsg.(PARA{2})(dtTsg) + tsg.([PARA{1} '_ADJUSTED'])(dtTsg);
% Transfer the QC % Transfer the QC
% --------------- % ---------------
tsg.([PARA '_ADJUSTED_QC'])(dtTsg) = tsg.([PARA '_QC'])(dtTsg); tsg.([PARA{1} '_ADJUSTED_QC'])(dtTsg) = tsg.([PARA{1} '_QC'])(dtTsg);
end end
end end
...@@ -134,12 +137,12 @@ if dateMax > dateMin ...@@ -134,12 +137,12 @@ if dateMax > dateMin
% ------------------------------------------------------------------------ % ------------------------------------------------------------------------
for icode = 1 : length( keptCode ) for icode = 1 : length( keptCode )
dtTsg = find( tsg.DAYD >= dateMin & tsg.DAYD <= dateMax &... dtTsg = find( tsg.DAYD >= dateMin & tsg.DAYD <= dateMax &...
tsg.([PARA '_QC']) == keptCode( icode )); tsg.([PARA{1} '_QC']) == keptCode( icode ));
if ~isempty( dtTsg ) if ~isempty( dtTsg )
tsg.([PARA '_ADJUSTED'])(dtTsg) = tsg.(PARA)(dtTsg) + meanDif; tsg.([PARA{1} '_ADJUSTED'])(dtTsg) = tsg.(PARA{2})(dtTsg) + meanDif;
tsg.([PARA '_ADJUSTED_ERROR'])(dtTsg) = meanDif / 2; tsg.([PARA{1} '_ADJUSTED_ERROR'])(dtTsg) = meanDif / 2;
tsg.([PARA '_ADJUSTED_QC'])(dtTsg) = tsg.([PARA '_QC'])(dtTsg); tsg.([PARA{1} '_ADJUSTED_QC'])(dtTsg) = tsg.([PARA{1} '_QC'])(dtTsg);
end end
end end
...@@ -148,11 +151,11 @@ if dateMax > dateMin ...@@ -148,11 +151,11 @@ if dateMax > dateMin
% The error minimum cannot be lower than 0.01 or equal to Inf % The error minimum cannot be lower than 0.01 or equal to Inf
% ----------------------------------------------------------- % -----------------------------------------------------------
if ~isempty(ind2) && length(ind2) >= 2 if ~isempty(ind2) && length(ind2) >= 2
tsg.([PARA '_ADJUSTED_ERROR'])... tsg.([PARA{1} '_ADJUSTED_ERROR'])...
( tsg.([PARA '_ADJUSTED_ERROR']) < 0.01 ) = 0.01; ( tsg.([PARA{1} '_ADJUSTED_ERROR']) < 0.01 ) = 0.01;
tsg.([PARA '_ADJUSTED_ERROR'])... tsg.([PARA{1} '_ADJUSTED_ERROR'])...
(isinf(tsg.([PARA '_ADJUSTED_ERROR'])) == 1) = 0.01; (isinf(tsg.([PARA{1} '_ADJUSTED_ERROR'])) == 1) = 0.01;
end end
% end % end
end end
......
...@@ -6,7 +6,10 @@ function [error] = corTsgMedian(hMainFig, PARA, dateMin, dateMax) ...@@ -6,7 +6,10 @@ function [error] = corTsgMedian(hMainFig, PARA, dateMin, dateMax)
% %
% Input % Input
% hMainFig ..... Handle to the main GUI % hMainFig ..... Handle to the main GUI
% PARA ......... Parameter (SSPS, SSJT, SSTP) % PARA ..........Cell array
% PARA{1} contains the characters (SSP, SSJT, SSTP)
% PARA{2} contains either the cahracters (SSPS, SSJT, SSTP)
% or (SSPS_CAL, SSJT_CAL, SSTP_CAL)
% dateMin ...... the correction is applied between dateMin and date Max % dateMin ...... the correction is applied between dateMin and date Max
% dateMax ...... the correction is applied between dateMin and date Max % dateMax ...... the correction is applied between dateMin and date Max
% %
...@@ -62,10 +65,10 @@ VALUE_CHANGED = tsg.qc.hash.VALUE_CHANGED.code; ...@@ -62,10 +65,10 @@ VALUE_CHANGED = tsg.qc.hash.VALUE_CHANGED.code;
% intialisation % intialisation
% ------------- % -------------
if isempty( tsg.([PARA '_ADJUSTED']) ) if isempty( tsg.([PARA{1} '_ADJUSTED']) )
tsg.([PARA '_ADJUSTED']) = NaN*ones(size(tsg.(PARA))); tsg.([PARA{1} '_ADJUSTED']) = NaN*ones(size(tsg.(PARA{1})));
tsg.([PARA '_ADJUSTED_QC']) = NaN*ones(size(tsg.([PARA '_QC']))); tsg.([PARA{1} '_ADJUSTED_QC']) = NaN*ones(size(tsg.([PARA{1} '_QC'])));
tsg.([PARA '_ADJUSTED_ERROR']) = NaN*ones(size(tsg.(PARA))); tsg.([PARA{1} '_ADJUSTED_ERROR']) = NaN*ones(size(tsg.(PARA{1})));
end end
% Create a structure with an NaN % Create a structure with an NaN
...@@ -185,13 +188,13 @@ if dateMax > dateMin ...@@ -185,13 +188,13 @@ if dateMax > dateMin
% ---------------------------------------------------------------------- % ----------------------------------------------------------------------
for icode = 1 : length( keptCode ) for icode = 1 : length( keptCode )
dtTsg = find( tsg.DAYD >= dateMin & tsg.DAYD <= dateMax &... dtTsg = find( tsg.DAYD >= dateMin & tsg.DAYD <= dateMax &...
tsg.([PARA '_QC']) == keptCode( icode )); tsg.([PARA{1} '_QC']) == keptCode( icode ));
tsg.([PARA '_ADJUSTED'])(dtTsg) = tsg.(PARA)(dtTsg) + ... tsg.([PARA{1} '_ADJUSTED'])(dtTsg) = tsg.(PARA{2})(dtTsg) + ...
interp1(cor.DAYD, cor.DIFF, tsg.DAYD(dtTsg)); interp1(cor.DAYD, cor.DIFF, tsg.DAYD(dtTsg));
tsg.([PARA '_ADJUSTED_ERROR'])(dtTsg) = ... tsg.([PARA{1} '_ADJUSTED_ERROR'])(dtTsg) = ...
interp1(cor.DAYD, cor.ERROR, tsg.DAYD(dtTsg)); interp1(cor.DAYD, cor.ERROR, tsg.DAYD(dtTsg));
tsg.([PARA '_ADJUSTED_QC'])(dtTsg) = tsg.([PARA '_QC'])(dtTsg); tsg.([PARA{1} '_ADJUSTED_QC'])(dtTsg) = tsg.([PARA{1} '_QC'])(dtTsg);
end end
end end
......
function diffTsgSample(hMainFig, PARA) function diffTsgSample(hMainFig, PARA)
% %
% Co-location of sample and TSG measurements % Co-location of sample and TSG measurements
% Compute the sample-TSG difference % Compute the Sample - TSG difference
%
% The TSG value is either the raw parameter either the calibrated parameter
% depending if a calibration has been done.
%
% Input
% hMainFig ........ Handle to the main GUI : TSGQC
% PARA ............ Cell array
% PARA{1} contains the characters (SSP, SSJT, SSTP)
% PARA{2} contains either the cahracters (SSPS, SSJT, SSTP)
% or (SSPS_CAL, SSJT_CAL, SSTP_CAL)
% %
% Get the tsg and sample structures from the application % Get the tsg and sample structures from the application
...@@ -16,14 +26,14 @@ defaultValueCode = tsg.qc.hash.MISSING_VALUE.code; ...@@ -16,14 +26,14 @@ defaultValueCode = tsg.qc.hash.MISSING_VALUE.code;
% For temperature : % For temperature :
% IF PARA = 'SSJT' use 'SSTP' to get the samples % IF PARA = 'SSJT' use 'SSTP' to get the samples
% ---------------------------------------------- % ----------------------------------------------
SAMPLE = PARA; SAMPLE = char( PARA{1} );
if strcmp( SAMPLE, 'SSJT') if strcmp( SAMPLE, 'SSJT')
SAMPLE = 'SSTP'; SAMPLE = 'SSTP';
end end
% Consider only tsg data with NO_CONTROL, GOOD and PROBABLY_GOOD code % Consider only tsg data with NO_CONTROL, GOOD and PROBABLY_GOOD code
% ------------------------------------------------------------------- % -------------------------------------------------------------------
indTsg = find( tsg.([PARA '_QC']) < defaultValueCode ); indTsg = find( tsg.([PARA{1} '_QC']) < defaultValueCode );
if ~isempty( indTsg ) if ~isempty( indTsg )
...@@ -46,6 +56,7 @@ if ~isempty( indTsg ) ...@@ -46,6 +56,7 @@ if ~isempty( indTsg )
% Keep the smooth TSG value % Keep the smooth TSG value
% ------------------------- % -------------------------
smooth = tsg_average(hMainFig, PARA, indMin); smooth = tsg_average(hMainFig, PARA, indMin);
if timeDiff(indMin) < tsg.cst.TSG_WS_TIMEDIFF && ~isnan(smooth) if timeDiff(indMin) < tsg.cst.TSG_WS_TIMEDIFF && ~isnan(smooth)
% The smooth TSG time series (tsg_moveaverage) is % The smooth TSG time series (tsg_moveaverage) is
......
function plot_Correction( hMainFig, hPlotAxes, PARA ) function plot_Correction( hMainFig, hPlotAxes, PARA )
%
% Input
% hMainFig ........ Handle to the main GUI : TSGQC
% hPlotAxes ....... Handle des axes
% PARA ............ Cell array
% PARA{1} contains the characters (SSP, SSJT, SSTP)
% PARA{2} contains either the cahracters (SSPS, SSJT, SSTP)
% or (SSPS_CAL, SSJT_CAL, SSTP_CAL)
% Reinitialise plot 1 and 3 % Reinitialise plot 1 and 3
% ------------------------- % -------------------------
...@@ -27,7 +35,7 @@ if ~isempty( tsg.([SAMPLE '_EXT']) ) ...@@ -27,7 +35,7 @@ if ~isempty( tsg.([SAMPLE '_EXT']) )
if ~isempty(indWS) if ~isempty(indWS)
plot_Tsg( hMainFig, hPlotAxes, 1, tsg.DAYD_EXT(indWS),... plot_Tsg( hMainFig, hPlotAxes, 1, tsg.DAYD_EXT(indWS),...
tsg.EXT_DIF(indWS), tsg.([SAMPLE '_EXT_QC'])(indWS),... tsg.EXT_DIF(indWS), tsg.([SAMPLE '_EXT_QC'])(indWS),...
[PARA '_WS'],'','none','square',5); [PARA{1} '_WS'],'','none','square',5);
end end
% Plot other (external) samples % Plot other (external) samples
...@@ -36,68 +44,68 @@ if ~isempty( tsg.([SAMPLE '_EXT']) ) ...@@ -36,68 +44,68 @@ if ~isempty( tsg.([SAMPLE '_EXT']) )
if ~isempty(indEXT) if ~isempty(indEXT)
plot_Tsg( hMainFig, hPlotAxes, 1, tsg.DAYD_EXT(indEXT),... plot_Tsg( hMainFig, hPlotAxes, 1, tsg.DAYD_EXT(indEXT),...
tsg.EXT_DIF(indEXT), tsg.([SAMPLE '_EXT_QC'])(indEXT),... tsg.EXT_DIF(indEXT), tsg.([SAMPLE '_EXT_QC'])(indEXT),...
[PARA '_EXT'],'','none','o',5); [PARA{1} '_EXT'],'','none','o',5);
end end
end end
% Select the records CORRECTED % Select the records CORRECTED
% Records corrected have an error value % Records corrected have an error value
% ------------------------------------------- % -------------------------------------------
iERR = find( isnan(tsg.([PARA '_ADJUSTED_ERROR'])) == 0); iERR = find( isnan(tsg.([PARA{1} '_ADJUSTED_ERROR'])) == 0);
% Plot the difference tsg.SSPS_ADJUSTED-tsg.SSPS on axe 1 % Plot the difference tsg.SSPS_ADJUSTED-tsg.SSPS on axe 1
% but only for records that were corrected using Water Sample % but only for records that were corrected using Water Sample
% and but not corrected with the calibration coefficients.
% ----------------------------------------------------------- % -----------------------------------------------------------
if iERR ~= 0 if iERR ~= 0
plot_Tsg( hMainFig, hPlotAxes, 1,... plot_Tsg( hMainFig, hPlotAxes, 1,...
tsg.DAYD(iERR),... tsg.DAYD(iERR),...
tsg.([PARA '_ADJUSTED'])(iERR)-tsg.(PARA)(iERR),... tsg.([PARA{1} '_ADJUSTED'])(iERR)-tsg.(PARA{2})(iERR),...
[], [PARA '_ADJUSTED'],'b','none','.',1); [], [PARA{1} '_ADJUSTED'],'b','none','.',1);
end end
% **************************** AXE 2 *********************************** % **************************** AXE 2 ***********************************
% Plot SSPS, SSJT, SSTP and SAMPLE, with code color, on axe 2 % Plot SAMPLE and SSPS (SSJT, SSTP) with code color, on axe 2
% ----------------------------------------------------------- % -----------------------------------------------------------
plot_Tsg( hMainFig, hPlotAxes, 2, tsg.DAYD, tsg.(PARA), tsg.([PARA '_QC']),...
PARA,'','none','*',2);
if ~isempty( tsg.([SAMPLE '_EXT']) ) if ~isempty( tsg.([SAMPLE '_EXT']) )
ind = 1: length( tsg.([SAMPLE '_EXT_TYPE'])); ind = 1: length( tsg.([SAMPLE '_EXT_TYPE']));
indWS = strmatch( 'WS', tsg.([SAMPLE '_EXT_TYPE']), 'exact'); indWS = strmatch( 'WS', tsg.([SAMPLE '_EXT_TYPE']), 'exact');
if ~isempty(indWS) if ~isempty(indWS)
plot_Tsg( hMainFig, hPlotAxes, 2, tsg.DAYD_EXT(indWS),... plot_Tsg( hMainFig, hPlotAxes, 2, tsg.DAYD_EXT(indWS),...
tsg.([SAMPLE '_EXT'])(indWS), tsg.([SAMPLE '_EXT_QC'])(indWS),... tsg.([SAMPLE '_EXT'])(indWS), tsg.([SAMPLE '_EXT_QC'])(indWS),...
[PARA '_WS'],'','none','square',5); [PARA{1} '_WS'],'','none','square',5);
end end
indEXT = setxor(ind, indWS); indEXT = setxor(ind, indWS);
if ~isempty(indEXT) if ~isempty(indEXT)
plot_Tsg( hMainFig, hPlotAxes, 2, tsg.DAYD_EXT(indEXT),... plot_Tsg( hMainFig, hPlotAxes, 2, tsg.DAYD_EXT(indEXT),...
tsg.([SAMPLE '_EXT'])(indEXT), tsg.([SAMPLE '_EXT_QC'])(indEXT),... tsg.([SAMPLE '_EXT'])(indEXT), tsg.([SAMPLE '_EXT_QC'])(indEXT),...
[PARA '_EXT'],'','none','o',5); [PARA{1} '_EXT'],'','none','o',5);
end end
end end
plot_Tsg( hMainFig, hPlotAxes, 2, tsg.DAYD, tsg.(PARA{2}), tsg.([PARA{1} '_QC']),...
PARA{2},'','none','*',2);
% **************************** AXE 3 *********************************** % **************************** AXE 3 ***********************************
% Plot SSPS, with no code, on axe3 % Plot SSPS, with no code, on axe3
% -------------------------------- % --------------------------------
plot_Tsg( hMainFig, hPlotAxes, 3, tsg.DAYD, tsg.([PARA '_ADJUSTED']), [],... plot_Tsg( hMainFig, hPlotAxes, 3, tsg.DAYD, tsg.([PARA{1} '_ADJUSTED']), [],...
[PARA '_ADJUSTED'],'r','none','*',2); [PARA{1} '_ADJUSTED'],'r','none','*',2);
plot_Tsg( hMainFig, hPlotAxes, 3, tsg.DAYD, tsg.(PARA),... plot_Tsg( hMainFig, hPlotAxes, 3, tsg.DAYD, tsg.(PARA{2}),...
[],PARA,'k','none','*',2); [],PARA{2},'k','none','*',2);
% Plot TSG_ADJUSTED + ERROR on axe 3 % Plot TSG_ADJUSTED + ERROR on axe 3
% ----------------------------------- % -----------------------------------
if iERR ~= 0 if iERR ~= 0
plot_Tsg( hMainFig, hPlotAxes, 3, tsg.DAYD(iERR),... plot_Tsg( hMainFig, hPlotAxes, 3, tsg.DAYD(iERR),...
tsg.([PARA '_ADJUSTED'])(iERR) + tsg.([PARA '_ADJUSTED_ERROR'])(iERR),... tsg.([PARA{1} '_ADJUSTED'])(iERR) + tsg.([PARA{1} '_ADJUSTED_ERROR'])(iERR),...
[], [PARA '_ADJUSTED'],'g','none','*',2); [], [PARA{1} '_ADJUSTED'],'g','none','*',2);
plot_Tsg( hMainFig, hPlotAxes, 3, tsg.DAYD(iERR),... plot_Tsg( hMainFig, hPlotAxes, 3, tsg.DAYD(iERR),...
tsg.([PARA '_ADJUSTED'])(iERR) - tsg.([PARA '_ADJUSTED_ERROR'])(iERR),... tsg.([PARA{1} '_ADJUSTED'])(iERR) - tsg.([PARA{1} '_ADJUSTED_ERROR'])(iERR),...
[], [PARA '_ADJUSTED'],'g','none','*',2); [], [PARA{1} '_ADJUSTED'],'g','none','*',2);
end end
end end
...@@ -6,7 +6,13 @@ function [smooth] = tsg_average(hMainFig, PARA, iTsg) ...@@ -6,7 +6,13 @@ function [smooth] = tsg_average(hMainFig, PARA, iTsg)
% are not taken into account. % are not taken into account.
% %
% Input % Input
% hMainFig ............ Handle to the main user interface % hMainFig ........ Handle to the main GUI : TSGQC
% PARA ............ Cell array
% PARA{1} contains the characters (SSP, SSJT, SSTP)
% PARA{2} contains either the cahracters (SSPS, SSJT, SSTP)
% or (SSPS_CAL, SSJT_CAL, SSTP_CAL)
% iTsg ............ Indice of the TSG measurement the closest to the sample
% taking into account the TSG quality code
% %
% No computation : NaN % No computation : NaN
% %
...@@ -30,22 +36,22 @@ if ~isempty(ind2) ...@@ -30,22 +36,22 @@ if ~isempty(ind2)
% Compare Standard Deviation to the MAX acceptable STD % Compare Standard Deviation to the MAX acceptable STD
% ---------------------------------------------------- % ----------------------------------------------------
while currentStd > tsg.([PARA '_STDMAX']) && currentStd ~= previousStd while currentStd > tsg.([PARA{1} '_STDMAX']) && currentStd ~= previousStd
previousStd = currentStd; previousStd = currentStd;
% Standard deviation and average over timeInterval % Standard deviation and average over timeInterval
% ------------------------------------------------ % ------------------------------------------------
currentStd = nanstd( tsg.(PARA)(ind2) ); currentStd = nanstd( tsg.(PARA{2})(ind2) );
meanParam = nanmean( tsg.(PARA)(ind2) ); meanParam = nanmean( tsg.(PARA{2})(ind2) );
% Indices of 'good' values of Param % Indices of 'good' values of Para
% --------------------------------- % ---------------------------------
ind2 = ind1( tsg.(PARA)(ind1) >= meanParam - currentStd & ... ind2 = ind1( tsg.(PARA{2})(ind1) >= meanParam - currentStd & ...
tsg.(PARA)(ind1) <= meanParam + currentStd ); tsg.(PARA{2})(ind1) <= meanParam + currentStd );
end end
smooth = nanmean( tsg.(PARA)(ind2) ); smooth = nanmean( tsg.(PARA{2})(ind2) );
else else
smooth = NaN; smooth = NaN;
......
...@@ -2384,12 +2384,7 @@ hrbInterpCancel = uicontrol( ... ...@@ -2384,12 +2384,7 @@ hrbInterpCancel = uicontrol( ...
% Get the parameter we are working on (SSPS, SSJT, SSTP) % Get the parameter we are working on (SSPS, SSJT, SSTP)
% ------------------------------------------------------ % ------------------------------------------------------
SAMPLE = tsg.plot.sample; SAMPLE = tsg.plot.sample;
PARA = tsg.plot.parameter{1}; PARA = getParaCorModule( hMainFig );
% % test if _CAL variable exist
% % ---------------------------
% if ~isempty( tsg.([PARA '_CAL']) )
% PARA = [PARA '_CAL'];
% end
% Switch somme buttons % Switch somme buttons
% -------------------- % --------------------
...@@ -2506,25 +2501,21 @@ hrbInterpCancel = uicontrol( ... ...@@ -2506,25 +2501,21 @@ hrbInterpCancel = uicontrol( ...
tsg = getappdata(hMainFig, 'tsg_data'); tsg = getappdata(hMainFig, 'tsg_data');
% Get parameter we are working on (SSPS, SSJT, SSTP) % Get parameter we are working on (SSPS, SSJT, SSTP)
% -------------------------------------------------- % or SSPS_CAL, SSJT_CAL, SSTP_CAL
PARA = tsg.plot.parameter{1}; % -------------------------------------------------
PARA = getParaCorModule( hMainFig );
% To cancel the correction set the ADJUSTED variable % To cancel the correction set the ADJUSTED variable
% to [] % to []
% -------------------------------------------------- % --------------------------------------------------
tsg.([PARA '_ADJUSTED']) = []; tsg.([PARA{1} '_ADJUSTED']) = [];
tsg.([PARA '_ADJUSTED_QC']) = []; tsg.([PARA{1} '_ADJUSTED_QC']) = [];
tsg.([PARA '_ADJUSTED_ERROR']) = []; tsg.([PARA{1} '_ADJUSTED_ERROR']) = [];
% Save tsg data % Save tsg data
% ------------- % -------------
setappdata(hMainFig, 'tsg_data', tsg); setappdata(hMainFig, 'tsg_data', tsg);
% Set the ADJUSTED variable either to the raw variable or to
% the calibrated variable
% ----------------------------------------------------------
% updateAdjustedVariable( hMainFig );
% Plot in the 3 axes % Plot in the 3 axes
% ------------------ % ------------------
plot_Correction( hMainFig, hPlotAxes, PARA ); plot_Correction( hMainFig, hPlotAxes, PARA );
...@@ -2548,10 +2539,14 @@ hrbInterpCancel = uicontrol( ... ...@@ -2548,10 +2539,14 @@ hrbInterpCancel = uicontrol( ...
dateMin = datenum(get( hetDateMin, 'String'), 'yyyy-mm-dd HH:MM:SS'); dateMin = datenum(get( hetDateMin, 'String'), 'yyyy-mm-dd HH:MM:SS');
dateMax = datenum(get( hetDateMax, 'String'), 'yyyy-mm-dd HH:MM:SS'); dateMax = datenum(get( hetDateMax, 'String'), 'yyyy-mm-dd HH:MM:SS');
% Get the parameter (SSPS, SSJT, or SSTP) % Get tsg application data
% --------------------------------------- % ------------------------
tsg = getappdata(hMainFig, 'tsg_data'); tsg = getappdata(hMainFig, 'tsg_data');
PARA = tsg.plot.parameter{1};
% Get parameter we are working on (SSPS, SSJT, SSTP)
% or SSPS_CAL, SSJT_CAL, SSTP_CAL
% -------------------------------------------------
PARA = getParaCorModule( hMainFig );
SAMPLE = tsg.plot.sample; SAMPLE = tsg.plot.sample;
if ~isempty( tsg.([SAMPLE '_EXT']) ) if ~isempty( tsg.([SAMPLE '_EXT']) )
...@@ -2598,10 +2593,14 @@ hrbInterpCancel = uicontrol( ... ...@@ -2598,10 +2593,14 @@ hrbInterpCancel = uicontrol( ...
dateMin = datenum(get( hetDateMin, 'String'), 'yyyy-mm-dd HH:MM:SS'); dateMin = datenum(get( hetDateMin, 'String'), 'yyyy-mm-dd HH:MM:SS');
dateMax = datenum(get( hetDateMax, 'String'), 'yyyy-mm-dd HH:MM:SS'); dateMax = datenum(get( hetDateMax, 'String'), 'yyyy-mm-dd HH:MM:SS');
% Get the parameter (SSPS, SSJT, or SSTP) % Get tsg application data
% --------------------------------------- % ------------------------
tsg = getappdata(hMainFig, 'tsg_data'); tsg = getappdata(hMainFig, 'tsg_data');
PARA = tsg.plot.parameter{1};
% Get parameter we are working on (SSPS, SSJT, SSTP)
% or SSPS_CAL, SSJT_CAL, SSTP_CAL
% -------------------------------------------------
PARA = getParaCorModule( hMainFig );
SAMPLE = tsg.plot.sample; SAMPLE = tsg.plot.sample;
if ~isempty( tsg.([SAMPLE '_EXT']) ) if ~isempty( tsg.([SAMPLE '_EXT']) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment