Specutils Documentation

_images/logo.png

specutils is a Python package for representing, loading, manipulating, and analyzing astronomical spectroscopic data. The generic data containers and accompanying modules provide a toolbox that the astronomical community can use to build more domain-specific packages. For more details about the underlying principles, see APE13, the guiding document for spectroscopic development in the Astropy Project.

Note

While specutils is available for general use, the API is in an early enough development stage that some interfaces may change if user feedback and experience warrants it.

Getting started with specutils

As a basic example, consider an emission line galaxy spectrum from the SDSS. We will use this as a proxy for a spectrum you may have downloaded from some archive, or reduced from your own observations.

Now maybe you want the equivalent width of a spectral line. That requires normalizing by a continuum estimate:

But then you can apply a single function over the region of the spectrum containing the line:

>>> from specutils import SpectralRegion
>>> from specutils.analysis import equivalent_width
>>> equivalent_width(cont_norm_spec, regions=SpectralRegion(6562*u.AA, 6575*u.AA)) 
<Quantity -14.78092438 Angstrom>

While there are other tools and spectral representations detailed more below, this gives a test of the sort of analysis specutils enables.