Skip to content

Commit ae2a268

Browse files
authored
Add files via upload
1 parent 4e8a7c4 commit ae2a268

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

vorticity_threshold.m

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,17 @@
1919
vort = reshape(tmp, nRows, nColumns);
2020

2121
elseif MASK(1) == 1 && threshold>0 % Regular masking
22-
S = swirl;
23-
for i=1:nRows
24-
for j=1:nColumns
25-
if abs(S(i,j))<=threshold*max(abs(S(:)))
26-
vorticity(i,j)=0;
27-
end;
28-
end;
29-
end;
22+
P = swirl;
23+
P_max = max(max(abs(P)));
24+
P_thres = threshold*P_max;
25+
vorticity(abs(P)<=P_thres) = 0;
3026
vort = vorticity;
27+
3128
else
3229
vort = vorticity;
33-
end;
30+
31+
end
32+
3433

3534
case 'Vorticity'
3635
if MASK(1) == 0 && threshold>0% Gaussian masking
@@ -48,16 +47,15 @@
4847
vort = reshape(tmp, nRows, nColumns);
4948

5049
elseif MASK(1) == 1 && threshold>0% Regular masking
51-
V = vorticity;
52-
for i=1:nRows
53-
for j=1:nColumns
54-
if abs(V(i,j))<=threshold*max(abs(V(:)))
55-
vorticity(i,j)=0;
56-
end;
57-
end;
58-
end;
50+
P = vorticity;
51+
P_max = max(max(abs(P)));
52+
P_thres = threshold*P_max;
53+
vorticity(abs(P)<=P_thres) = 0;
5954
vort = vorticity;
55+
6056
else
6157
vort = vorticity;
62-
end;
63-
end;
58+
59+
end
60+
61+
end

0 commit comments

Comments
 (0)