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

Module correction bouteille :

Permet d'annuler la correction pour tout ou partie de la série temporelle.
parent f774509a
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -895,12 +895,22 @@ hrbCorCancel = uicontrol( ...
'Style','pushbutton', ...
'Parent',hbgCorMethod, ...
'Units', 'normalized', ...
'String','Cancel the adjustment',...
'String','Cancel all',...
'FontSize',tsg.fontSize-1,...
'Tag', 'CORRECT_CANCEL_PUSH', ...
'pos',[.05 .04 .9 .13],...
'HandleVisibility', handleVisibility, ...
'Callback', @CorCancelCallback);
'Callback', {@cancelCorrectionCallback,'total'});
hrbPartCorCancel = uicontrol( ...
'Style','pushbutton', ...
'Parent',hbgCorMethod, ...
'Units', 'normalized', ...
'String',{'Cancel within Date Limits'},...
'FontSize',tsg.fontSize-1,...
'Tag', 'CORRECT_PART_CANCEL_PUSH', ...
'pos',[.05 .19 .9 .13],...
'HandleVisibility', handleVisibility, ...
'Callback', {@cancelCorrectionCallback,'part'});
hrbCorBiais = uicontrol( ...
'Style','pushbutton', ...
'Parent',hbgCorMethod, ...
......@@ -910,7 +920,7 @@ hrbCorBiais = uicontrol( ...
'Tag', 'CORRECT_BIAIS_PUSH', ...
'pos',[.05 .41 .9 .13],...
'HandleVisibility', handleVisibility, ...
'Callback', @CorBiasCallback);
'Callback', @biasCorrectionCallback);
hrbCorGradient = uicontrol( ...
'Style','pushbutton', ...
'Parent',hbgCorMethod, ...
......@@ -920,7 +930,7 @@ hrbCorGradient = uicontrol( ...
'Tag', 'CORRECT_GRADIENT_PUSH', ...
'pos',[.05 .56 .9 .13],...
'HandleVisibility', handleVisibility, ...
'Callback', @CorGradientCallback);
'Callback', @gradientCorrectionCallback);
hrbCorLinear = uicontrol( ...
'Style','pushbutton', ...
'Parent',hbgCorMethod, ...
......@@ -930,17 +940,17 @@ hrbCorLinear = uicontrol( ...
'Tag', 'CORRECT_LINEAR_PUSH', ...
'pos',[.05 .71 .9 .13], ...
'HandleVisibility', handleVisibility, ...
'Callback', @CorLinearCallback);
'Callback', @linearCorrectionCallback);
hrbCorMedian = uicontrol( ...
'Style','pushbutton', ...
'Parent',hbgCorMethod, ...
'Units', 'normalized', ...
'String','Running median filter',...
'String','Median filter adjustment',...
'FontSize',tsg.fontSize-1,...
'Tag', 'CORRECT_MEDIAN_PUSH', ...
'pos',[.05 .86 .9 .13], ...
'HandleVisibility', handleVisibility, ...
'Callback', @CorMedianCallback);
'Callback', @medianCorrectionCallback);
%% uiPanel for the Date limits used in the Correction module
......@@ -2698,8 +2708,8 @@ hrbInterpCancel = uicontrol( ...
end
%% CorCancelCallback .................................... Correction Module
function CorCancelCallback(hObject, eventdata)
%% OldCorCancelCallback .................................... Correction Module
function OldCorCancelCallback(hObject, eventdata)
% Callback function run when ...
% Desactivate somme Toggle button
......@@ -2735,9 +2745,91 @@ hrbInterpCancel = uicontrol( ...
plot_Correction( hMainFig, hPlotAxes, PARA );
end
%% cancelCorrectionCallback .................................... Correction Module
function cancelCorrectionCallback(hObject, eventdata, Limits)
% Callback function run when the user want to cancel the
% corrections made from comparison with bottles or ARGO data.
% The deletion can be made for th whole time series or
% between 2 dates.
% $Id$
% Desactivate somme Toggle button
% -------------------------------
set( hZoomInToggletool, 'state', 'off' );
set( hZoomOutToggletool, 'state', 'off' );
set( hPanToggletool, 'state', 'off' );
set( hQCToggletool, 'state', 'off' );
set( hTimelimitToggletool, 'state', 'off' );
% Get tsg application data
% ------------------------
tsg = getappdata(hMainFig, 'tsg_data');
% Get parameter we are working on (SSPS, SSJT, SSTP)
% or SSPS_CAL, SSJT_CAL, SSTP_CAL
% -------------------------------------------------
PARA = getParaCorModule( hMainFig );
% The correction will be cancelled either for the entire
% time series or within date limits
% ------------------------------------------------------
ind = 0;
switch Limits
% Get the indices of the whole time series
% ----------------------------------------
case 'total'
ind = find( tsg.DAYD >= tsg.DAYD(1) & tsg.DAYD <= tsg.DAYD(end) );
% ind = size(tsg.([PARA{1} '_ADJUSTED']));
%% CorGradientCallback .................................... Correction Module
function CorGradientCallback(hObject, eventdata)
% Get the indices between 2 dates
% --------------------------------
case 'part'
% Get the date limits used for the correction
% -------------------------------------------
dateMin = datenum(get( hetDateMin, 'String'), 'yyyy-mm-dd HH:MM:SS');
dateMax = datenum(get( hetDateMax, 'String'), 'yyyy-mm-dd HH:MM:SS');
% Find indices within date limits
% --------------------------------
if dateMax > dateMin
ind = find( tsg.DAYD >= dateMin & tsg.DAYD <= dateMax );
end
otherwise
msgbox( 'CorCancelCallback : error', 'CorCancelCallback', 'error', modal);
end
if ~isempty(ind) && ~isempty( tsg.([PARA{1} '_ADJUSTED']) )
% Cancel the correction : set the ADJUSTED variable to NaN
% and ADJUSTED_QC to 0 (Bytes)
% --------------------------------------------------------
tsg.([PARA{1} '_ADJUSTED'])(ind) = ...
NaN*ones(size(tsg.([PARA{1} '_ADJUSTED'])(ind))) ;
tsg.([PARA{1} '_ADJUSTED_QC'])(ind) = ...
zeros*ones(size(tsg.([PARA{1} '_ADJUSTED_QC'])(ind))) ;
tsg.([PARA{1} '_ADJUSTED_ERROR'])(ind) = ...
NaN*ones(size(tsg.([PARA{1} '_ADJUSTED_ERROR'])(ind))) ;
end
% Save tsg data
% -------------
setappdata(hMainFig, 'tsg_data', tsg);
% Plot in the 3 axes
% ------------------
plot_Correction( hMainFig, hPlotAxes, PARA );
end
%% gradientCorrectionCallback .................................... Correction Module
function gradientCorrectionCallback(hObject, eventdata)
% Callback function run when
% Desactivate somme Toggle button
......@@ -2748,8 +2840,8 @@ hrbInterpCancel = uicontrol( ...
set( hQCToggletool, 'state', 'off' );
set( hTimelimitToggletool, 'state', 'off' );
% Get the time limits for the correction A TESTER
% -----------------------------------------------
% Get the time limits for the correction
% --------------------------------------
dateMin = datenum(get( hetDateMin, 'String'), 'yyyy-mm-dd HH:MM:SS');
dateMax = datenum(get( hetDateMax, 'String'), 'yyyy-mm-dd HH:MM:SS');
......@@ -2794,8 +2886,8 @@ hrbInterpCancel = uicontrol( ...
end
%% CorBiasCallback .................................... Correction Module
function CorBiasCallback(hObject, eventdata)
%% biasCorrectionCallback .................................... Correction Module
function biasCorrectionCallback(hObject, eventdata)
% Callback function run when
% Desactivate somme Toggle button
......@@ -2854,8 +2946,8 @@ hrbInterpCancel = uicontrol( ...
end
end
%% CorLinearCallback .................................... Correction Module
function CorLinearCallback(hObject, eventdata)
%% linearCorrectionCallback .................................... Correction Module
function linearCorrectionCallback(hObject, eventdata)
% Callback function run when
% Desactivate somme Toggle button
......@@ -2908,8 +3000,8 @@ hrbInterpCancel = uicontrol( ...
end
%% CorMedianCallback .................................... Correction Module
function CorMedianCallback(hObject, eventdata)
%% medianCorrectionCallback .................................... Correction Module
function medianCorrectionCallback(hObject, eventdata)
% Callback function run when
% Desactivate somme Toggle button
......
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