Skip to content

๐Ÿˆ Automatic differentiable spectrum modeling of exoplanets/brown dwarfs compatible to JAX.

License

Notifications You must be signed in to change notification settings

ykawashima/exojax

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

ExoJAX

License Docs arxiv paper

Auto-differentiable line-by-line spectral modelling of exoplanets/brown dwarfs/M dwarfs using JAX. Read the docs ๐Ÿ•. In short, ExoJAX allows you to do gradient based optimisation and HMC NUTS fitting using the latest database.

ExoJAX is at least compatible with

Functions

Voigt Profile โœ”๏ธ
from exojax.spec import voigt
nu=numpy.linspace(-10,10,100)
voigt(nu,1.0,2.0) #sigma_D=1.0, gamma_L=2.0
Cross Section using HITRAN/HITEMP/ExoMol โœ”๏ธ
from exojax.utils.grids import wavenumber_grid
from exojax.spec.api import MdbExomol
from exojax.spec.opacalc import OpaPremodit

from jax.config import config
config.update("jax_enable_x64", True)

nu_grid,wav,res=wavenumber_grid(1900.0,2300.0,200000,xsmode="premodit",unit="cm-1",)
mdb = MdbExomol(".database/CO/12C-16O/Li2015",nu_grid)
opa = OpaPremodit(mdb,nu_grid,auto_trange=[900.0,1100.0])
xsv = opa.xsvector(1000.0, 1.0) # cross section for 1000K, 1 bar
Do you just want to plot the line strength at T=1000K?
mdb.change_reference_temperature(1000.) # at 1000K
plt.plot(mdb.nu_lines,mdb.line_strength_ref,".")
Emission Spectrum โœ”๏ธ
art = ArtEmisPure(nu_grid=nu_grid, pressure_btm=1.e2, pressure_top=1.e-8, nlayer=100)
F = art.run(dtau, Tarr)

See http://secondearths.sakura.ne.jp/exojax/develop/tutorials/get_started.html for the first step!

Installation

pip install exojax

or

python setup.py install
Note on installation w/ GPU support

๐Ÿ“š You need to install CUDA, NumPyro, JAX w/ NVIDIA GPU support, and cuDNN.

  • NumPyro

ExoJAX supports NumPyro >=0.7.0. Please check the required JAX version by NumPyro. In May 2021, it seems the recent version of NumPyro requires jaxlib>=0.1.62 (see setup.py of NumPyro for instance).

  • JAX

Check you cuda version:

nvcc -V

Install such as

pip install --upgrade pip
pip install --upgrade "jax[cuda]" -f https://storage.googleapis.com/jax-releases/jax_releases.html

Please visit here for details.

References

paper

  • Paper I: Kawahara, Kawashima, Masuda, Crossfield, Pannier, van den Bekerom, ApJS 258, 31 (2022)

License

๐Ÿˆ Copyright 2020-2023 ExoJAX contributors. exojax is publicly available under the MIT license.

About

๐Ÿˆ Automatic differentiable spectrum modeling of exoplanets/brown dwarfs compatible to JAX.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Jupyter Notebook 95.2%
  • Python 4.8%