Skip to content
Snippets Groups Projects
Commit dc535dcf authored by gael.alory_legos.obs-mip.fr's avatar gael.alory_legos.obs-mip.fr
Browse files

correction d'un bug dans le "gradient adjustment": le calcul de la correction...

correction d'un bug dans le "gradient adjustment": le calcul de la correction ne tenait pas bien compte des cas ou EXT_DIF n'est pas calcule
parent 7bc3e36d
No related branches found
No related tags found
No related merge requests found
......@@ -122,13 +122,13 @@ if dateMax > dateMin
if ~isempty(dtTsg2)
tsg_rel=(tsg.(PARA{2})(dtTsg(dtTsg2))-tsg.EXT_SMOOTH(ind(iint)))/tsg_diff(iint);
tsg_rel=(tsg.(PARA{2})(dtTsg(dtTsg2))-tsg.EXT_SMOOTH(ind(ind2(iint))))/tsg_diff(iint);
tsg_rel(tsg_rel<0)=0;
tsg_rel(tsg_rel>1)=1;
tsg.([PARA{1} '_ADJUSTED'])(dtTsg(dtTsg2)) =...
(1-tsg_rel)*tsg.EXT_DIF(ind(iint)) + tsg_rel*tsg.EXT_DIF(ind(iint+1));
(1-tsg_rel)*tsg.EXT_DIF(ind(ind2(iint))) + tsg_rel*tsg.EXT_DIF(ind(ind2(iint+1)));
tsg.([PARA{1} '_ADJUSTED_ERROR'])(dtTsg(dtTsg2)) =...
(1-tsg_rel)*abs(tsg.EXT_DIF(ind(iint))/2) + tsg_rel*abs(tsg.EXT_DIF(ind(iint+1))/2);
(1-tsg_rel)*abs(tsg.EXT_DIF(ind(ind2(iint)))/2) + tsg_rel*abs(tsg.EXT_DIF(ind(ind2(iint+1)))/2);
% Compute the corrected value : original value + correction
% ---------------------------------------------------------
......@@ -157,7 +157,7 @@ if dateMax > dateMin
% Case with 1 sample only: we can't apply this correction
% --------------------------------------------------------------------------
elseif ~isempty(ind2) && length(ind2) == 2
else
msgbox( {'Function corTsgGradient'; ' '; ...
'At least 2 samples are needed';...
......
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