Skip to content

Commit

Permalink
Display warning message when large number of vectors have been interp…
Browse files Browse the repository at this point in the history
…olated during validation between the passes.
  • Loading branch information
Shrediquette committed Apr 14, 2023
1 parent 52e94cc commit df99f9d
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions piv_FFTmulti.m
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,29 @@
utable_orig=utable;
vtable_orig=vtable;
[utable,vtable] = PIVlab_postproc (utable,vtable,[],[], [], 1,4, 1,1.5);
%find typevector...
%maskedpoints=numel(find((typevector)==0));
%amountnans=numel(find(isnan(utable)==1))-maskedpoints;
%discarded=amountnans/(size(utable,1)*size(utable,2))*100;
%disp(['Discarded: ' num2str(amountnans) ' vectors = ' num2str(discarded) ' %'])

maskedpoints=numel(find((typevector)==0));
amountnans=numel(find(isnan(utable)))-maskedpoints;
discarded=amountnans/(size(utable,1)*size(utable,2))*100;
if multipass==2 %only display warning after first pass, because later passes are just the interpolation of the interpolation which isn't very informative
if discarded > 33 && discarded < 75
disp(['WARNING: Problematic image data, interpass-validation discarded ' num2str(round(discarded)) '% of the vectors in pass nr. ' num2str(multipass) '!'])
beep on
beep
end
if discarded >= 75 && discarded < 95
disp(['WARNING: Very bad image data, interpass-validation discarded ' num2str(round(discarded)) '% of the vectors in pass nr. ' num2str(multipass) '!'])
beep on
beep
commandwindow
end
if discarded >= 95
disp(['Error: Catastrophic image data, interpass-validation discarded ' num2str(round(discarded)) '% of the vectors in pass nr. ' num2str(multipass) '!'])
beep on
beep
commandwindow
end
end

%replace nans
utable=inpaint_nans(utable,4);
Expand Down

0 comments on commit df99f9d

Please sign in to comment.