Skip to content

Tool to find velocity off-sets between optical spectra.

License

Notifications You must be signed in to change notification settings

ezavarygin/voffset

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

Description

The program determines regular, i.e. constant within each exposure, velocity off-sets between quasar/stellar absorption line spectra. The latter should be normalised and be output files of the UVES_popler software.

Installation

The software was written to work with python 2.7. To get it to work, include the path to the voffset executable file into your system PATH. That is it, you can run it from any directory on your machine.

Python modules used:

  • Barak
  • astropy
  • numpy
  • scipy
  • matplotlib
  • sys

Usage

voffset <list of spectra> --an anchor [--option]

where:

<list of spectra> - a list of paths to the fits files with spectra to cross-correlate with the reference spectrum,

anchor - a path to the file with the reference spectrum (should follow `--an`).

Options:

--fwhm - folowed with a path to the file with Gaussian FWHM kernels (in km/s) for each of the spectra including the reference one 
(if not specified, 3-pixel width is used instead). Example of the file with Gaussian kernels can be found in the `example` folder.

--plot - create a pdf file with an off-set distribution bar chart.

--chi2plots - Plot chi2 fitted with a porabola for each spectrum.

The program creates a file with three columns: file names of the specified spectra, velocity off-sets in km/s, 1 sigma uncertainty on the off-set in km/s (determined from points where chi^2 = chi^2_min + 1). The first line corresponds to the reference spectrum.

How it works

I colloquially call the process of finding the off-sets as a cross-correlation. However, it is not precisely what voffset does. A simple cross-correlation procedure is limited to a pixel size (~1-3 km/s for typical spectra from high resolution spectrographs of HIRES/Keck and UVES/VLT), while typical off-sets have sub-pixel values. I thus implemented a method similar to one described by Evans & Murphy (2013).

First, the spectra are convolved with a Gaussian of constant FWHM in velocity space using Barak package by Neil Crighton. The latter can be specified using --fwhm option. The suggestion is to use resolution (FWHM) of the telescope. If no file is specified, the program will convolve the spectra with 3-pixel width instead. Then, flux and error arrays of the reference exposure (specified with --an) are interpolated with cubic spline to get continuous functions of wavelength and the off-set. The velocity off-set between each examined exposure and the reference one is given by the minimum of a chi^2-function with respect to the off-set. The program uses only valid (unaffected by CRs, etc.) pixels covered by both exposures. It determines the chi^2 minimums for all the specified spectra and writes them into a "voffset_result.dat" file. The program knows 2 ways of minimising: numerical and "direct" (you can choose either, see 180th line of the voffset file), but uncertainties on the off-sets are calculated for the latter only.
The default one is the "direct" method where chi^2 is directly calculated in the range of +/-3 km/s with a step of 0.001 km/s (you can tweak it in the code). Then, the points around the minimum are fitted with a parabola and the minimum value and the uncertainty are taken and printed on the screen and to the file.

About

Tool to find velocity off-sets between optical spectra.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages