TSFitPy-developers / TSFitPy

Turbospectrum Spectral Fitting with Python (TSFitPy)
13 stars 4 forks source link

Turbospectrum Spectral Fitting with Python (TSFitPy)

TSFitPy is a pipeline designed to determine stellar abundances and atmospheric parameters through the use of Nelder-Mead (simplex algorithm) minimization. It calculates model spectra "on the fly" while fitting instead of using a more sophisticated method that relies on training neural networks (such as the method used by the full SAPP used for much larger datasets). Using this method allows the pipeline to gain flexibility in the stellar physics used at the expense of computation time, which makes it useful for small datasets of ~100 stars and fewer.

To use TSFitPy, you will need a working Turbospectrum (TS) installation of the latest version, which has the capability to compute NLTE line profiles as well as calculate specified spectral windows instead of a full spectrum for a given range. TSFitPy has not been tested on older versions of TS. The latest version of TS can be found here: https://github.com/bertrandplez/Turbospectrum_NLTE

The code requires at least version Python 3.7. It also makes use of fortran programs, which will need to be compiled on the user's machine (intel fortran ifort compiler highly recommended). The Python packages needed are as follows (they should all be installable via "pip install"):

Also, Windows is not supported (?).

There is a WIP (developed by NS only atm) GUI for TSFitPy (at least results plotting). You can see whether you might like it. It is available here.

Acknowledgements

If you use this code, please acknowledge the authors of the code and the Turbospectrum code. Please reference the following papers:

If you make use of the teff or vmic fitting methods, please acknowledge the following paper with the description of the method:

If you make use of the NLTE data, please acknowledge the appropriate papers for the NLTE data used (different one for each element!). See docs in the TurboSpectrum GitHub page for most sources. If you use Y, Eu, Al, Na (qmh), here are the updated references (might not be inside TurboSpectrum documentation just yet):

Quick start

This is a short version of the installation + running the code just to test that it works (not all inputs are downloaded). Please read the full version when you actually want to use the code.

Installation

Usage for fitting

Usage for grid generation

Usage for calculate_nlte_correction_line.py

NLTE usage: important notes

ifort compiler installation

Multiprocessing usage

Regarding the multiprocessing usage with Dask

Utilities

There are some utilities in the utilities folder. They are not used in the fitting, but can be useful for other things.

Extra notes

Here is the Trello board for the project: https://trello.com/b/2xe7T6qH/tsfitpy-todo

Some debugging tips: