Giter VIP home page Giter VIP logo

baraffe_tables's Introduction

Baraffe tables.

Build Status Codacy BadgeUpdatesPython 3

baraffe_tables is a small package to access the Baraffe (2003, 2015) evolutionary tables and enables interpolating between rows of the tables and between stellar ages (different tables). It was primarily created to calcualte the flux ratio of stellar companions given their mass.

How to use

To clone and install:

git clone https://github.com/jason-neal/baraffe_tables
cd baraffe_tables
python setup.py install

baraffe_table_search can be used to access a particular row of the Baraffe tables given a value of one parameter. For example, the parameters of a star with a mass of M/Ms=0.08 and an age=4.0 can be obtained using:

from baraffe_tables.table_search import baraffe_table_search
row = baraffe_table_search(column="M/Ms", value=0.08, age=4.0, model=2003, age_interp=True)
print(row)

The query_baraffe.py CLI script can also be used to achieve the same. Append -hfor help.

query_baraffe.py -h

Host-Companion flux ratio

There are also two scripts to use the Baraffe et al. 2003/2015 to estimate stellar companion parameters (primarily Brown Dwarfs (BD)) knowing their mass. These can be used for any companion within the Baraffe models mass range.

  • mass_to_flux_ratio.py

    Takes a companion mass (in Mjup) and uses this to look up the absolute magnitude of the companion. This compares the magnitude of companion to the magnitude of the star in the literature (SIMBAD) to calculate the flux ratio. This also accounts for the conversion between apparent and absolute magnitudes.

  • flux_ratio_to_mass.py

    This script works in reverse to mass_to_flux_ratio.py. Given a companion/host flux ratio what is the mass of the companion.

For example: HD30501 has a BD companion with a mass of 89 Mjup and an age of 5Gyr. The companion/host flux ratio an be estimated using the 2003 models with:

mass_to_flux_ratio.py HD30501 89 5 -m 03

Contributing

Any issues or suggestions? Everyone is welcome to make an issue or a pull request.

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.