astropy / astropy/specutils

'SpectralGWCS' object has no attribute 'to_fits'

Open
#735 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
204
Forks
134
Avg merge
12h 55m
Merged PRs (30d)
1

Description

Loading an SDSS spectrum with the 'SDSS-I/II spSpec' format loader and then writing to fits using format "wcs1d-fits" writer raises error:

ValueError: Only Spectrum1D objects with valid WCS can be written as wcs1d: 'SpectralGWCS' object has no attribute 'to_fits'

Please see attached fits file and minimum example script.
We include in the script the output of running the script and environment info.
[SpectralGWCSBug.tar.gz](https://github.com/astropy/specutils/files/5594130/SpectralGWCSBug.tar.gz)

Contributor guide

Open the contributing guide

Research direction

Start with the attached SpectralGWCSBug.tar.gz, including its minimum example, output, and environment information. Reproduce loading the SDSS-I/II spSpec file and writing it with the wcs1d-fits format, then trace why SpectralGWCS lacks to_fits where the writer validates WCS support. Done means the example writes successfully without the reported ValueError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.