Skip to content

Commit

Permalink
add comments on DESI masking
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverba137 committed Jan 24, 2024
1 parent eaac399 commit 338e80c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions py/prospect/viewer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ def plotspectra(spectra, zcatalog=None, redrock_cat=None, notebook=False, html_d
survey = 'DESI'
nspec = spectra[0].flux.shape[0]
for s in spectra:
# For DESI, anything that has a non-zero mask should also already
# have ivar == 0, so this may be redundant, but should also be harmless.
bad = (s.uncertainty.array == 0.0) | s.mask
s.flux[bad] = np.nan
else:
Expand All @@ -247,6 +249,8 @@ def plotspectra(spectra, zcatalog=None, redrock_cat=None, notebook=False, html_d
" _specutils_imported = "+str(_specutils_imported)+"\n"+
" _desispec_imported = "+str(_desispec_imported))
for band in spectra.bands:
# For DESI, anything that has a non-zero mask should also already
# have ivar == 0, so this may be redundant, but should also be harmless.
bad = (spectra.ivar[band] == 0.0) | (spectra.mask[band] != 0)
spectra.flux[band][bad] = np.nan
#- No coaddition if spectra is already single-band
Expand Down

0 comments on commit 338e80c

Please sign in to comment.