Skip to content

Commit

Permalink
Merge pull request #2059 from meeseeksmachine/auto-backport-of-pr-205…
Browse files Browse the repository at this point in the history
…7-on-v3.3.x

Backport PR #2057 on branch v3.3.x (TST: temporary fix for spectrum1d mask containing None)
  • Loading branch information
kecnry authored Mar 2, 2023
2 parents c4c5c8e + ad66c7b commit 042dfab
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions jdaviz/configs/specviz/plugins/line_analysis/line_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,11 @@ def _uncertainty(result):

temp_results = []
spec_subtracted = spectrum - continuum

if spec_subtracted.mask is not None:
# temporary fix while mask may contain None:
spec_subtracted.mask = spec_subtracted.mask.astype(bool)

for function in FUNCTIONS:
# TODO: update specutils to allow ALL analysis to take regions and continuum so we
# don't need these if statements
Expand Down Expand Up @@ -499,6 +504,9 @@ def _uncertainty(result):
continue
else:
spec_normalized = spectrum / continuum
if spec_normalized.mask is not None:
spec_normalized.mask = spec_normalized.mask.astype(bool)

temp_result = FUNCTIONS[function](spec_normalized)
elif function == "Centroid":
# TODO: update specutils to be consistent with region vs regions and default to
Expand Down

0 comments on commit 042dfab

Please sign in to comment.