/pyterpol3

Fitting of observed spectra by synthetic one (e.g. AMBRE, POLLUX, OSTAR, BSTAR, PHOENIX).

Primary LanguagePythonGNU General Public License v2.0GPL-2.0

PYTERPOL is an advanced astrophysical tool for interpolation in grids
of synthetic spectra (e.g. AMBRE, POLLUX, OSTAR, BSTAR, PHOENIX).
and fitting of observed ones.

If you use this code, please cite the original reference:

  J. Nemravov\'a, P. Harmanec, M. Bro\v z, D. Vokrouhlick\'y, D. Mourard,
  C.A. Hummel, C.T. Bolton et al., \xi Tauri: a unique laboratory to study
  the dynamic interaction in a compact hierarchical quadruple system,
  A&A 594, A55.
  
Also do not forget to cite papers describing the employed grid 
of synthetic spectra.

A detailed description with a tutorial how to use PYTERPOL is at:

  https://github.com/chrysante87/pyterpol/wiki

but probably the simplest script (to get 4 synthetic spectra) is shown here:

--

#!/usr/bin/env python3

import pyterpol3

sg = pyterpol3.SyntheticGrid()

prim = dict(teff=10700., logg=4.08,  z=1.0)
seco = dict(teff=10480., logg=4.01,  z=1.0)
tetr = dict(teff=14190., logg=4.527, z=1.0)
quad = dict(teff=6500., logg=4.00,  z=1.0)

wlim = [4200., 4600.]
vrots = [12.6, 14.3, 229.2, 80.]
names = ['Aa', 'Ab', 'B', 'C']

for vrot, comp, name in zip(vrots, [prim, seco, tetr, quad], names):

    c = sg.get_synthetic_spectrum(comp, wlim, order=4, step=0.01, padding=0.0)
    c.get_spectrum(vrot=vrot, keep=True)
    c.write_spectrum(filename=name + '.syn')

--

Q: Where are the grids of synthetic spectra?!

A: They have to be downloaded and converted. For example, the PHOENIX grid at:

   ftp://phoenix.astro.physik.uni-goettingen.de/v2.0/HiResFITS/PHOENIX-ACES-AGSS-COND-2011/Z-0.0/
   and then use a script grid_ABS/ready_phoenix.py.

Q: How to add new grid?

A: Edit synthetic/defaults.py; if the grid is unique, e.g., with step = 0.05 A,
   use the mode keyword:

   sg = pyterpol3.SyntheticGrid(mode='POWR')