RVSpecFit: Automated Spectroscopic Pipeline

RVSpecFit is an automated spectroscopic pipeline for determining radial velocities and stellar atmospheric parameters from spectroscopic data. It uses interpolated synthetic spectral templates (primarily PHOENIX) and performs maximum likelihood fitting.

Build Status Documentation Status Coverage Status

Author: Sergey Koposov (skoposov@ed.ac.uk), University of Edinburgh

Citation: If you use RVSpecFit, please cite: - Koposov et al. 2019 (ASCL) - Koposov et al. 2011 (ApJ)

Quick Start

Installation

Install the latest version from PyPI:

pip install rvspecfit

Basic Usage

Here’s a minimal example of fitting a spectrum (but keep in mind that you will need to build the library of templates first).

from rvspecfit import fitter_ccf, vel_fit, spec_fit, utils
import astropy.table as atpy

# Load configuration (optional)
config = utils.read_config('config.yaml')

# Load your spectroscopic data
tab = atpy.Table().read('spec.fits')
wavelength = tab['wavelength']  # in Angstroms
spec = tab['spec']             # flux
espec = tab['espec']           # error spectrum

# Create SpecData object
specdata = [spec_fit.SpecData('mysetup', wavelength, spec, espec)]

# Get initial parameter guess using cross-correlation
res = fitter_ccf.fit(specdata, config)
paramDict0 = res['best_par']
if res['best_vsini'] is not None:
    paramDict0['vsini'] = res['best_vsini']

# Perform maximum likelihood fitting
options = {'npoly': 10}
res1 = vel_fit.process(specdata, paramDict0,
                      fixParam=[], config=config, options=options)
print(res1)

Indices and Tables