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.18.tar.gz (80.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

acepython-0.0.18-cp312-cp312-win_amd64.whl (436.2 kB view details)

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

acepython-0.0.18-cp312-cp312-macosx_12_0_arm64.whl (811.6 kB view details)

Uploaded CPython 3.12macOS 12.0+ ARM64

acepython-0.0.18-cp312-cp312-macosx_10_13_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

acepython-0.0.18-cp311-cp311-win_amd64.whl (435.9 kB view details)

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

acepython-0.0.18-cp311-cp311-macosx_12_0_arm64.whl (811.4 kB view details)

Uploaded CPython 3.11macOS 12.0+ ARM64

acepython-0.0.18-cp311-cp311-macosx_10_13_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.11macOS 10.13+ x86-64

acepython-0.0.18-cp310-cp310-win_amd64.whl (435.9 kB view details)

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

acepython-0.0.18-cp310-cp310-macosx_12_0_arm64.whl (811.4 kB view details)

Uploaded CPython 3.10macOS 12.0+ ARM64

acepython-0.0.18-cp310-cp310-macosx_10_13_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.10macOS 10.13+ x86-64

acepython-0.0.18-cp39-cp39-win_amd64.whl (435.9 kB view details)

Uploaded CPython 3.9Windows x86-64

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

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

acepython-0.0.18-cp39-cp39-macosx_12_0_arm64.whl (811.4 kB view details)

Uploaded CPython 3.9macOS 12.0+ ARM64

acepython-0.0.18-cp39-cp39-macosx_10_13_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.9macOS 10.13+ x86-64

File details

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

File metadata

  • Download URL: acepython-0.0.18.tar.gz
  • Upload date:
  • Size: 80.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for acepython-0.0.18.tar.gz
Algorithm Hash digest
SHA256 85d7cfd6e300bdca78e81f034d29bcaf886693260a5b58c16ab209c190aed9f4
MD5 fe63c880aabaddb7edff7aa802724b79
BLAKE2b-256 3aa06409a50c133c40b7a8af4575cca94df8a13f028bb117cc3e9e185581542e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: acepython-0.0.18-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 436.2 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for acepython-0.0.18-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 42530e0ef26d1b344fe1fc166b9c48e2c2e839fe36031269bd833a6100b1b87c
MD5 13f6a4b7ca3e0e501efbfb3145ef5899
BLAKE2b-256 0b7f92595cafab16dcb190cd594098da977ce8cf6b0773c5608f9a27a058a7e8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.18-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5959cc44472c93fc6b3b8e634a1d68b4e89e43cc0ab18ac722a7bf19f3352848
MD5 ed4ab162c3dfb49c39960c8538f506e7
BLAKE2b-256 c3fe011c1b2d64a38fd55de2f56b0f809d032d4b8ae0bd30757c996338ce4366

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.18-cp312-cp312-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 ee2a846268190bb4977133fb1c6eba4c9ac1527bc0fd2c1b8d5e62d768abd10e
MD5 a5f4505543df01c94c2a103b2b98eaf9
BLAKE2b-256 917c834e49202e9fc134c0114acc13c4b7472ff3c77d905c44d01ea29e2f57b2

See more details on using hashes here.

File details

Details for the file acepython-0.0.18-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for acepython-0.0.18-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 b3b42570c616b88c585c3b925d50b5a0dd068d07b9359a9dcda493fabb8c89b4
MD5 3672d8611b30ff5c0a44311902cf451b
BLAKE2b-256 c5949d9e19299fd28ea0e489260b264483f549ea05bcc2eeebeba0da195d2e54

See more details on using hashes here.

File details

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

File metadata

  • Download URL: acepython-0.0.18-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 435.9 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for acepython-0.0.18-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 60152613bb569a1a478039fc4415e0da6b8e8fcb5e4165097dffc587c5386e7a
MD5 62fc5fca143b78a18c96114d57034d1b
BLAKE2b-256 03e0f0e950c0546a99372201175423e4a865cfcf7ff4b362b66ba8669d341a3e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.18-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 aed75e1f924856d84d91b68af5538630f2e61e2f8b5c132704d5178aef280a3e
MD5 cf04a1d82de27d05736acaae83d53a70
BLAKE2b-256 21ec65f828f6bd2586e2f5be724b5905e3edab6a12c2381649d90c17207efc07

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.18-cp311-cp311-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 221a0faed90a687bfe92e685ec068d5a34790bd307f40c5bff620c562bdf25c1
MD5 b3409bace4573ad5945b1bfbe61f708f
BLAKE2b-256 27f554fca04d218de9df60ada7f90ac64b5d22dc2123fc5fb1a0b53cc3601269

See more details on using hashes here.

File details

Details for the file acepython-0.0.18-cp311-cp311-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for acepython-0.0.18-cp311-cp311-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 d592723023032dfacda197e1641f65dd9e8675124856cf19b1fcac6a8e6b8abc
MD5 0a223868e0f9d692cd10d8f0e944f318
BLAKE2b-256 c48103bf307b0ab2f157a9d27cd505fc5a90b51541f8896505169abe9afbcd3f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: acepython-0.0.18-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 435.9 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for acepython-0.0.18-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 7b3a4629b23d6c99e3b6b0dc6c880facf0733edd08ae17c4deef1c78d30ce291
MD5 7e1e76d907ab3edd222ea49f9639fd8c
BLAKE2b-256 e2afb1fad86862c97e74d3c9b3d05e07c95025e7d7182b8b48fbbd156e35c5ac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.18-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 19d5ad8b8bc57fbe383cc629f9edb351bf8131b3e353fc09e9bcb00cb4c9350b
MD5 b2079d1e3194cbff39a1f584b5140a6e
BLAKE2b-256 bc84c722789080149613239606cae9b62a5dc776d24cce25c7d1758b962f2bf3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.18-cp310-cp310-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 2bece6f61ed05a614da2ebf842cd89062e78be3e7c29fa8ccc7c73a638f639a8
MD5 0910b0de1033bf70db4c0e537492a69f
BLAKE2b-256 413734d65f166525b1d61dad33acb27e7f44ea5fe2db1b92ed080db8eebfa8e6

See more details on using hashes here.

File details

Details for the file acepython-0.0.18-cp310-cp310-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for acepython-0.0.18-cp310-cp310-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 f91f9f60cf5e034d0966e6f235636afb37c9b63a9dfd53caf55904d4ec2afa8b
MD5 e8e3b4694dab218c2ebc76e8eed42646
BLAKE2b-256 006fc7290f17287b62cd60aa7887c58bc79e5b5e1354cf69c97f571bbe8d1a6a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: acepython-0.0.18-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 435.9 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for acepython-0.0.18-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 8611e0869c74f1b5f8d565523bfa2fc6c240a956ba07dd36707ddebaf10793eb
MD5 1b100e2c48aaf9626c4490b4418b4855
BLAKE2b-256 234f36f1a506a35c501afc2280aca72bbe77214bc77d7a358c24dcd36216e0a9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.18-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 639acbfed3edd2b78f2bd19b08f14eb1d2698dfd9cf8a9c1f0c6b907580622c2
MD5 770eefd73fae7891377c17dd405f4291
BLAKE2b-256 855442005a6a63d645b9bf282dd120e9c892f690ac6147b9408cd4fb164a7256

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.18-cp39-cp39-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 8ea6e0139d07e4893ee8f95e4ce2e32165ff87ab3f3e0de1f9e5aab31524fc4a
MD5 af53429ad1d1dbc3af3f17c0772ddeff
BLAKE2b-256 42cb0f9b98956b9d4136c47f27bbbcb525166a0f5139efc0976f88a8b4343cd2

See more details on using hashes here.

File details

Details for the file acepython-0.0.18-cp39-cp39-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for acepython-0.0.18-cp39-cp39-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 6e5347f95a9eb654eb0319a7abacddff32b2fa768e82c502bd7412ee4eb8fe3a
MD5 80a583d3c18cf5e9c462a607d618d6c7
BLAKE2b-256 0ba8103a707203be8095fb8a3fd81be3d37d9315b1f06de15aff710e8e95447f

See more details on using hashes here.

Supported by

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