The astra package (Astronomical Spectroscopy Tools for Rapid Analysis) is a small library of methods and tools for quick analysis of astronomical spectra, with a particular focus on spectra in time series.
astra is designed to be a simple toolbox of various methods used in spectral analysis, such as cross-correlation, optimal subtraction, and flux resampling. It is intended to be flexible, and easy to use, by having minimal dependencies and/or proprietary objects -- most methods work simiply by using NumPy arrays as spectra inputs and outputs.
astra also intends to make some older methods still used today easy to access and maintain, by providing native, well-documented, and Python-optimised versions that are simple to understand. The first methods ported as such come from the Fortran 77 program molly (e.g. correlate.xcorrelate
and fitting.optsub
).
To install astra, you can simply download and install in one line with pip
:
pip install https://github.com/jsimpson-astro/astra/archive/main.zip
astra is organised into three main sub-modules and two auxiliary sub-modules:
-
correlate - methods for correlation/cross-correlation. Provides
xcorrelate
, which is a flexible function for performing cross-correlation analysis between a set of observed and template spectra. Masking is supported. -
fitting - assorted fitting methods, including:
optsub
: a simple function for performin optimal subtraction between a set of spectra and templates. Masking is supported.linefitmc
: a complex function for multiple-line fitting usingemcee
.rvmc
: a function for fitting radial velocities usingemcee
.
-
integrate - various methods for integrating spectra. Currently provides one operation, with more on the way:
ew
: computes the equivalent width of one or multiple spectra. Masking is supported.
The two other sub-modules are utils, which contains various functions for performing simple operations on spectra (e.g. averaging, Doppler shifting), and plotting, which provides some general plotting methods for convenient display of results from astra methods.
The molly sub-module is deprecated, and will be removed in a future version.
If you find astra useful in your work, please reference this repository (https://github.com/jsimpson-astro/astra) in a footnote.