-
-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Continuum normalization #231
Comments
@alexji - thanks for this - just noticed it now! Can you have a look at the "step 0" in this notebook: https://github.com/spacetelescope/dat_pyinthesky/blob/master/pyinthesky_specutils_fitting.ipynb ? Do you think that broad "user interface" at least works with the way you're doing to compute continua? The key idea is to separate out the "defining the continuum" step from the subtracting or dividing step, because later analysis tasks sometimes want one or the other (e.g., equivalent width is most naturally done on a continuum-normalized spectrum, signal-to-noise on a raw spectrum, or flux measurements on a continuum-subtracted spectrum). So by storing the continuum model separately and using it on demand the thought is that this will make all that more flexible. |
Yeah, that definitely works! Here's what I will implement for
Let me know if something seems off. One thing is that looking at astropy.modeling, I don't seem to see 1D splines; did I miss that? Regarding tests, I will use spectra of metal-poor stars as a test to start. It might be good to have some other things uploaded to e.g. specutils/specutils/tests/data. |
you are encouraged to examine the well tested and used https://github.com/linetools/linetools/blob/master/linetools/analysis/continuum.py best to avoid re-inventing the wheel yet again.. |
And see for the GUI: http://linetools.readthedocs.io/en/latest/guis.html#continuum-fitting |
linetools continuumfit is indispensable in my QSO spectroscopic analyses. |
In the above PR, I implemented a bare-bones continuum fitter satisfying the "step 0" interface, and a direct port of @profxj's fitter (i.e. fitting through an Akima spline through iteratively chosen knots). @eteq I was looking for a spline-like model in astropy, and I couldn't find anything. Does it make sense to define an astropy model that has no parameters and is not fittable, but just calls a pre-computed function on the data? Or if being fancier, is there a way to implement spline-like models and fitters in the astropy framework? |
The project board suggests that a continuum fitting routine is desired. This issue is intended to start a discussion about what functionality and interface would make sense, and I'm happy to implement what we decide on.
@andycasey and I have routine at this link that finds a continuum with iterative sigma clipping. It's meant to be used interactively, but could be ported over.
The text was updated successfully, but these errors were encountered: