astropy / astropy/specutils

Implement line_flux using integral over interpolator

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

Description

As discussed further in #701 (and following in part from #516), the `analysis.line_flux` (and because it calls it, `equivalent_width`) function has an implementation based on sums that makes sense for a linear interpolation or any "flux in boxes" interpretation of spectra. However, when an interpolator is provided, there's an alternate interpretation available for a spectrum: take the integral of the interpolation function. This gives a different answer than the sum approach for non-linear interpolators, and also has more natural ways to include uncertainties (e.g. the interpolation is just a fitting function that includes the uncertainties, so the integral is still just over the interpolator - see #627).

This could either be implemented implicitly whenever the `mask_interpolation` keyword is neither linear nor `None`, or it can be triggered explicitly by a keyword. But either way it would use the interpolation function with the `scipy.integrate.quad` function to do the integral.

Contributor guide

Open the contributing guide

Research direction

Start at analysis.line_flux and equivalent_width, then read the discussions in #701, #516, and #627 to resolve whether integration is implicit or keyword-controlled. Check how the interpolator is used and apply scipy.integrate.quad as described; done means line_flux and dependent equivalent_width follow the agreed integral behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
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.