Cross-correlation peak-finding functions
- Dominant language
- Python
- Stars
- 204
- Forks
- 134
- Avg merge
- 12h 55m
- Merged PRs (30d)
- 1
Description
As highlighted in this notebook: https://github.com/spacetelescope/jdat_notebooks/blob/c22a9856ac5ce1af947b1f5361b7f425e86625ad/notebooks/redshift_crosscorr/redshift_with_crosscorr.ipynb the machinery added in #544 to allow cross-correlation redshift currently does not come with any way to actually get an answer for the redshift from the lag peaks. We should add a (some?) functions to `specutils.analysis` that uses standard methods used in astronomy for this form of peak-finding. The most "traditional" one I know of is the Tonroy&Davis approach, written up here: https://ui.adsabs.harvard.edu/abs/1979AJ.....84.1511T/abstract , but there are plenty of more complete approaches - a nice write-up of that is here: Statler 1995 (https://ui.adsabs.harvard.edu/abs/1995AJ....109.1371S).
The Tonroy&Davis version might just be a function that does something like:
```
... all the prep work for cross-correlation...
>>> correlation_peak_td(correlation.template_correlate(p_obs, p_template), p_obs)
```
which would then set the `redshift`/`radial_velocity` attributes on `p_obs` with the peak location (and the uncertainty could just be an attribute added by hand like `p_obs.radial_velocity.uncertainty` and `p_obs.redshift.uncertainty`).
Alternatively/additionally, it could be ``peak_rv = correlation_peak_td(correlation.template_correlate(p_obs, p_template)``, although then we have to manage the logic for "rv or redshift?" as part of the function call, which `SpectralCoord` alread does in my first case.
I'd say the best thing to do is start with tonry&davis to work out the API and add more approaches as time/interest permits.
Contributor guide
Research direction
Start with notebooks/redshift_crosscorr/redshift_with_crosscorr.ipynb and the cross-correlation machinery added in issue #544. Read the Tonry-Davis reference and inspect the specutils.analysis entry points around correlation.template_correlate to settle whether the API returns a peak result or updates p_obs. Done means a Tonry-Davis peak-finding function can derive redshift or radial velocity, with uncertainty handling defined.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100