astropy / astropy/specutils

Error using fit_generic_continuum()

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

Description

Hello everyone, I hope you are having a good day.

As said in the title, I have some trouble using the fit_generic_continuum function. I loaded a Spectrum1D object from some fits file located in my computer. I am looking to normalize the spectrum before trying to find equivalent widths of spectral lines.
However, whenever I run the line "g1_fit = fit_generic_continuum(myspec)," I get the error "AttributeError: 'WCS' object has no attribute 'unit'." The spectrum myspec was loaded with this line: "myspec = Spectrum1D.read(filepath, format = "wcs1d-fits")" (filepath being the path of my fits file).
For the reference, I was trying to do something similar to what they did in [this tutorial.](https://specutils.readthedocs.io/en/stable/fitting.html#specutils-continuum-fitting)

Let me know if any information needs to be given.
Thank you !

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported call to fit_generic_continuum(myspec) after loading myspec with Spectrum1D.read(filepath, format="wcs1d-fits"). Compare the result with the continuum-fitting tutorial and trace the AttributeError involving the WCS object's missing unit. Done means this loading path can reach continuum fitting without that error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.