From ae2a268b88ff309f58a5c40199e165d2c8362ba5 Mon Sep 17 00:00:00 2001 From: Hadar Ben-Gida <61211644+bengida1989@users.noreply.github.com> Date: Fri, 4 Dec 2020 22:02:02 +0200 Subject: [PATCH] Add files via upload --- vorticity_threshold.m | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/vorticity_threshold.m b/vorticity_threshold.m index b524df5..2681d74 100644 --- a/vorticity_threshold.m +++ b/vorticity_threshold.m @@ -19,18 +19,17 @@ vort = reshape(tmp, nRows, nColumns); elseif MASK(1) == 1 && threshold>0 % Regular masking - S = swirl; - for i=1:nRows - for j=1:nColumns - if abs(S(i,j))<=threshold*max(abs(S(:))) - vorticity(i,j)=0; - end; - end; - end; + P = swirl; + P_max = max(max(abs(P))); + P_thres = threshold*P_max; + vorticity(abs(P)<=P_thres) = 0; vort = vorticity; + else vort = vorticity; - end; + + end + case 'Vorticity' if MASK(1) == 0 && threshold>0% Gaussian masking @@ -48,16 +47,15 @@ vort = reshape(tmp, nRows, nColumns); elseif MASK(1) == 1 && threshold>0% Regular masking - V = vorticity; - for i=1:nRows - for j=1:nColumns - if abs(V(i,j))<=threshold*max(abs(V(:))) - vorticity(i,j)=0; - end; - end; - end; + P = vorticity; + P_max = max(max(abs(P))); + P_thres = threshold*P_max; + vorticity(abs(P)<=P_thres) = 0; vort = vorticity; + else vort = vorticity; - end; -end; + + end + +end