Skip to content

Commit

Permalink
minor code tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-simpson committed Sep 18, 2020
1 parent e53a317 commit 6cb4669
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gempy/library/spectral.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ def __init__(self, spectrum=None, spectral_axis=None, wcs=None, **kwargs):
# If no wavelength information is included, get it from the input
if spectral_axis is None and wcs is None:
if isinstance(spectrum, AstroData):
if spectrum.nddata.wcs is not None:
wcs = spectrum.nddata.wcs
if spectrum.wcs is not None:
wcs = spectrum.wcs
else:
spec_unit = u.Unit(spectrum.hdr.get('CUNIT1', 'nm'))
try:
wavecal = dict(zip(spectrum.WAVECAL["name"],
spectrum.WAVECAL["coefficients"]))
except (AttributeError, KeyError): # make a Model from the FITS WCS info
det2wave = (models.Shift(1-spectrum.hdr['CRPIX1']) |
det2wave = (models.Shift(1 - spectrum.hdr['CRPIX1']) |
models.Scale(spectrum.hdr['CD1_1']) |
models.Shift(spectrum.hdr['CRVAL1']))
else:
Expand Down

0 comments on commit 6cb4669

Please sign in to comment.