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

ADD et COMMIT de cette fonction utilise pour la correction des donnees. Elle...

ADD et COMMIT de cette fonction utilise pour la correction des donnees. Elle calcule la difference entre les echantillons et les mesures TSG
parent cd7b42de
No related branches found
No related tags found
No related merge requests found
function diffTsgSample(hTsgGUI)
%
% Co-location of sample and TSG measurements
% Compute the sample-TSG difference
%
% Get the tsg and sample structures from the application
% ------------------------------------------------------
tsg = getappdata( hTsgGUI, 'tsg_data');
sample = getappdata( hTsgGUI, 'sample' );
[m, n] = size(sample.SSPS);
% time difference between 2 succesive TSG measurements
% ----------------------------------------------------
dt = tsg.DAYD(2) - tsg.DAYD(1);
% Loop on the samples
% -------------------
for i= 1 : m
% Indice of the TSG measurement the closest to the sample
% --------------------------------------------------------
timeDiff = abs(tsg.DAYD - sample.DAYD(i));
[timeMin, indMin] = min(timeDiff);
if timeDiff(indMin) < dt && ~isnan(tsg.ssps.smooth.val(indMin))
sample.SSPS_SMOOTH(i) = tsg.ssps.smooth.val(indMin);
sample.SSPS_QC(i) = 1;
else
sample.SSPS_QC(i) = 0;
end
end
% Salinity difference : Sample minus smoothed TSG
% -----------------------------------------------
indSample = find( sample.SSPS_QC == 1 );
sample.SSPS_DIF(indSample) = ...
sample.SSPS(indSample) - sample.SSPS_SMOOTH(indSample);
% update the sample structures in the application
% ------------------------------------------------
setappdata( hTsgGUI, 'sample', sample );
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