diff --git a/tsg_util/corTsgBias.m b/tsg_util/corTsgBias.m index 9c09e692a456cfd0ef99f4d29388538ce07e95bc..57844239c9f4019ebc42241250001b596410590b 100644 --- a/tsg_util/corTsgBias.m +++ b/tsg_util/corTsgBias.m @@ -70,9 +70,11 @@ end % Enter the bias that will be applied to PARA{1} % ---------------------------------------------- -prompt = ['Constant value to be applied to the ' PARA{1} ' time series']; defaultValue = {'0'}; +prompt = ['Constant value to be applied to the ' PARA{1} ' time series']; a = inputdlg(prompt,'Bias Correction',1,defaultValue); +prompt = ['Error value to be applied to the ' PARA{1} ' time series']; +b = inputdlg(prompt,'Bias Error',1,defaultValue); % everything OK % ------------- @@ -82,16 +84,18 @@ if ~isempty( a ) % If necessary replace a comma by a point % --------------------------------------- bias = regexprep(a, ',', '.'); + biasError = regexprep(b, ',', '.'); % If bias not a numeric, str2doublereturn a NaN % ------------------------------------ bias = str2double( bias ); + biasError = str2double( biasError ); if isnumeric( bias ) && ~isnan( bias) if dateMax > dateMin - if bias ~= 0 +% if bias ~= 0 % The correction is applied to the TSG between dateMin and dateMax % only to measurements with keptCode Quality Codes @@ -109,9 +113,9 @@ if ~isempty( a ) % -------------------------------------------------------- tsg.([PARA{1} '_ADJUSTED'])(dtTsg) = tsg.(PARA{2})(dtTsg) + bias; - % The error is put to -2 - % ---------------------- - tsg.([PARA{1} '_ADJUSTED_ERROR'])(dtTsg) = -1; + % Attribute an error + % ------------------ + tsg.([PARA{1} '_ADJUSTED_ERROR'])(dtTsg) = biasError; % Transfer the QC % --------------- @@ -119,7 +123,7 @@ if ~isempty( a ) end end - end +% end % Update tsg application data % ---------------------------