Skip to content

Commit

Permalink
Fix mask value for rejmask
Browse files Browse the repository at this point in the history
  • Loading branch information
saimn committed Sep 29, 2020
1 parent ef8377c commit 158f6eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gempy/library/nddops.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,11 +314,11 @@ def __call__(self, data, mask=None, variance=None,
stage='immediately after rejection')

# when mask is None rejector return a bool mask.
# convert dtype and set mask values to 36768
# convert dtype and set mask values to 32768
rejmap = None
if rejmask is not None:
if rejmask.dtype.kind == 'b':
rejmask = rejmask.astype(DQ.datatype) * 36768
rejmask = rejmask.astype(DQ.datatype) * 32768

# Unset the 32768 bit *only* if it's set in all input pixels
rejmask &= ~(np.bitwise_and.reduce(rejmask, axis=0) & 32768)
Expand Down

0 comments on commit 158f6eb

Please sign in to comment.