Address wcs1d loader failures on various IRAF multispec formats #1127
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Opening this both as a WIP and issue for tracking incompatibilities of the
wcs1d-fits
loader with the IRAF 'equispec' and 'multispec' (Echelle?) formats. These are largely from reports on the list or even off-list or in the Facebook group etc., so I have yet to find out if I can link to publicly available example files.The "fix" implemented here so far basically just works around a WCS error, loading a MULTISPEC file without a valid spectral WCS; this seems to have been ignored for some time, but with recent
specutils
versions results in aThe underlying problem is that the files are using a WCS defined as
which to the best of my knowledge is simply not supported by WCSLIB (I think spatial WCS of similar construction are, but I don't see a way to define a valid header for a spectral WCS).
The kludge here is catching that error and working around the WCS failure by just constructing a
spectral_axis
from the pixel scale, but of course without having solved the WCS provides no wavelength calibration – it merely allows to read in the spectrum at all, similar to olderspecutils
versions.As it does not seem that Astropy WCS will be able to do this, a real fix will probably require solving for the spectral axis in
specutils
, as is e.g. implemented in nonlinearwave.