Skip to main content

Python wrapper for the FORTRAN ACE code.

Project description

ACEPython - An equilibrium chemistry code

Introduction | Usage | TauREx 3 | Citing ACEPython

Introduction

ACEPython is a Python wrapper for the FORTRAN equilibrium chemistry code developed by Agúndez et al. 2012. It can rapidly compute the equilibirum chemical scheme for a given temperature and pressure.

Installation

ACEPython can be installed with prebuilt wheels using pip:

pip install acepython

Or, if you prefer, you can build it from source which requires a FORTRAN and C compiler. The following commands will build and install ACEPython:

git clone https://github.com/ucl-exoplanets/acepython.git
cd acepython
pip install .

Usage

ACEPython can be used to compute the equilibrium chemistry for a given temperature and pressure. Temperature and pressure must be created with astropy units. For pressure, any unit can be used (Pa, bar etc). The following example shows how to compute the equilibrium chemistry for a column of atmosphere:

from acepython import run_ace
from astropy import units as u
import numpy as np
import matplotlib.pyplot as plt


temperature = np.linspace(3000, 1000, 100) << u.K
pressure = np.logspace(6, -2, 100) << u.bar

species, mix_profile, mu_profile = run_ace(
    temperature,
    pressure,
)

species_to_see = ["H2", "H20", "CH4", "NH3", "C2H2", "CO", "CO2", "H2CO"]

fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(10, 5))

for i, spec in enumerate(species):
    if spec in species_to_see:
        ax1.plot(mix_profile[i], pressure, label=spec)

ax1.set_yscale("log")
ax1.set_xscale("log")
ax1.invert_yaxis()
ax1.set_ylabel("Pressure (bar)")
ax1.set_xlabel("VMR")

ax1.legend()

ax2.plot(mu_profile, pressure)
ax2.set_yscale("log")
ax2.invert_yaxis()
ax2.set_ylabel("Pressure (bar)")
ax2.set_xlabel("Mean molecular weight (au)")

plt.show()

Should produce the following figure: alt text

Custom chemical scheme

By default the elements in the chemical scheme are H, He, C, N, O at log abundances 12, 10.93, 8.39, 7.86, 8.73 respectively. The abundances can be changed by passing the elements and corresponding abundances to the run_ace function:

species, mix_profile, mu_profile = run_ace(
    temperature,
    pressure,
    elements=["H", "He", "C", "N", "O"],
    abundances=[12, 10.93, 8.39, 7.86, 7.73],
)

where we have changed O to have a log abundance of 7.73.

You can customize the species included by passing in thermochemical and species data files.

For example, if we have a custom thermochemical data file called custom_thermochemical_data.dat and a custom species data file called custom_species_data.dat that includes sulphur we can run ACEPython with:

species, mix_profile, mu_profile = run_ace(
    temperature,
    pressure,
    elements=["H", "He", "C", "N", "O", "S"],
    abundances=[12, 10.93, 8.39, 7.86, 7.73, 7.0],
    thermochemical_data="custom_thermochemical_data_w_S.dat",
    species_data="custom_species_data_w_S.dat",
)

TauREx3

ACEPython also includes a plugin for TauREx 3.1 that allows you to use ACEPython as a chemistry scheme. In the input file you can select it in the Chemistry section using acepython with arguments:

[Chemistry]
chemistry = acepython
# He/H ratio (optional)
he_h_ratio = 0.83
# Elements excluding H, He (optional)
elements = C, N, O  
# log abundances (optional)
abundances = 8.39, 7.86, 8.73 
# Custom species data file (optional)
spec_file = custom_species_data.dat 
# Custom thermochemical data file (optional)
thermo_file = custom_thermochemical_data.dat 

Citing ACEPython

If you use ACEPython in your research, please cite the following papers:

@ARTICLE{Agundez2012,
    author = {{Ag{\'u}ndez}, M. and {Venot}, O. and {Iro}, N. and {Selsis}, F. and
        {Hersant}, F. and {H{'e}brard}, E. and {Dobrijevic}, M.},
        title = "{The impact of atmospheric circulation on the chemistry of the hot Jupiter HD 209458b}",
    journal = {A\&A},
    keywords = {astrochemistry, planets and satellites: atmospheres, planets and satellites: individual: HD 209458b, Astrophysics - Earth and Planetary Astrophysics},
        year = "2012",
        month = "Dec",
    volume = {548},
        eid = {A73},
        pages = {A73},
        doi = {10.1051/0004-6361/201220365},
archivePrefix = {arXiv},
    eprint = {1210.6627},
primaryClass = {astro-ph.EP},
    adsurl = {https://ui.adsabs.harvard.edu/abs/2012A&A...548A..73A},
    adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{2021ApJ...917...37A,
       author = {{Al-Refaie}, A.~F. and {Changeat}, Q. and {Waldmann}, I.~P. and {Tinetti}, G.},
        title = "{TauREx 3: A Fast, Dynamic, and Extendable Framework for Retrievals}",
      journal = {\apj},
     keywords = {Open source software, Astronomy software, Exoplanet atmospheres, Radiative transfer, Bayesian statistics, Planetary atmospheres, Planetary science, 1866, 1855, 487, 1335, 1900, 1244, 1255, Astrophysics - Instrumentation and Methods for Astrophysics, Astrophysics - Earth and Planetary Astrophysics},
         year = 2021,
        month = aug,
       volume = {917},
       number = {1},
          eid = {37},
        pages = {37},
          doi = {10.3847/1538-4357/ac0252},
archivePrefix = {arXiv},
       eprint = {1912.07759},
 primaryClass = {astro-ph.IM},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2021ApJ...917...37A},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{2022ApJ...932..123A,
       author = {{Al-Refaie}, A.~F. and {Changeat}, Q. and {Venot}, O. and {Waldmann}, I.~P. and {Tinetti}, G.},
        title = "{A Comparison of Chemical Models of Exoplanet Atmospheres Enabled by TauREx 3.1}",
      journal = {\apj},
     keywords = {Open source software, Publicly available software, Chemical abundances, Bayesian statistics, Exoplanet atmospheres, Exoplanet astronomy, Exoplanet atmospheric composition, Exoplanets, Radiative transfer, 1866, 1864, 224, 1900, 487, 486, 2021, 498, 1335, Astrophysics - Earth and Planetary Astrophysics, Astrophysics - Instrumentation and Methods for Astrophysics},
         year = 2022,
        month = jun,
       volume = {932},
       number = {2},
          eid = {123},
        pages = {123},
          doi = {10.3847/1538-4357/ac6dcd},
archivePrefix = {arXiv},
       eprint = {2110.01271},
 primaryClass = {astro-ph.EP},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2022ApJ...932..123A},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

acepython-0.0.11.tar.gz (80.0 kB view details)

Uploaded Source

Built Distributions

acepython-0.0.11-cp312-cp312-win_amd64.whl (435.5 kB view details)

Uploaded CPython 3.12 Windows x86-64

acepython-0.0.11-cp312-cp312-musllinux_1_1_x86_64.whl (767.5 kB view details)

Uploaded CPython 3.12 musllinux: musl 1.1+ x86-64

acepython-0.0.11-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

acepython-0.0.11-cp312-cp312-macosx_12_0_arm64.whl (809.9 kB view details)

Uploaded CPython 3.12 macOS 12.0+ ARM64

acepython-0.0.11-cp312-cp312-macosx_10_9_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.12 macOS 10.9+ x86-64

acepython-0.0.11-cp311-cp311-win_amd64.whl (435.2 kB view details)

Uploaded CPython 3.11 Windows x86-64

acepython-0.0.11-cp311-cp311-musllinux_1_1_x86_64.whl (767.3 kB view details)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

acepython-0.0.11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

acepython-0.0.11-cp311-cp311-macosx_12_0_arm64.whl (809.7 kB view details)

Uploaded CPython 3.11 macOS 12.0+ ARM64

acepython-0.0.11-cp311-cp311-macosx_10_9_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

acepython-0.0.11-cp310-cp310-win_amd64.whl (435.3 kB view details)

Uploaded CPython 3.10 Windows x86-64

acepython-0.0.11-cp310-cp310-musllinux_1_1_x86_64.whl (767.1 kB view details)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

acepython-0.0.11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

acepython-0.0.11-cp310-cp310-macosx_12_0_arm64.whl (809.7 kB view details)

Uploaded CPython 3.10 macOS 12.0+ ARM64

acepython-0.0.11-cp310-cp310-macosx_10_9_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

acepython-0.0.11-cp39-cp39-win_amd64.whl (435.3 kB view details)

Uploaded CPython 3.9 Windows x86-64

acepython-0.0.11-cp39-cp39-musllinux_1_1_x86_64.whl (767.1 kB view details)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

acepython-0.0.11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

acepython-0.0.11-cp39-cp39-macosx_12_0_arm64.whl (809.7 kB view details)

Uploaded CPython 3.9 macOS 12.0+ ARM64

acepython-0.0.11-cp39-cp39-macosx_10_9_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

File details

Details for the file acepython-0.0.11.tar.gz.

File metadata

  • Download URL: acepython-0.0.11.tar.gz
  • Upload date:
  • Size: 80.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for acepython-0.0.11.tar.gz
Algorithm Hash digest
SHA256 3ce3d50bea391b68c54568c7b7bf93875518c520593a96e973b46314d5894450
MD5 4c1151eab7a4ef7f184473e522d83300
BLAKE2b-256 6b95ac1aa1cebbe31896850346f41bd0e6bb18efbe2f7758fd8341d0ac0cf896

See more details on using hashes here.

File details

Details for the file acepython-0.0.11-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for acepython-0.0.11-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 fa99b075bd359e77d1d904b24bbf7d1c63a19d9a4cecc013722c46f625823a3d
MD5 8206c696758b3481768dd33c5607f614
BLAKE2b-256 363abb7965cff1258d18e061e8fb9c553af9ac12340626f66fb62fde317e8f49

See more details on using hashes here.

File details

Details for the file acepython-0.0.11-cp312-cp312-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for acepython-0.0.11-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 3c62516d51e215244e6e56ed8ee4f0b306204818bd3237f58f08b6875922c3e0
MD5 4b468ec040f23e0d1eeb522486efd500
BLAKE2b-256 c7d8c629b21a99f2dc13a527c027c6c0ad1995916fede260be16827e53b0b10c

See more details on using hashes here.

File details

Details for the file acepython-0.0.11-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for acepython-0.0.11-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7046f9f4786b71396c1b9af1164e049a73a5b666b8053f969d33eaa9ed92c88c
MD5 bd6adbecaf92d9c6ac9b8ce799eda528
BLAKE2b-256 26373d864e321c864e46d4fb1bad4bdd95d276ed88d59574f8ec57a562cc474d

See more details on using hashes here.

File details

Details for the file acepython-0.0.11-cp312-cp312-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for acepython-0.0.11-cp312-cp312-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 2f67897ac0251b638b7a55298043e462f4f44dabb863cbb5ef73c6e4b6a5f187
MD5 61122d5e37523b9f61c3eab38f1a557b
BLAKE2b-256 f6afc2923c7618ebbff6018736e77d721f451c005c7c23a362da8ae47df5c281

See more details on using hashes here.

File details

Details for the file acepython-0.0.11-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for acepython-0.0.11-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 12656e1fe801b42691b4010d82b4ec92f337761db8c2b27ca281bbabf8e615e8
MD5 49489ad40aafc24962edfd0bcb350a25
BLAKE2b-256 1ff349427087bfc6ff74128395263a7dbb678fdfe8241f5662453c54966e5976

See more details on using hashes here.

File details

Details for the file acepython-0.0.11-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for acepython-0.0.11-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 65f1aa76db59cad692326d6f9c8871717d9f51cb60531414b822b28288ec7a9e
MD5 ac5a4798ce9db7992a0c44e44b68f694
BLAKE2b-256 41e05f0177a106cc16a0307f54af0d69d5a27aac2213e1b2e11b02b33658aaae

See more details on using hashes here.

File details

Details for the file acepython-0.0.11-cp311-cp311-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for acepython-0.0.11-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 a6abe5e4813ede7652759d88ab30e1965655e8999e0e178f18390817a423f825
MD5 0d9f3be5a286d3a2cb9c4e6ef4a94e93
BLAKE2b-256 1502052c27a961a36477b5e938e9802175c0f51f7c013f0799eaff547ed4aadd

See more details on using hashes here.

File details

Details for the file acepython-0.0.11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for acepython-0.0.11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 36564ed7e24af196108615ce6c234a7ebb86d2c4bd1d26a7e0e7243e0aab067b
MD5 1d88013400039efa844beeb246137d69
BLAKE2b-256 8ee1cee47bec892fb63e491eac47ab9a575ae37606d8a4276a4d1b8b9c9f0525

See more details on using hashes here.

File details

Details for the file acepython-0.0.11-cp311-cp311-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for acepython-0.0.11-cp311-cp311-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 9c31ac55bdee04d2705b1e2bf1d8e4780f0a41c8f86ed8f79bfa1684589f3f56
MD5 361c8e0ee973722b3ae8d36efef0346e
BLAKE2b-256 79550754ca63c36629a725cc6a8e16ad0587aeaa486ab84895882b32c19db3a0

See more details on using hashes here.

File details

Details for the file acepython-0.0.11-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for acepython-0.0.11-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 51b62f0cb335797631fc0f831ee0d4c58b98a36f1cf18c7bfa8374ace4004c8a
MD5 493d9c596d2dc75c32c24c7a74f21b2f
BLAKE2b-256 0ae80c506868ae509cc20c305a8ef09e75614bc2cb39a32990c5171f224d0879

See more details on using hashes here.

File details

Details for the file acepython-0.0.11-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for acepython-0.0.11-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 be5696d291a544ca199b7bafcf925891747353e2632c989fbaff249282ce6f7d
MD5 7c450ee3e816dcc6ff7920bb3533f0c2
BLAKE2b-256 963932e3dbe5834d31f7da0929634006de64e630dab46034eba44c506a1801d6

See more details on using hashes here.

File details

Details for the file acepython-0.0.11-cp310-cp310-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for acepython-0.0.11-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 887df92ec73324fe7fdfd8846565a7f06b250531ff5516faa46f7d09715e9b0e
MD5 edc6f5b41f0dc8d58b3eda60f972f581
BLAKE2b-256 c5d6aa9976e80cad8c30919adfe689509ed677d1b58fefa88352d35240c21f98

See more details on using hashes here.

File details

Details for the file acepython-0.0.11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for acepython-0.0.11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f8b12a7c24e3f67d8cab0c8573c301e0612e26fb5dd2ed22f228781a02883ca0
MD5 f79d1b5c5a6dc2679248b2dadcf07a05
BLAKE2b-256 e9bcd99b0a84742fe2eb70424fa474528d793403208a5bbdcabaf68003ff8bfe

See more details on using hashes here.

File details

Details for the file acepython-0.0.11-cp310-cp310-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for acepython-0.0.11-cp310-cp310-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 fa5ee40bd5c811290465ab57dfd67735986c9e37db44fbe509c339fc624c7400
MD5 0fd832883e95a0f6b8bbb2dca7052936
BLAKE2b-256 4ad02b0d531abff8229c3f5080ff3c0a8c1bf22b433518d4157ae8be6fe1c112

See more details on using hashes here.

File details

Details for the file acepython-0.0.11-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for acepython-0.0.11-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ebfe291f445a7cc7751dcb35519b77986afe507ac11dbdcac80640f6dea1ee5e
MD5 262b8aea1f1b92eb6f2ab77b4476669c
BLAKE2b-256 d1f412d60fb1e011e21ccc5762eb8d9e7600122a3c49ff29790ee7131be140ad

See more details on using hashes here.

File details

Details for the file acepython-0.0.11-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: acepython-0.0.11-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 435.3 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for acepython-0.0.11-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 1131d1380e6be7bc00ee507e26d7396817ff3bdf3d2e2bbdf2bd00530515f5ac
MD5 b3d1a233b7394d90508866148bf5cb30
BLAKE2b-256 3961160494f278a11af9209b0ee6b28c05dafc6a88682bdc1724d0a1ba0ffa37

See more details on using hashes here.

File details

Details for the file acepython-0.0.11-cp39-cp39-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for acepython-0.0.11-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 462fadbcf77e02f8c91c5aa654771fa70346fc774ec7e4a0653e0153be3a57dd
MD5 90d634676b888e384f8c54ff52eb54dd
BLAKE2b-256 45c93a4f1144c6ee7c4d907a3d45643e3c6899347706ba368d604e682fa1f46d

See more details on using hashes here.

File details

Details for the file acepython-0.0.11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for acepython-0.0.11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e2012ed1ab8a78b70f009ad47326481b5668e28ee00e068cdc48eb026d3c4101
MD5 de448d84553b61eae9b6a20b3ff72548
BLAKE2b-256 8c3435b90118cd217fe7246a6d4894de5650942298d83568a1d3182423599600

See more details on using hashes here.

File details

Details for the file acepython-0.0.11-cp39-cp39-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for acepython-0.0.11-cp39-cp39-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 1c6ddaf6475f029dd1bb845ff356cf08e1eb27eac31190afe16d67248e955fb7
MD5 4693d7d75c533ac59e99a5b5180fc781
BLAKE2b-256 cde6218774f8a41e8f64707c7bf615d062857134b690b8026376c1c774e917f9

See more details on using hashes here.

File details

Details for the file acepython-0.0.11-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for acepython-0.0.11-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 83cfa6a45ffe086ea0c735aadbc224c4b8bfe3c73492c771f9073bee9e31e1b2
MD5 59dff9aa37e8ade2c4b410ee3e1b5aed
BLAKE2b-256 24b2827002f14e6dce25312624749ad3af6fa4361377844889884cd71b9e3f6d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page