Skip to content

Commit

Permalink
added model expression for wavelength solution type none (DC-FLAG == …
Browse files Browse the repository at this point in the history
…-1) and fixing assertion in test.
  • Loading branch information
Simon Torres committed Aug 7, 2019
1 parent a33d65a commit 1ded18a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
17 changes: 11 additions & 6 deletions specutils/io/default_loaders/wcs_fits.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,15 +382,20 @@ def _none():
"""Required to handle No-wavelength solution
No wavelength solution is considered in the FITS standard (dtype = -1)
This method is placed here for completeness even though is not
implemented.
Raises
------
This will return the identity function. It does not use
`~astropy.modeling.models.Identity` because is not simpler to instantiate.
Instead it uses `~astropy.modeling.models.Linear1D`
NotImplementedError
Rretuns
-------
A mathematical model instance of `~astropy.modeling.models.Linear1D`
with slope 1 and intercept 0.
"""
raise NotImplementedError
model = models.Linear1D(slope=1,
intercept=0)
return model


def _linear_solution(wcs_dict):
Expand Down
4 changes: 2 additions & 2 deletions specutils/tests/test_loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ def test_iraf_linear(remote_data_path):
spectrum_1d = Spectrum1D.read(remote_data_path, format='iraf')

assert isinstance(spectrum_1d, Spectrum1D)
assert spectrum_1d.wavelength[0] == 3514.56625402 * u.angstrom
assert spectrum_1d.wavelength[100] == 3514.56625402 * u.angstrom + 0.653432383823 * 100 * u.angstrom
assert spectrum_1d.wavelength[0] == u.Quantity(3514.56625402, unit='Angstrom')
assert spectrum_1d.wavelength[100] == u.Quantity(3514.56625402, unit='Angstrom') + u.Quantity(0.653432383823 * 100, unit='Angstrom')


@remote_access([{'id':'3359180', 'filename':'log-linear_fits_solution.fits'}])
Expand Down

0 comments on commit 1ded18a

Please sign in to comment.