astropy / specreduce

Tools for the reduction of spectroscopic observations from Optical and NIR instruments
https://specreduce.readthedocs.io
61 stars 38 forks source link

Detect lines in a spectrum. #15

Open crawfordsm opened 6 years ago

crawfordsm commented 6 years ago

Given a spectrum, detect the peaks in the spectrum and identify the lines and possible the statistics of those lines to help with the identification of those lines

chris-simpson commented 4 years ago

The peak finding routine in scipy.signal works well for this, I've found, because the arc lines are all of similar width. In DRAGONS I've had to do some wrapping to handle masked pixels and the fact that lines are sometimes saturated and hence flat-topped, which can result in multiple peaks in adjacent pixels that have to be reduced to a single peak. I then have a centroiding routine (a python implementation of the IRAF SPP centroiding which does some iterative spline fitting) to get the peak to sub-pixel accuracy. I guess I should submit a PR with a module containing this code in a non-DRAGONS-specific format.

keflavich commented 1 month ago

I'd like to have this toolkit available with reasonable astronomy examples. It should be straightforward to add some basic emission line (calibration lamp) peak finding and signal-to-noise thresholding examples.