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

Renommer la fonction d'interpolation lnéaire

parent fd8ef5f5
No related branches found
No related tags found
No related merge requests found
......@@ -11,5 +11,5 @@ char;char;char;byte;char;char;char
#;VALUE_CHANGED;Value changed;5;c;off;#
#;HARBOUR;Harbour;6;c;on;#
#;NOT_USED;Not used;7;w;off;#
#;INTERPOLATED_VALUE;Interpolated value;8;k;off;#
#;INTERPOLATED_VALUE;Interpolated value;8;b;off;#
#;MISSING_VALUE;Missing value;9;k;off;#
function interpPosLinear( hMainFig, dateMin, dateMax )
function [error] = interpPosLinear( hMainFig, dateMin, dateMax )
%
% Function that interpolate linearly Latitude and position when they are
% set to NaN
......@@ -17,6 +17,11 @@ function interpPosLinear( hMainFig, dateMin, dateMax )
% --------------------
tsg = getappdata( hMainFig, 'tsg_data');
% Get INTERPOLATED_VALUE code
% ---------------------------
NO_CONTROL = get(tsg.qc.hash, 'NO_CONTROL', 'code');
INTERPOLATED_VALUE = get(tsg.qc.hash, 'INTERPOLATED_VALUE', 'code');
error = 1;
if dateMax > dateMin
......@@ -26,13 +31,22 @@ if dateMax > dateMin
if ~isempty( ind )
interp1( tsg.DAYD(ind), tsg.LATX(ind)
end
% Create time series
% ------------------
time = dateMin:deltaT:dateMax;
% Look for records with no position
% ---------------------------------
ind2 = find( isnan(tsg.LATX(ind)) == 1 );
Y = interp1( tsg.DAYD(ind), tsg.LATX(ind), tsg.DAYD(ind(ind2)) );
tsg.LATX(ind(ind2)) = Y;
Y = interp1( tsg.DAYD(ind), tsg.LONX(ind), tsg.DAYD(ind(ind2)) );
tsg.LONX(ind(ind2)) = Y;
if isempty( tsg.POSITION_QC )
tsg.POSITION = NO_CONTROL * ones( size(tsg.DAYD) );
end
tsg.POSITION_QC(ind(ind2)) = INTERPOLATED_VALUE;
end
% Update tsg application data
% ---------------------------
......
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