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

Uploaded Source

Built Distributions

acepython-0.0.13-cp312-cp312-win_amd64.whl (436.0 kB view details)

Uploaded CPython 3.12 Windows x86-64

acepython-0.0.13-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.13-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.13-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.13-cp311-cp311-win_amd64.whl (435.8 kB view details)

Uploaded CPython 3.11 Windows x86-64

acepython-0.0.13-cp311-cp311-musllinux_1_1_x86_64.whl (767.7 kB view details)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

acepython-0.0.13-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.13-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.13-cp310-cp310-win_amd64.whl (435.8 kB view details)

Uploaded CPython 3.10 Windows x86-64

acepython-0.0.13-cp310-cp310-musllinux_1_1_x86_64.whl (767.7 kB view details)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

acepython-0.0.13-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.13-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.13-cp39-cp39-win_amd64.whl (435.8 kB view details)

Uploaded CPython 3.9 Windows x86-64

acepython-0.0.13-cp39-cp39-musllinux_1_1_x86_64.whl (767.7 kB view details)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

acepython-0.0.13-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.13-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.13.tar.gz.

File metadata

  • Download URL: acepython-0.0.13.tar.gz
  • Upload date:
  • Size: 80.0 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.13.tar.gz
Algorithm Hash digest
SHA256 add9ce3774a6afe0abc25c6956ec1e0a61f9413759a30913b9ede503be98abb9
MD5 5ed13a861c75917ef37394f472d0c8c4
BLAKE2b-256 df1d5087bd5b098bcb65f5bedf6151be3d9c2a77807d25cb0a375078e22db9ed

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.13-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7e7db08bf3d10248a7ba361d2dad19e00a567042f2f5c415c55b56e6b31239a5
MD5 f07d26f403f09b40c69dfec46e67b960
BLAKE2b-256 344b95f38b9dbb425e20e510105cfa5c8338db22ba824c3a0965078a54cb3df4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.13-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 646772a54a4091fdd88db00f1f0c9480f5372331864439d1dac366f963ca6a5e
MD5 ff1cc8d768eddf0def86ac15ed3d922d
BLAKE2b-256 d14e0477f7618613cefb110c1b7521c3f11ce86bd8909d4baa5396109c99ceb8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.13-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8c3e170066937aac5fff76c2bc1cc847da43273dd0a09387712d5389e81b8bb4
MD5 d4fa8d2562803302121f30722f4bfed8
BLAKE2b-256 be5d8b134f569b795fa421e214099985fb86cede55b05a6c2285ecc1e41a331a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.13-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 3556e7c6d2f3d8802502fcda4b2ac66e5a5e5528c7c15137e6d355c3dd6e0488
MD5 2a86fcf4a150f08a4ef02a6e91a3256b
BLAKE2b-256 7a18d319aae1c00923daa8b417b7fc520d7a21b120365b148ceb9d37f55e5e5d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.13-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 0f5b5a01a35e639313f529fe1d2b56bac8d4332a3827eab7fe5a285a28e1d22e
MD5 b5aa5cf37cefa9c1a8855916531987c7
BLAKE2b-256 13378bef5df942d9dffb5f84f7500297fe593c58b8567ba0ca6695f71bba422a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.13-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 4af2aa11f489c276e7dc79ac9d08b70cfcd27f02e5f80a947ee7aaad42fb986f
MD5 0dcd407fc2f5f5688aee319d84fd91d7
BLAKE2b-256 c5bc84a03afe5d609071ba543691c4ef95decb520c19076aabc8b47b1624c18c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.13-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fa172db71dd8c7979618e4f9cf4384e383978f8701bf6ed33ff6d94560d227ec
MD5 0ebbdb4ece2c36c23fe336018826ff46
BLAKE2b-256 4b44cc599a11001f1d797d25401db4ee0928def181a8c0b6ebf4a61244f20596

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.13-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 673d69e2b86ec387bb781897833d1d64bf5914627686ca59ac70744502737679
MD5 08a3de16015cc131e86b1e35a5efae91
BLAKE2b-256 9f7580f43538b70d61e54f1cfd28de3279b6471d5db913f17d71d71892eed527

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.13-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 a569cba04266ee4b43b55516f78c7f9e41fda7daf90d492b195bd653166602f3
MD5 1d77af78e6634917311c24a37e03cb8f
BLAKE2b-256 bd7a7738b3557927d29b6d2aed19e223ee2e0849b06ce35de46b3dffd77f1c92

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.13-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 1d8818e1d27a573e2d0fb377d7c4e6a6fb688791fdcfb079e21ba81c0f452de6
MD5 228efc49c7fdfc9c6aa305f6c5583299
BLAKE2b-256 a44ab1470fd03f8f8b770ce6bebb16a38d66bf8509c65617a07ba2948c837449

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.13-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fe0127b6b3366b123fe67e8e93af084e0cd79728f15f724ba5a690e3e8204b85
MD5 149a8b52e9b67b7e2904cc517c882690
BLAKE2b-256 17f3ea6e4e9158ec69f1584f70b4cfe8fabbaa32663f65c2715c9c46d287eb2f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.13-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 7a9769b17d928529917bae5e733592acef4cc149f2ea959b165ca95796e34a33
MD5 23aa1f5f899c972d5b26917f1916cfab
BLAKE2b-256 61c99660b3d3b948f0b00499291377629e59832436b0b777326054722ef4efd4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.13-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 e44bda11c95b0110e291928aae86f1d7068d8e368aee3a8197da6f3b8701c618
MD5 05f7bc85c1ae78f9a1394fa0a4b42314
BLAKE2b-256 5a7ee86004bf93b0ac7cf5b92f21917ac0fe839d9edb99b26e0f02eb4d0191fe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.13-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 a544bd3c88fd300c4a053f612e9ca13ad3b3f3cc44cac0c2c13d1f81ee74e1c5
MD5 4d79793f0fa2d8c3d8b6bab2b423d756
BLAKE2b-256 fd232773401e14cb3ee9c89397372852fad1267bcab7230cd3e1d0038ebb3b41

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.13-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7b5f5c49da11f9d158049b8936706826161cc4e56d522c37646fd054c49afdb6
MD5 abfb21b9ad50b3febb977a06729fa59b
BLAKE2b-256 fe857929b8e892b46e7b1dd313bf0b0d64bcf98b5daf4f44fabdb7c97c56bea2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.13-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6a1bff75a7da3a447da2ea4d2a282ba18e9bf4aa1a02655fdc19434ce8938c46
MD5 e78a3fd191637941a5f82a3e965e2090
BLAKE2b-256 18a26151e33d1fda34d77ec95f4c88cf3821d7f2b25a0856ef9f002fcfb633d5

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