Analysing Spectra#

Velocity Spectra#

DataSet objects support one data method, vspec(), which converts wavelength into velocity relative to a given reference wavelength, wav_ref:

from ATK import query

sdss_query = query("spectrum", targets=587316166180416640, survey="sdss", path="example_spectrum.fits.gz")
sdss_query.apply("vspec", wav_ref = 6562.7097, inplace=False)
sdss_query.open()
Bokeh Figure




Fitting Spectral Features#

Spectrum objects also support two further plotting options for performing spectral analysis.


Spectral features can be detected and fitted by passing fit=True to plot(). To aid in detecting features while reducing false positives, the following additional arguments are also supported when using fit=True:

  • prominence sets the minimum prominence of spectral features (see here for details, default = 2.0)

  • smooth sets the level to which the spectrum is smoothed before searching for peaks (default = 3.0)

  • snr sets the minimum signal-to-noise ratio of spectral features (default = 3.0)


sdss_query.plot(fit=True, smooth=5.0)
sdss_query.open()
Bokeh Figure




Detecting Radial Velocities#

Spectrum plotting also supports multi-component radial velocity fitting by passing rv_fit=True. As peaks must first be detected, the same additional parameters are accepted as when using fit=True:

sdss_query.plot(rv_fit=True, smooth=5.0)
sdss_query.open()
Bokeh Figure





Download this Tutorial

Total running time of the script: (0 minutes 25.077 seconds)

Gallery generated by Sphinx-Gallery