Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions specreduce/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,10 @@ def __call__(self, image=None, trace_object=None,
if np.any(variance < 0):
raise ValueError("variance must be fully positive")

if np.any(np.isnan(variance)):
# exclude these elements by editing the input mask
img.mask[np.isnan(variance)] = True

if np.any(variance == 0):
# exclude these elements by editing the input mask
img.mask[variance == 0] = True
Expand Down