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.21.tar.gz (80.4 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.21-cp313-cp313-win_amd64.whl (436.3 kB view details)

Uploaded CPython 3.13Windows x86-64

acepython-0.0.21-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

acepython-0.0.21-cp313-cp313-macosx_12_0_arm64.whl (811.6 kB view details)

Uploaded CPython 3.13macOS 12.0+ ARM64

acepython-0.0.21-cp313-cp313-macosx_10_14_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.13macOS 10.14+ x86-64

acepython-0.0.21-cp312-cp312-win_amd64.whl (436.3 kB view details)

Uploaded CPython 3.12Windows x86-64

acepython-0.0.21-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.21-cp312-cp312-macosx_12_0_arm64.whl (811.6 kB view details)

Uploaded CPython 3.12macOS 12.0+ ARM64

acepython-0.0.21-cp312-cp312-macosx_10_14_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.12macOS 10.14+ x86-64

acepython-0.0.21-cp311-cp311-win_amd64.whl (436.1 kB view details)

Uploaded CPython 3.11Windows x86-64

acepython-0.0.21-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.21-cp311-cp311-macosx_12_0_arm64.whl (811.4 kB view details)

Uploaded CPython 3.11macOS 12.0+ ARM64

acepython-0.0.21-cp311-cp311-macosx_10_14_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.11macOS 10.14+ x86-64

acepython-0.0.21-cp310-cp310-win_amd64.whl (436.1 kB view details)

Uploaded CPython 3.10Windows x86-64

acepython-0.0.21-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.21-cp310-cp310-macosx_12_0_arm64.whl (811.4 kB view details)

Uploaded CPython 3.10macOS 12.0+ ARM64

acepython-0.0.21-cp310-cp310-macosx_10_14_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.10macOS 10.14+ x86-64

File details

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

File metadata

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

File hashes

Hashes for acepython-0.0.21.tar.gz
Algorithm Hash digest
SHA256 4651d7289d221261f54ab84b01417e62d69c984fd57235887200d7e05bb0c5fe
MD5 7eb6f9935c20dbc9bd2ba011a0058f15
BLAKE2b-256 79f7dca88d2f05e5c5f44343559863ee0408024467488bd36e3cc0f335109ec7

See more details on using hashes here.

File details

Details for the file acepython-0.0.21-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: acepython-0.0.21-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 436.3 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for acepython-0.0.21-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 3a06562590a55881106f54f192e36e4c65c23e3ae4831505c4331a0cbf37e9e3
MD5 26deccb8586c20b67621112e20b5bdd1
BLAKE2b-256 777295bbb93674a5ede7b3985093876694fa5eff9b6847464eca3ee36a705b3c

See more details on using hashes here.

File details

Details for the file acepython-0.0.21-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for acepython-0.0.21-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7345a9b47fbc5e141c9d3955ee8bc02caceec1d980899533441144b9fc0aba5c
MD5 2e7f097732e93a80cf4ae08c75217dc2
BLAKE2b-256 22dceb77d19c5fcb5985ee2f327add52c137f850f4200ee437f27eade7546cf0

See more details on using hashes here.

File details

Details for the file acepython-0.0.21-cp313-cp313-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for acepython-0.0.21-cp313-cp313-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 b42596c041728a4c1fb7c204d77a5023d59dbd2b8a2b2ec8d5337f5e2dbd8125
MD5 c408ad4931317597a682fcd2859f8bff
BLAKE2b-256 79169f6e07b7413372ce22d3f532e47346cd8328b1028d4d80ef212a1b12c7df

See more details on using hashes here.

File details

Details for the file acepython-0.0.21-cp313-cp313-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for acepython-0.0.21-cp313-cp313-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 13ee1c3024422660d7b1fbdcb78e1746dad0c214d9d64337941fe56cab3af528
MD5 6ae711249bd939ad470a487378a29eda
BLAKE2b-256 4f90ecfaf1da185e769944eec30949f70378d040a807d3cd655f4f263ee78928

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for acepython-0.0.21-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6ad62e80035ad7fc7a7f3f937dc0716e5b92b87ae735f1f92c23f419487dcb9c
MD5 e821a54d40a3dd4ed0781d84ca155c9f
BLAKE2b-256 589b3c90c9ac983a5ed15d485981b18b43d13ce5c3d9d5468b898929da60df99

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.21-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f66baf34eb075da57e3b4adab08cdd3618b32fa43cf953ccf21cfc6b9ec8bf36
MD5 ef2b8b7843eaec0b97c7c81d9b8c3b57
BLAKE2b-256 835b10cb61ed3051c4c1338d2b72c909422cc6714f30989bc32cc3d526cfcb66

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.21-cp312-cp312-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 f259561cf1e6001b8d4caff568ac0586ef6171a0a0009d1f153243a6036c5344
MD5 c8b0dd0506df59c414ddffa878a1e836
BLAKE2b-256 eaea5d05e0e7cbac3da451666ec1e56616f0e8528142f2c5a137ae5ab2b512aa

See more details on using hashes here.

File details

Details for the file acepython-0.0.21-cp312-cp312-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for acepython-0.0.21-cp312-cp312-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 83fcdd18ef4bb2081d01d25df4165fd369ecf6709fa3bcf6e5b4094d15fc7733
MD5 730f3e0dc78e8aeb2eb370a8031235dc
BLAKE2b-256 ac707ebd13ae3a581b4ce0a7645ef738fd8c3acb9b07872f5700bc2c37de3570

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for acepython-0.0.21-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 fe2e784de8db0d01c6ef83547828e026abd164dcf6b9793fa860933a727d014c
MD5 5e294db05cb4c6302e36d9a041580228
BLAKE2b-256 ee8e8af1e36b480c6e8e0854b85db15107b6bc074b79dcddfee794705f32b973

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.21-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d74aa79a3a1d603f6fba4e098f8a4e282c6f835e9512b652d237c66c881ca6bd
MD5 72a084ed872fe78e7631017923202f53
BLAKE2b-256 1c10d6460264c950fc9227a1813c41dc15895df376eba337cc8d29b77e2d76c0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.21-cp311-cp311-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 510011e0558d78308817bee8235bd54a0c7161d4ca9018875751884662fbb1e9
MD5 87b53c48b7a759589f7382d0836d2761
BLAKE2b-256 6fef9ab039a0fe13b9002ba2056fc056668ed95c297c242f3ac0ca6612c0c5b4

See more details on using hashes here.

File details

Details for the file acepython-0.0.21-cp311-cp311-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for acepython-0.0.21-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 471ec97d22d75e54b6ce529bbe2ca944bac6a86bb84b3f811955cb10170f72a4
MD5 052604604869b99d12a9322a45296f1b
BLAKE2b-256 1aedca7f261a233987d6004e7f3323c3df8b0293c51d61274ee6f9823d2c8023

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for acepython-0.0.21-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b4920e2028c63ee8ddbf3a030037c6a4b101641e7f42874cd00f80b5cee54acb
MD5 90537fa1fb5fcebb5ce97a4f5766b71b
BLAKE2b-256 a5072aaffa2ecd18d391b57245d86f4b018c711cf1814154afd45734b64bc067

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.21-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 898626aac0befbb80826e0bf59d5600a92f8b760a4e919607162ed2904a179e1
MD5 7a3c5094a39da941fef1531c8f088a61
BLAKE2b-256 ba55d9f4545916c0132d152902d6bb8adcf23ce9d3b3a64a68f3a913606f9321

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.21-cp310-cp310-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 76f0e952532228732af45456d5e80d09f293953adb230b86833cdc7c518a1e6c
MD5 062130657be4f58e26bc8c85559bbbd0
BLAKE2b-256 824bdddd1443e9a20a620b322027cf4d4240de387452073b1a6f7cfb9656d4de

See more details on using hashes here.

File details

Details for the file acepython-0.0.21-cp310-cp310-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for acepython-0.0.21-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 eba54693d888d226330ace8238a1e24495937e629d8781f6121b52827e1b81ad
MD5 a3232a2252c4a3863008e6c3d9dcde6b
BLAKE2b-256 c82e0b4fc84ce334e425b2f8f310969705b7751fa15772602775a016bfa307cd

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