Skip to content

Commit 24cc286

Browse files
committed
Update smoothn.py
1 parent 6859e6d commit 24cc286

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

openpiv/smoothn.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ def smoothn(
155155
error(nargchk(1,12,nargin));
156156
z0=None,W=None,s=None,MaxIter=100,TolZ=1e-3
157157
"""
158+
is_masked = False
159+
158160
if type(y) == ma.core.MaskedArray: # masked array
159161
is_masked = True
160162
mask = y.mask
@@ -526,7 +528,7 @@ def InitialGuess(y, I):
526528
k = array(z.shape)
527529
m = ceil(k / 10) + 1
528530
d = []
529-
for i in xrange(len(k)):
531+
for i in range(len(k)):
530532
d.append(arange(m[i], k[i]))
531533
d = np.array(d).astype(int)
532534
z[d] = 0.0
@@ -568,7 +570,7 @@ def peaks(n):
568570
xp = arange(n)
569571
[x, y] = meshgrid(xp, xp)
570572
z = np.zeros_like(x).astype(float)
571-
for i in xrange(n / 5):
573+
for i in range(n // 5):
572574
x0 = random() * n
573575
y0 = random() * n
574576
sdx = random() * n / 4.0

0 commit comments

Comments
 (0)