Skip to content

Commit

Permalink
Merge branch 'develop' into reidarxiv_err_msg
Browse files Browse the repository at this point in the history
  • Loading branch information
tbowers7 committed Nov 1, 2023
2 parents 23b369f + f0ec8e0 commit 75c14bc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pypeit/specutils/pypeit_loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,13 @@ def pypeit_spec1d_loader(filename, extract=None, fluxed=True, strict=True, **kwa
_ext, _cal = sobj.best_ext_match(extract=extract, fluxed=fluxed)
_wave, _flux, _ivar, _gpm = sobj.get_box_ext(fluxed=_cal) if _ext == 'BOX' \
else sobj.get_opt_ext(fluxed=_cal)
_wave, _flux, _ivar = _enforce_monotonic_wavelengths(_wave, _flux, _ivar, strict=strict)
if not np.all(_gpm):
msgs.warn(f'Ignoring {np.sum(np.logical_not(_gpm))} masked pixels.')
if not np.any(_gpm):
msgs.warn(f'Spectrum {sobj.NAME} is fully masked and will be ignored!')
continue
_wave, _flux, _ivar = _enforce_monotonic_wavelengths(_wave[_gpm], _flux[_gpm], _ivar[_gpm],
strict=strict)
flux_unit = astropy.units.Unit("1e-17 erg/(s cm^2 Angstrom)" if _cal else "electron")
spec += \
[Spectrum1D(flux=astropy.units.Quantity(_flux * flux_unit),
Expand Down

0 comments on commit 75c14bc

Please sign in to comment.