Skip to main content

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}
}

Metadata

Release files for acepython 0.0.21

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for acepython 0.0.21
File Size Uploaded
acepython-0.0.21.tar.gz 80.4 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for acepython 0.0.21
File
acepython-0.0.21-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
acepython-0.0.21-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details
acepython-0.0.21-cp313-cp313-macosx_12_0_arm64.whl CPython 3.13 CPython 3.13 macOS 12.0+ ARM64 Details
acepython-0.0.21-cp313-cp313-macosx_10_14_x86_64.whl CPython 3.13 CPython 3.13 macOS 10.14+ x86-64 Details
acepython-0.0.21-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
acepython-0.0.21-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
acepython-0.0.21-cp312-cp312-macosx_12_0_arm64.whl CPython 3.12 CPython 3.12 macOS 12.0+ ARM64 Details
acepython-0.0.21-cp312-cp312-macosx_10_14_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.14+ x86-64 Details
acepython-0.0.21-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
acepython-0.0.21-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
acepython-0.0.21-cp311-cp311-macosx_12_0_arm64.whl CPython 3.11 CPython 3.11 macOS 12.0+ ARM64 Details
acepython-0.0.21-cp311-cp311-macosx_10_14_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.14+ x86-64 Details
acepython-0.0.21-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
acepython-0.0.21-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
acepython-0.0.21-cp310-cp310-macosx_12_0_arm64.whl CPython 3.10 CPython 3.10 macOS 12.0+ ARM64 Details
acepython-0.0.21-cp310-cp310-macosx_10_14_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.14+ x86-64 Details

Total release size: 18.8 MB

Release files / acepython-0.0.21.tar.gz

Download URL acepython-0.0.21.tar.gz
Size 80.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4651d7289d221261f54ab84b01417e62d69c984fd57235887200d7e05bb0c5fe
BLAKE2b-256 checksum
How to use checksums
79f7dca88d2f05e5c5f44343559863ee0408024467488bd36e3cc0f335109ec7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / acepython-0.0.21-cp313-cp313-win_amd64.whl

Download URL acepython-0.0.21-cp313-cp313-win_amd64.whl
Size 436.3 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
3a06562590a55881106f54f192e36e4c65c23e3ae4831505c4331a0cbf37e9e3
BLAKE2b-256 checksum
How to use checksums
777295bbb93674a5ede7b3985093876694fa5eff9b6847464eca3ee36a705b3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / acepython-0.0.21-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL acepython-0.0.21-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.1 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
7345a9b47fbc5e141c9d3955ee8bc02caceec1d980899533441144b9fc0aba5c
BLAKE2b-256 checksum
How to use checksums
22dceb77d19c5fcb5985ee2f327add52c137f850f4200ee437f27eade7546cf0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / acepython-0.0.21-cp313-cp313-macosx_12_0_arm64.whl

Download URL acepython-0.0.21-cp313-cp313-macosx_12_0_arm64.whl
Size 811.6 kB
Tags CPython 3.13 macOS 12.0+ ARM64
SHA-256 checksum
How to use checksums
b42596c041728a4c1fb7c204d77a5023d59dbd2b8a2b2ec8d5337f5e2dbd8125
BLAKE2b-256 checksum
How to use checksums
79169f6e07b7413372ce22d3f532e47346cd8328b1028d4d80ef212a1b12c7df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / acepython-0.0.21-cp313-cp313-macosx_10_14_x86_64.whl

Download URL acepython-0.0.21-cp313-cp313-macosx_10_14_x86_64.whl
Size 2.4 MB
Tags CPython 3.13 macOS 10.14+ x86-64
SHA-256 checksum
How to use checksums
13ee1c3024422660d7b1fbdcb78e1746dad0c214d9d64337941fe56cab3af528
BLAKE2b-256 checksum
How to use checksums
4f90ecfaf1da185e769944eec30949f70378d040a807d3cd655f4f263ee78928
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / acepython-0.0.21-cp312-cp312-win_amd64.whl

Download URL acepython-0.0.21-cp312-cp312-win_amd64.whl
Size 436.3 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
6ad62e80035ad7fc7a7f3f937dc0716e5b92b87ae735f1f92c23f419487dcb9c
BLAKE2b-256 checksum
How to use checksums
589b3c90c9ac983a5ed15d485981b18b43d13ce5c3d9d5468b898929da60df99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / acepython-0.0.21-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL acepython-0.0.21-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.1 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
f66baf34eb075da57e3b4adab08cdd3618b32fa43cf953ccf21cfc6b9ec8bf36
BLAKE2b-256 checksum
How to use checksums
835b10cb61ed3051c4c1338d2b72c909422cc6714f30989bc32cc3d526cfcb66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / acepython-0.0.21-cp312-cp312-macosx_12_0_arm64.whl

Download URL acepython-0.0.21-cp312-cp312-macosx_12_0_arm64.whl
Size 811.6 kB
Tags CPython 3.12 macOS 12.0+ ARM64
SHA-256 checksum
How to use checksums
f259561cf1e6001b8d4caff568ac0586ef6171a0a0009d1f153243a6036c5344
BLAKE2b-256 checksum
How to use checksums
eaea5d05e0e7cbac3da451666ec1e56616f0e8528142f2c5a137ae5ab2b512aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / acepython-0.0.21-cp312-cp312-macosx_10_14_x86_64.whl

Download URL acepython-0.0.21-cp312-cp312-macosx_10_14_x86_64.whl
Size 2.4 MB
Tags CPython 3.12 macOS 10.14+ x86-64
SHA-256 checksum
How to use checksums
83fcdd18ef4bb2081d01d25df4165fd369ecf6709fa3bcf6e5b4094d15fc7733
BLAKE2b-256 checksum
How to use checksums
ac707ebd13ae3a581b4ce0a7645ef738fd8c3acb9b07872f5700bc2c37de3570
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / acepython-0.0.21-cp311-cp311-win_amd64.whl

Download URL acepython-0.0.21-cp311-cp311-win_amd64.whl
Size 436.1 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
fe2e784de8db0d01c6ef83547828e026abd164dcf6b9793fa860933a727d014c
BLAKE2b-256 checksum
How to use checksums
ee8e8af1e36b480c6e8e0854b85db15107b6bc074b79dcddfee794705f32b973
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / acepython-0.0.21-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL acepython-0.0.21-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.1 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
d74aa79a3a1d603f6fba4e098f8a4e282c6f835e9512b652d237c66c881ca6bd
BLAKE2b-256 checksum
How to use checksums
1c10d6460264c950fc9227a1813c41dc15895df376eba337cc8d29b77e2d76c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / acepython-0.0.21-cp311-cp311-macosx_12_0_arm64.whl

Download URL acepython-0.0.21-cp311-cp311-macosx_12_0_arm64.whl
Size 811.4 kB
Tags CPython 3.11 macOS 12.0+ ARM64
SHA-256 checksum
How to use checksums
510011e0558d78308817bee8235bd54a0c7161d4ca9018875751884662fbb1e9
BLAKE2b-256 checksum
How to use checksums
6fef9ab039a0fe13b9002ba2056fc056668ed95c297c242f3ac0ca6612c0c5b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / acepython-0.0.21-cp311-cp311-macosx_10_14_x86_64.whl

Download URL acepython-0.0.21-cp311-cp311-macosx_10_14_x86_64.whl
Size 2.4 MB
Tags CPython 3.11 macOS 10.14+ x86-64
SHA-256 checksum
How to use checksums
471ec97d22d75e54b6ce529bbe2ca944bac6a86bb84b3f811955cb10170f72a4
BLAKE2b-256 checksum
How to use checksums
1aedca7f261a233987d6004e7f3323c3df8b0293c51d61274ee6f9823d2c8023
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / acepython-0.0.21-cp310-cp310-win_amd64.whl

Download URL acepython-0.0.21-cp310-cp310-win_amd64.whl
Size 436.1 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
b4920e2028c63ee8ddbf3a030037c6a4b101641e7f42874cd00f80b5cee54acb
BLAKE2b-256 checksum
How to use checksums
a5072aaffa2ecd18d391b57245d86f4b018c711cf1814154afd45734b64bc067
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / acepython-0.0.21-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL acepython-0.0.21-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.1 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
898626aac0befbb80826e0bf59d5600a92f8b760a4e919607162ed2904a179e1
BLAKE2b-256 checksum
How to use checksums
ba55d9f4545916c0132d152902d6bb8adcf23ce9d3b3a64a68f3a913606f9321
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / acepython-0.0.21-cp310-cp310-macosx_12_0_arm64.whl

Download URL acepython-0.0.21-cp310-cp310-macosx_12_0_arm64.whl
Size 811.4 kB
Tags CPython 3.10 macOS 12.0+ ARM64
SHA-256 checksum
How to use checksums
76f0e952532228732af45456d5e80d09f293953adb230b86833cdc7c518a1e6c
BLAKE2b-256 checksum
How to use checksums
824bdddd1443e9a20a620b322027cf4d4240de387452073b1a6f7cfb9656d4de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / acepython-0.0.21-cp310-cp310-macosx_10_14_x86_64.whl

Download URL acepython-0.0.21-cp310-cp310-macosx_10_14_x86_64.whl
Size 2.4 MB
Tags CPython 3.10 macOS 10.14+ x86-64
SHA-256 checksum
How to use checksums
eba54693d888d226330ace8238a1e24495937e629d8781f6121b52827e1b81ad
BLAKE2b-256 checksum
How to use checksums
c82e0b4fc84ce334e425b2f8f310969705b7751fa15772602775a016bfa307cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release history Release notifications | RSS feed

This release

0.0.21 This release

17 release files

0.0.12

4 release files

0.0.9

21 release files

0.0.8

17 release files

0.0.7

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page