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

Test de l'integration du moudle de correction - Pas encore implementé.

Ajoute dans tsg_intialisation une structure contenant les constantes du programme
parent 553f5222
No related branches found
No related tags found
No related merge requests found
function dev_tsgcor_GUI function dev_tsgcor_GUI( hMainFig )
% dev_tsgcor_GUI % dev_tsgcor_GUI
% %
% GUI for correction of TSG data by comparison to samples % GUI for correction of TSG data by comparison to samples
...@@ -265,13 +265,16 @@ function dev_tsgcor_GUI ...@@ -265,13 +265,16 @@ function dev_tsgcor_GUI
% Lecture fichier TSG % Lecture fichier TSG
% ------------------- % -------------------
filename = 'F:\work\M_TsgQc\tsg_data\past0601.txt'; % filename = 'F:\work\M_TsgQc\tsg_data\past0601.txt';
[tsg, error] = dev_readTsg( filename); % [tsg, error] = dev_readTsg( filename);
% Lecture fichier bucket % Lecture fichier bucket
% ----------------------- % -----------------------
filename = 'F:\work\M_TsgQc\tsg_data\past0601.btl'; % filename = 'F:\work\M_TsgQc\tsg_data\past0601.btl';
[bucketASCII, error] = dev_readBucket( filename); % [bucketASCII, error] = dev_readBucket( filename);
tsg = getappdata( hMainFig, 'tsg_data' );
sample = getappdata( hMainFig, 'sample' );
% Salinity, in one 1 hour interval, should not depart the average for more % Salinity, in one 1 hour interval, should not depart the average for more
% than SAL_STD_MAX standard deviation % than SAL_STD_MAX standard deviation
...@@ -291,12 +294,12 @@ COR_TIME_WINDOWS = 10; ...@@ -291,12 +294,12 @@ COR_TIME_WINDOWS = 10;
dev_moveaverage(tsg.TIME, tsg.PSAL, TSG_DT_SMOOTH, TSG_STDMAX); dev_moveaverage(tsg.TIME, tsg.PSAL, TSG_DT_SMOOTH, TSG_STDMAX);
% Merge the 2 types of 'bucket' records, if they exists % Merge the 2 types of 'bucket' records, if they exists
bucketNETCDF = bucketASCII; %bucketNETCDF = bucketASCII;
bucketNETCDF.TIME = bucketNETCDF.TIME + 1; %bucketNETCDF.TIME = bucketNETCDF.TIME + 1;
bucketNETCDF.PSAL = bucketNETCDF.PSAL + 1; %bucketNETCDF.PSAL = bucketNETCDF.PSAL + 1;
bucketNETCDF = struct([]); %bucketNETCDF = struct([]);
sample = dev_mergesample( bucketNETCDF, bucketASCII); %sample = dev_mergesample( bucketNETCDF, bucketASCII);
% Compute the sample-TSG differences % Compute the sample-TSG differences
sample = dev_diffTsgSample(tsg, psal_smooth, sample, TSG_SAMPLING_TIME); sample = dev_diffTsgSample(tsg, psal_smooth, sample, TSG_SAMPLING_TIME);
...@@ -645,11 +648,7 @@ axes(hPlotAxes(1)); ...@@ -645,11 +648,7 @@ axes(hPlotAxes(1));
function QuitProgram(hObject, eventdata) function QuitProgram(hObject, eventdata)
delete(hChild1Fig); delete(hChild1Fig);
% reset Matlab search path to default
rmpath( [DEFAULT_PATH_FILE filesep 'tsg_util'] );
rmpath( [DEFAULT_PATH_FILE filesep 'tsg_data'] );
rehash;
end end
end end
...@@ -8,6 +8,10 @@ function tsg_initialisation(hTsgGUI, hQcCmenu) ...@@ -8,6 +8,10 @@ function tsg_initialisation(hTsgGUI, hQcCmenu)
% ------ % ------
% $Id$ % $Id$
% *************************************************************************
% Constants for the quality control procedure
% Quality Code and color % Quality Code and color
qc.Color.NO_CONTROL = 'k'; qc.Color.NO_CONTROL = 'k';
...@@ -22,12 +26,39 @@ qc.Code.PROBABLY_GOOD = 3; ...@@ -22,12 +26,39 @@ qc.Code.PROBABLY_GOOD = 3;
qc.Code.PROBABLY_BAD = 4; qc.Code.PROBABLY_BAD = 4;
qc.Code.BAD = 5; qc.Code.BAD = 5;
% Store default value 'quality' a application data
% ------------------------------------------------
quality.Code = qc.Code.GOOD; quality.Code = qc.Code.GOOD;
quality.Color = qc.Color.GOOD; quality.Color = qc.Color.GOOD;
set( hQcCmenu, 'UserData', quality ); set( hQcCmenu, 'UserData', quality );
% Set named application data % Store the 'qc' structure as application data
% ------------------------------- % --------------------------------------------
setappdata( hTsgGUI, 'qcColor', qc); setappdata( hTsgGUI, 'qcColor', qc);
% *************************************************************************
% Constants for the Correction procedure
% Smoothing of tsg time series over 1 hour interval
% 1 hour interval expressed in MATLAB serial Number
% -------------------------------------------------
const.TSG_DT_SMOOTH = datenum(0, 0, 0, 1, 0 , 0);
% Smoothing of tsg time series :
% Salinity, in one 1 hour interval, should not depart the average for more
% than SAL_STD_MAX standard deviation
% -----------------------------------------------------------------------
const.TSG_STDMAX = 0.1;
% Correction is estimated by computing the median value of X tsg-sample
% differences
% Amount of days used to compute the correction
% ---------------------------------------------------------------------
const.COR_TIME_WINDOWS = 10;
% store the 'const' structure as an application data
% --------------------------------------------------
setappdata( hTsgGUI, 'constante', const);
end end
...@@ -669,12 +669,13 @@ function tsgqc_GUI ...@@ -669,12 +669,13 @@ function tsgqc_GUI
% Test if tsg and sample data have been loaded % Test if tsg and sample data have been loaded
% -------------------------------------------- % --------------------------------------------
if ~isempty( getappdata( hMainFig, 'sample') ) && ... if ~isempty( getappdata( hMainFig, 'tsg_data') ) && ...
~isempty( getappdata( hMainFig, 'sample') ) ~isempty( getappdata( hMainFig, 'sample') )
% Call the GUI for tsg correction % Call the GUI for tsg correction
% ------------------------------- % -------------------------------
msgbox('The correction module has not been implemented'); msgbox('The correction module has not been implemented');
%dev_tsgcor_GUI( hMainFig );
else else
......
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