You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After shifting a spectrum, attempting to write a Spectrum1D to a fits file with the format wcs1d-fits using Spectrum1D.write(format="wcs1d-fits") raises the following error: IndexError: index 6 is out of bounds for axis 0 with size 1. Using the same function with format="tabular-fits" works as expected.
I suspect this is because the wcs is not updated after the shift:
I now realize this is because after correcting for redshift/radial velocity the spectral axis will not have a constant delta, which doesn't work with a fits header. A solution would be to allow wcs to recognize radial velocity as a header keyword, which would allow us to at least store the value in the fits header while keeping the original spectral axis, but that's an issue for AstroPy rather than specutils.
Alternatively, Spectrum1D.write() could add a RADVEL keyword to the header manually after using AstroPy to create the fits file (which I assume is how it works).
After shifting a spectrum, attempting to write a Spectrum1D to a fits file with the format wcs1d-fits using
Spectrum1D.write(format="wcs1d-fits")
raises the following error:IndexError: index 6 is out of bounds for axis 0 with size 1
. Using the same function withformat="tabular-fits"
works as expected.I suspect this is because the wcs is not updated after the shift:
Output:
The text was updated successfully, but these errors were encountered: