1

Is there any handy module to detect emission lines in a spectrum like one we get from sdss?

You can see there are many emission lines like Ha,OI in the spectrum below. In fact the spectrum is a two column data set, wavelength and flux. It is a combination of lots of scatter points. The typical interval between two points nearyby is 1.5 angstroms. I need to find all the Gaussian bumps and their line centers.

So,first I need to find the the bumps and then I need to fit them to get their centers.

Thank you.

enter image description here

questionhang
  • 735
  • 2
  • 12
  • 31
  • http://stackoverflow.com/questions/3260/peak-detection-of-measured-signal looks like the same question. I've done a fair bit of this kind of work and the best approach is often dependent on your data. Generally, the answer will involve some combination of smoothing, find local maxima, and curve fitting (if you need widths). – Greg Whittier Oct 21 '13 at 18:20
  • Did you look in the python imaging library? – kyle k Oct 21 '13 at 19:03
  • I don't know what the detection of emission lines entails. If you outline the steps more concrete advice could be given, but numpy/scipy should get you going in the right direction. – Paul Oct 21 '13 at 20:10
  • 1
    I have updated my post.First find a local maximum and then fit it with a Gaussian profile. This method is too easy to believe. Anything else I miss? – questionhang Oct 22 '13 at 12:11

1 Answers1

0

My answer comes a little bit late, but it is now that I have found myself in the same situation.

I think that the tool that best matches our needs is Specutils, an Astropy package for spectroscopy. Specifically, you may need to use either find_lines_threshold or find_lines_derivative methods from that package: https://specutils.readthedocs.io/en/stable/fitting.html#line-finding

According to the documentation, providing a 1D spectrum and a threshold (to filter the actual lines from the noise) the method will return a table of emission and absorption lines, identifying the central wavelengths of each of them.

I hope it helps!

JTM
  • 33
  • 1
  • 6
  • Thanks. You have used Specutils? It seems we need to specify a noise region(SpectralRegion), but different lines may have different background. – questionhang Oct 31 '19 at 11:54
  • As far as I understand, the noise is estimated as the standard deviation of a region. If you compute the noise from a region including actual strong emission/absorption lines, you will be overestimating the background noise. Therefore, my advise for defining a noise threshold representative of the whole spectrum would be to compute the standard deviation from as many regions free of strong lines as possible. E.g. for galaxies 4 reasonably flat ranges [(Dobos et. al 2012)](https://ui.adsabs.harvard.edu/abs/2012MNRAS.420.1217D/abstract) are: 4200-4300, 4600-4800, 5400-5500 and 5600–5800 A. – JTM Nov 07 '19 at 14:34
  • @JTM Do you have another suggestion besides astropy? I work with mineral spectra, and astropy identifies the emission zones but not the absorption. I've been trying to get help from the developers but no luck... – La Cordillera Jun 01 '20 at 07:11
  • @AngelaR. I don't know any software specific for treating mineral spectra. Actually the same functions from `specutils` should detect absorption lines as well. In practice, unlike galaxy spectra, stellar spectra are full of absorption lines. You can find an example with a spectrum showing an absorption line [here](https://specutils.readthedocs.io/en/stable/fitting.html#line-finding). – JTM Jun 05 '20 at 11:37