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

Uploaded Source

Built Distributions

acepython-0.0.14-cp312-cp312-win_amd64.whl (436.1 kB view details)

Uploaded CPython 3.12 Windows x86-64

acepython-0.0.14-cp312-cp312-musllinux_1_1_x86_64.whl (768.0 kB view details)

Uploaded CPython 3.12 musllinux: musl 1.1+ x86-64

acepython-0.0.14-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.14-cp312-cp312-macosx_10_9_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.12 macOS 10.9+ x86-64

acepython-0.0.14-cp311-cp311-win_amd64.whl (435.8 kB view details)

Uploaded CPython 3.11 Windows x86-64

acepython-0.0.14-cp311-cp311-musllinux_1_1_x86_64.whl (767.8 kB view details)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

acepython-0.0.14-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.14-cp311-cp311-macosx_10_9_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

acepython-0.0.14-cp310-cp310-win_amd64.whl (435.8 kB view details)

Uploaded CPython 3.10 Windows x86-64

acepython-0.0.14-cp310-cp310-musllinux_1_1_x86_64.whl (767.8 kB view details)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

acepython-0.0.14-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.14-cp310-cp310-macosx_10_9_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

acepython-0.0.14-cp39-cp39-win_amd64.whl (435.8 kB view details)

Uploaded CPython 3.9 Windows x86-64

acepython-0.0.14-cp39-cp39-musllinux_1_1_x86_64.whl (767.8 kB view details)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

acepython-0.0.14-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.14-cp39-cp39-macosx_10_9_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

File details

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

File metadata

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

File hashes

Hashes for acepython-0.0.14.tar.gz
Algorithm Hash digest
SHA256 08af0226aace7b23e5c7969dea629ec70b10ba3706162724214e87d4b433b528
MD5 78b3d6f857d969a031eac7c2508360d6
BLAKE2b-256 1ff0cf365d6b379532a11b6fa067cdfeea770dbaaf53d73b6e8a0a53ad9eb63c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.14-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 97700809354e8b38c8d477c1f964059cd66257e2d1a31a693cc8b86e07da747b
MD5 1728efa00680acfd340307e23b93f4d0
BLAKE2b-256 37fef3ca542fdf277ad60084e97431a469e919db86d9e7db48c7ca1155ab6d05

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.14-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 f9ad46f2e991cb90d2205b227182647c4c838dac1a071cf43af8af7c6265a9cf
MD5 e7e7338ebd7f43c0954ef0007d72d8bc
BLAKE2b-256 af14bf85b24c42fc468b51cbeedf2527ab57b12a537f5a0a32a612020b2a3e02

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.14-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1dd30d4790aa2126449ddc2d27558e8070127c7b02da46b35ed84af0662787c3
MD5 5e711a820a3e62248c5554016ecbb10d
BLAKE2b-256 2944647aafa7859c32623ccf135932b23899f242784f26c151b30eaf42915297

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.14-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 fbf602b1b5517bd4114a642cbabd356cbaefa3770ec076ab0dcbb6db10f52431
MD5 d745de4b353992f6e07f82b7f0d34ea9
BLAKE2b-256 8a6c76d809c5c8189013d56aec73fb8b1dc982876c399aea2509eda7eb1e7a70

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.14-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 792d538347eff26f0c89853c6b91c1a249b655ae5c6d4fe34a943159da1cbc5c
MD5 76c26f535e41636ce70c0f2230d0b773
BLAKE2b-256 12b1da9b59ec80723fdf393c1795550bfbdc22d5e43207ff40ccaf9a9a0847b3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.14-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 5f993b27f6a995f1f2e93ab71381d41d819e8668ff3c414a5090ad1ae7454f94
MD5 2626fe5de5c8d3c544a22acd69fc1d9f
BLAKE2b-256 2257ed1dbd48f21c283f08b0d30579e35c5d92aed5fe63ffba53fd028dd263a9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.14-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6b2c07e816a57698dc12bae38a9761aaa9baecc9a57485e54d1176bc3c8a084d
MD5 982c3198395af24a4f17f6b1127bb379
BLAKE2b-256 ff22190cba1b69900b19b8f5405b918f598c543fd2928c07f17d677ae4eef1e8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.14-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c2f44c01923a3c0c96c1a011f525a9a09ddc03669e171833cd3c255df37b11f8
MD5 748808d707682b19b0f2116e00b951b5
BLAKE2b-256 ab7ae2cce3f3692931ef71ec8c034bd5596358e5ab4b0b58d412f1da204305af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.14-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c7f2bbbeceedb2d334c5b9eb42c03c3e1aac64fbeeba5f076c94b343b528c80a
MD5 7e7de5983ca63687d22ad9e2b7e991bc
BLAKE2b-256 3be7e70c77c1d438e64e51b44c0fe0ee5358cc9267215e3b789e3c27ee2e53fb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.14-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 ab6712b56d98cad7c546730bf91efcac816a1e2183d83f1f6fa78cbf49848041
MD5 2339d4fc2a584116b0038dca6f1ac750
BLAKE2b-256 d3db6551342c294ed6e8d86d00225554aafd39df77e897c0197abb5c71c42c05

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.14-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2a00bc447d0e107ffaed084acf2d5b8e5dce69c8a40e249692651db827f83259
MD5 2640c27e5416ff5cfd7b84926bb12731
BLAKE2b-256 2f1d9771dd937cf073ae79ce0ec4a7e6a070b5dad0d185c57e9b8fb70ce06c79

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.14-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e865f89bbc465a7fd4c4d15e7516314e3fc975b15e782ec4a5eb552fed46b1d9
MD5 2b0f225c26f99d14546daf9646fef8c9
BLAKE2b-256 22a12ca831f093ed368bfa514fda9a28aa04ecc043f8e0077f4579459a44a9d0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.14-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 47c2ab4fd080a85aefb48ab579cc21daaeac74d4e6c6ea0e01f879d1ae0511bd
MD5 93d7df867c59b378a89a2749ab3f4b58
BLAKE2b-256 e507c5f9db33709b1e12e7bf9d233496189c83983551d7c5284d95bf42ea4bf5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.14-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 757ab5da7b55ed2eb249d1a3d3ca60d62608106d2cb469d915b6d178a2d4ffc7
MD5 1e6deeadac32cccea931fc8143c6dfba
BLAKE2b-256 12233d8909b437a6ec42a86f11a618b2aa48c103636126f3fc2889ff0a719399

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.14-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f5a885ac6a9aaf1abc03e5786d309815a9af290e06148d940922a29bdcec4698
MD5 1809d839e6555b1a609245b3e3991bfa
BLAKE2b-256 33ac0060117192436402a7a1776758405f999ed4c18e587533fd418c15c3d315

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.14-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 389d1701d7c7e4b2c4ac21c56c96bd23ebc28544db83fc0d81ca17b3645328be
MD5 bd416521f8285a02a1ec1dff37fe03ab
BLAKE2b-256 8d315cfc22da1a4e192ccd415a11d86111667134c1071e4830e632b97e209527

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