GithubHelp home page GithubHelp logo

shbhuk / steparsyn Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hmtabernero/steparsyn

0.0 0.0 0.0 6.94 MB

SteParSyn is an automatic code used to infer stellar atmospheric parameters using the spectral synthesis method.

Home Page: https://ui.adsabs.harvard.edu/abs/2022A%26A...657A..66T/abstract

Python 99.54% Shell 0.46%

steparsyn's Introduction

You need to install the following python packages to run SteParSyn (e.g. using pip):

numpy scipy matplotlib astropy extinction emcee tqdm celerite george pygtc

The repository contains the following programs:

- SteParSyn.py:  the main code
- convsyn.py:    convolution code
- readstats.py:  reads the Markov chains
- runone.sh:  it calls SteParSyn.py
- runall.sh:  it calls runone.sh 
- readone.sh: it calls readstats.py 
- readall.sh: it calls readone.sh 

To install the code: clone the repo, install the dependencies, create missing dirs ... :

$  git clone https://github.com/hmtabernero/SteParSyn 
$  pip3 install --user numpy scipy matplotlib astropy extinction emcee tqdm celerite george pygtc
$  cd SteParSyn
$  mkdir eSPECTRA BINOUT PLOTS GRIDS

Download the synthetic grid (Fe_MARCS.bin) from https://drive.google.com/file/d/1pkHVbj5rNvONJSqlMO4IvhW0UBN3Jvxf/view?usp=sharing

You should put it in the folder GRIDS

Give permissions to programs:

$ chmod +x *sh

Relevant directories:

- GRIDS: here you should put the grid of synthetic spectra 
- MASKS: line masks files
- RANGES: your range files
- CONFIG: here you can control the priors and which parameters to fix, priors, etc
- OPT:   option files (iterations, number of chains, ...)
- SPECTRA: input spectra 
- eSPECTRA: best fit spectra (in ascii)
- BINOUT: pickle files containing the MCMC sampling
- PLOTS: corner plots 

The repo contains an example to compute the stellar atmospheric parameters of a solar spectrum. To run the example:

$ ./runall.sh

To get the results:

$ ./readall.sh

If you want to analyse your own data you need to do as follows (I am assuming that the name of your star is "sun_vesta")

- Provide a txt file containing: wavelengths, fluxes, and its uncertainities (same as SPECTRA/sun_vesta.txt)
- Create a mask file with: line names, line centre, mask centre, and mask width (same format as MASKS/sun_vesta_masks.txt)
- Generate an option file with your parameter options: limits, priors, etc. (You can use CONFIG/sun_vesta.conf as is)

Add the following line to runall.sh:

./runone.sh sun_vesta hermes MCMC

Add also this line to readall.sh

./readone.sh sun_vesta 

I will write a more complete manual in the near future.

Finally, please cite the SteParSyn paper if you use it in your reasearch, you can find it here: https://ui.adsabs.harvard.edu/abs/2022A%26A...657A..66T/abstract

If you have any doubts please do not hesitate to e-mail me.

steparsyn's People

Contributors

hmtabernero avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.