Skip to content

Commit

Permalink
chore(numpy_2): validate behavior of type promotion in primitives_sta…
Browse files Browse the repository at this point in the history
…ndardize.py
  • Loading branch information
teald committed Oct 14, 2024
1 parent c1f3dda commit 204474c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions geminidr/core/primitives_standardize.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def addDQ(self, adinputs=None, **params):
log.fullinfo('Flagging saturated pixels in {} extension '
'{} above level {:.2f}'.format(
ad.filename, ext.id, saturation_level))
ext.mask |= np.where(ext.data >= saturation_level,
ext.mask |= np.where(ext.data >= saturation_level, # NUMPY_2: OK (0 -> uint16)
DQ.saturated, 0).astype(DQ.datatype)

if non_linear_level:
Expand All @@ -135,7 +135,7 @@ def addDQ(self, adinputs=None, **params):
'extension {} above level {:.2f}'
.format(ad.filename, ext.id,
non_linear_level))
ext.mask |= np.where((ext.data >= non_linear_level) &
ext.mask |= np.where((ext.data >= non_linear_level) & # NUMPY_2: OK (0 -> uint16)
(ext.data < saturation_level),
DQ.non_linear, 0).astype(DQ.datatype)
# Readout modes of IR detectors can result in
Expand Down Expand Up @@ -243,7 +243,7 @@ def addIllumMaskToDQ(self, adinputs=None, suffix=None, illum_mask=None):
for ext, illum_ext in zip(ad, final_illum):
if illum_ext is not None:
# Ensure we're only adding the unilluminated bit
iext = np.where(illum_ext.data > 0, DQ.unilluminated,
iext = np.where(illum_ext.data > 0, DQ.unilluminated, # NUMPY_2: OK (0 -> uint16)
0).astype(DQ.datatype)
ext.mask = iext if ext.mask is None else ext.mask | iext

Expand Down

0 comments on commit 204474c

Please sign in to comment.