Commit 845a8e78 authored by EPINAT Benoit's avatar EPINAT Benoit

bug correction in clipping

parent 0214c6ae
......@@ -416,13 +416,15 @@ def clipcube(cube, hdr, xy=3, sclip=3, npass=10):
im = cube[z, :]
count = 0
ok = False
while count < npass | ok:
#while count < npass | ok:
while (count < npass) & not(ok):
count += 1
im1 = ndimage.median_filter(im, xy)
diff = im - im1
bad = np.abs(diff) > (sclip * np.std(diff))
im[bad] = im1[bad]
if np.size(bad) == 0:
#if np.size(bad) == 0:
if np.sum(bad) == 0:
ok = True
cube1[z, :] = im
hdr.append(('XYCLIP', xy, 'Size of the clipping box'))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment