Skip to main content

A package to compute and analyse stellar line profiles

Project description

PARVATI

PARVATI (Profile and Analysis of Radial Velocity using Astronomical Tools for Investigation) is a Python package for astronomical spectroscopy.

Introduction

PARVATI consists in several useful functions that allows to create mean line profiles or extract single line from ASCII or FITS spectra, and then to analyse those lines.

Preparation of the spectra

The input spectra may have different format: either ASCII files with wavelength, flux and additional information (e.g., SNR or echelle order number), standard monodimensionl FITS file or FITS table. The spectra may be read with the read_spectrum, and before extracting the line profiles must be normalised using the norm_spectrum function.

Read the spectra

The function read_spectrum will require as input the filename of the spectrum, and accordingly to the other options given it will read:

  • a monodimensional FITS file with the flux as the hdu[0].data and the wavelength in the header (CRVAL1, CDELT1, NAXIS1)
  • a FITS table with all the data in hdu[1].data. By default, the wavelength will be read in the first field and the flux in the second field, but the number of the field may be given. If the additional data as SNR and/or echelle order number and/or nomrmalised flux are present they may be specified here. IMPORTANT: the numbers of the fields start with 1, not 0
  • an ASCII files with at least two columns (wavelength and flux), but additional columns with SNR and/or echelle order number and/or nomrmalised flux may be present and specified here. IMPORTANT: the numbers of the columns start with 1, not 0

The wavelength is assumed to be in Angstroms, if otherwise then it must be specified here.

Normalise the spectra

If the spectra are not normalised, it is possible to use the function norm_spectrum to do so. The function requires the wavelength and flux as input, plus many other additional options. It is possible to set the degree of the polynomial and a number of subsets to normalise independently.

Creation of the profiles

Once in possessione of normalised spectra, the line profiles may be extracted or created in several different ways.

Single line extraction

The function extract_line requires the spectrum in the format given by read_spectrum or norm_spectrum, the laboratory wavelength of the desired line, the radial velocity range and step of the extraction window. The extracted line will be interpolated on a Doppler velocity range, to help with the subsequent analysis.

Mean line profile: LSD

The function compute_lsd compute the mean line profile by performing a Least-Squares Deconvolution of the spectrum in the format given by read_spectrum or norm_spectrum with a mask that may be either an ASCII mask (VALD stellar mask, simple 2-columns file, normalised spectrum/model) or a FITS file (mask or normalised spectrum/model). Several options may be passed to optimised the profile extraction.

Mean line profile: CCF

The function compute_lsd compute the mean line profile by performing a Cross-Correlation of the spectrum in the format given by read_spectrum or norm_spectrum with a mask that may be either an ASCII mask (VALD stellar mask, simple 2-columns file, normalised spectrum/model) or a FITS file (mask or normalised spectrum/model). Several options may be passed to optimised the profile extraction.

Analysis of the profiles

Once the profiles have been obtained, PARVATI allows to perform several useful operation on the data, to better analyse them.

Normalise the profiles

First of all, even if the profiles should already be normalised, any slight deviation from a perfect normalisation of the spectra will impact the profiles. It is better to re-normalised them using the norm_profile function. This function required as input not the name of a single file, but an ASCII file with a list of names: this will allow to compute also an average mean line profile and the standard deviation of the profiles from this average, to better see where possible line profile variations are located.

Fit the profiles

Once normalised, the profiles may be fitted using the fit_profile function. It is posible to choose different fitting function: Gaussian, Lorentzian, Voigt or rotational profile. All the fitting functions yield a Radial Velocity (RV) estimation, the Equivalent Width (EW) and other information (e.g. the vsini from the rotational function). IMPORTANT: the rotational function is very sensitive to the initial RV and line width guess, incorrect values will result in wrong and unphysical results.

Compute the line moments

The first four line moments may be computed from the normalised profiles using the moments function. The moments are:

  • m0: EW
  • m1: RV
  • m2: sigma, from which also the Full-Width-at-Half-Maximum (FWHM) is derived
  • m3: from which the skewness is derived
  • m4: from which the kurtosis is derived.

Compute the line's bisector

The functionbisector computes both the bisector of the line and the bisector's span.

Compute the Fourier Transform of the line

The function fourier first symmetrised the line and then performs the Fourier Transform (FT) of the symmetrised line. The symmetrisation process yield another estimate of the RV, while the positions of the first 3 zeroes of the FT give information on the vsini and the differential rotation IF the rotational broadening is the dominant line broadening effect.

Test files

A couple of simple script are given in the tests directory along with two high-resolution spectra and two VALD stellar masks to guide in computing/extracting the line profile and then analysing them.

Graphical interface: SHIVA

The graphical interface of PARVATI is SHIVA (Simple and Helpful Interface for Variability Analysis). SHIVA may be downloaded from https://github.com/mrainer74/shiva

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

parvati-1.0.3.tar.gz (7.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

parvati-1.0.3-py3-none-any.whl (34.8 kB view details)

Uploaded Python 3

File details

Details for the file parvati-1.0.3.tar.gz.

File metadata

  • Download URL: parvati-1.0.3.tar.gz
  • Upload date:
  • Size: 7.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for parvati-1.0.3.tar.gz
Algorithm Hash digest
SHA256 6e3507a93381c3eec04cfc3230d6b048b176d65dae929227e9416d4d3d6e6969
MD5 fc4bc6f99f17a86c81ff01380db03df4
BLAKE2b-256 5feed1349bbdffc6a7d351189f847c054873b27b6f9286277276fa98d99bde15

See more details on using hashes here.

File details

Details for the file parvati-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: parvati-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 34.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for parvati-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 578981489e04e441aec39f02622b2bd138f897f38c7984c9dbc9f45a3bfdc453
MD5 8f83c44c1de63cddfe559b04aa9df78b
BLAKE2b-256 cdf0534acec1e0475e82a963c7fea2ceafd08143b82af32382729b87b01ac8c6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page