Fix rounding errors (fixes #9)

pull/16/head
Cees Bassa 2019-04-22 17:16:30 +02:00
parent 2a21c6f2a8
commit 52864f2269
1 changed files with 3 additions and 1 deletions

View File

@ -164,7 +164,9 @@ class fourframe:
"""Create a selection mask"""
c1 = ndimage.uniform_filter(self.znum, 3, mode='constant')
c2 = ndimage.uniform_filter(self.znum*self.znum, 3, mode='constant')
z = np.sqrt(c2-c1*c1)
# Add epsilon to keep square root positive
z = np.sqrt(c2-c1*c1+1e-9)
# Standard deviation mask
c = z < zstd