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

Uploaded Source

Built Distributions

acepython-0.0.10-cp312-cp312-win_amd64.whl (435.5 kB view details)

Uploaded CPython 3.12 Windows x86-64

acepython-0.0.10-cp312-cp312-musllinux_1_1_x86_64.whl (767.5 kB view details)

Uploaded CPython 3.12 musllinux: musl 1.1+ x86-64

acepython-0.0.10-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.10-cp312-cp312-macosx_12_0_arm64.whl (809.9 kB view details)

Uploaded CPython 3.12 macOS 12.0+ ARM64

acepython-0.0.10-cp312-cp312-macosx_10_9_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.12 macOS 10.9+ x86-64

acepython-0.0.10-cp311-cp311-win_amd64.whl (435.2 kB view details)

Uploaded CPython 3.11 Windows x86-64

acepython-0.0.10-cp311-cp311-musllinux_1_1_x86_64.whl (767.3 kB view details)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

acepython-0.0.10-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.10-cp311-cp311-macosx_12_0_arm64.whl (809.7 kB view details)

Uploaded CPython 3.11 macOS 12.0+ ARM64

acepython-0.0.10-cp311-cp311-macosx_10_9_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

acepython-0.0.10-cp310-cp310-win_amd64.whl (435.3 kB view details)

Uploaded CPython 3.10 Windows x86-64

acepython-0.0.10-cp310-cp310-musllinux_1_1_x86_64.whl (767.1 kB view details)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

acepython-0.0.10-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.10-cp310-cp310-macosx_12_0_arm64.whl (809.7 kB view details)

Uploaded CPython 3.10 macOS 12.0+ ARM64

acepython-0.0.10-cp310-cp310-macosx_10_9_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

acepython-0.0.10-cp39-cp39-win_amd64.whl (435.3 kB view details)

Uploaded CPython 3.9 Windows x86-64

acepython-0.0.10-cp39-cp39-musllinux_1_1_x86_64.whl (767.1 kB view details)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

acepython-0.0.10-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.10-cp39-cp39-macosx_12_0_arm64.whl (809.7 kB view details)

Uploaded CPython 3.9 macOS 12.0+ ARM64

acepython-0.0.10-cp39-cp39-macosx_10_9_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: acepython-0.0.10.tar.gz
  • Upload date:
  • Size: 80.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for acepython-0.0.10.tar.gz
Algorithm Hash digest
SHA256 b686f275591ce764d5c4ee3570a05e323edf80dc6abf4cd09c21a1ee92b2e921
MD5 0cf58a118b250123faffc366627311f3
BLAKE2b-256 835db05961fdb54686c71d0f03737c3ceb4178933d53b178b85e368144f69494

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.10-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c1db7e3c3459c01a3fbb8c8aa77a8ff871f12ebd8768e0b9acce8600b1c6ebed
MD5 392eda2d19eb21a80d479723fa54ad00
BLAKE2b-256 228cb9974dcc8143caf06d53d70636b4899983d67ee07b44888537b24094f041

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.10-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 5d847b3f6d82dc683ed536aaf4f4fa5f9437be8e75df307d644df076e9a68eef
MD5 59780d21891258f3ca41266a3fc38968
BLAKE2b-256 25a7f4dc2e1c335fc55754914ddcb4dddbae7711c44a23e83b8fb8134bd62d66

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.10-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0762557e1676ea039efd5a57960905501dd4e5397d0057a09e5864fca3d7b5ea
MD5 76847a87a0657d6501b21157e3d31f9f
BLAKE2b-256 1622d17932606d07c7a98f60946195bf7cbddbee781e60371af4c22ef08139d9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.10-cp312-cp312-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 f39a40a084b73c4939d7dff9e7ae0541d2238c10ec5f2ed3c33288b9327438de
MD5 bdd07477afb2e9ab6db72e4f6bab972b
BLAKE2b-256 8cf9738dd2bf9b69f4f3a34d0fde0450767f50be90266ae084b0b8075da64ccf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.10-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a39819f1fceedbfbad06aeb97307aa8fd7f532e687333b05675d00acb4f00255
MD5 0d1a4073215f6a022d163fa11147c1da
BLAKE2b-256 ef34cb791a7d2deefbebc2ae1a686ee08a6bf6c1b83c7e39fce5a4c354a54bb3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.10-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a72a742f3ee2118faaf57d9ea34d0dd7b69a39a7dbe8c0773a4be61bd792f9d4
MD5 84c88ac7a20ad8874ec9efe2020d79d2
BLAKE2b-256 ba3a1a1a43536d88bddf29cd11311fb0115ff12c2754a7cd73b0e999ff321e70

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.10-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 ce2b7e4f66be1424c4b6117224a690b17b07010ef890d68338e29657f4737469
MD5 b30ca404281d74cfa099caed3c898041
BLAKE2b-256 c2fa4953919e8401c360e02f99116d04751dfe2326875c2ecf3f0ce60b7574b0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.10-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 be9beda7a2402505ad0af5e6676a4eee5d3a54ad384f93d73fe24465c1e98a54
MD5 51733e5aeef65b04d0a07c85b3eca2fe
BLAKE2b-256 4dc12985b82ae36e671e4c3b577d2668de3f6df762774278cd09ddd15c89491f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.10-cp311-cp311-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 df6ba2e3e772acc2b6833d44e688ac5cde5674d123e41efcd0fe3769afe06307
MD5 3a1c90edfb408a75c3b12ba3c9b7c66c
BLAKE2b-256 0ffcbdd7f600abbfb10e1a3a5eea377ade19e54a7df82f827992072433867857

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.10-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 1dfd8e295938ad3ea313aece734812ec57c8881f58ce9ca50fa901c0960f4183
MD5 a36374765ae84be5c98599c6e4bc96a1
BLAKE2b-256 342d23e10f1949283a5cf1907aba9f0a2995852662fac3f9e77d9bf1c2998b86

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.10-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 d0850dfba70a93613979ad4157319cb48e4d6777150225498b90383e62ab5562
MD5 dae8caeba61614d369a321b1857287af
BLAKE2b-256 de70737a9efbf668e4016e6333e18ff022593580a3713d4fc8f2334c0d0f5841

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.10-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 d72376a222bec044c6d864ef7ca2437e5af0afd28c942fd0db91219fb071efd6
MD5 c6dc7e263a07ecf7de2a4200b156fa27
BLAKE2b-256 b4ac5ac55537b735ff9477c359085431def8d19d31f42f0425ae30a15571c60c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 14bfafcaa0a5252107d17274e18c986a80b4205de9a39a1d02174fe0c97690d9
MD5 b5097f24342372c960ca4f2bfef93ad2
BLAKE2b-256 8c9fd58df38e58c390e88106202ec4249ce1960dc2452b7d821e81077ad7e359

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.10-cp310-cp310-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 173d7b17172832b221bf39df88b5c9849bf4097614bcf4aeb6db78787c1f145e
MD5 de3cb9cfab6e4e28729553faa25498ee
BLAKE2b-256 63a8a5cbb536c18a72cf42187ab730b92458231cc57ffaa66e34f8697a443160

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.10-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 1b47e88b2d7eea4617a48c2784dd7a2cc5ed70b9bd3dca36d3f7ecd1b6d24c3a
MD5 64831f02b66c1a86022970d7e40e37f8
BLAKE2b-256 bcc1823f166fa0019ba7b7f31c49a8471c838b7c283f71d4bb3811ded7786aa0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: acepython-0.0.10-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 435.3 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for acepython-0.0.10-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 12df438437ce0cac1a4f40760a25ca524d48816b126f9971ea26ead2eecfb389
MD5 bd42358bac3b94f6d6009fb26eedb25c
BLAKE2b-256 455f6f0a21c94bb1e20a0a7ceea4d3e676e8107dc22e6f966694dc27aebe6867

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.10-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 d0e02c8845657d1b42d101d9ffb4eda29cafe0ad294f83e20243e9ff3f40c7fc
MD5 fb292bc351191f74d7c358bae280b4c3
BLAKE2b-256 fd9b0c2fb730b8ea45fa4ac372f7c6ce01abb070151b3501d9607aa8cbbb0009

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.10-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d57eacdeb3a88c71b8b6f8e605fef907ff6a5d28caba5d9e717089ee9be6156b
MD5 cf393d545d6050357e047d2d4ba0cc09
BLAKE2b-256 d2780a9a96c60ecd3b7b4860891d6fe9c6cb55b34187b03bbe6dd2f488794645

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.10-cp39-cp39-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 72f667395101dfcc6f11401da9b8adf8838124a7831d8b7771f0239bebfa3b96
MD5 1a4ea8e3bd2383ebdc90c97420037140
BLAKE2b-256 df56b43a169597c6fec41bf95c99c406272b2f11cbc63d42e44c36d20527db1c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.10-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 83ef91e586455db9798a41dab72b9a40954f94e74c2bd2715f46cc23e0f6e313
MD5 9f48d4387a380ab0a50259b36c3c5f74
BLAKE2b-256 7ec8da731fb7dd59ce1ef6d67429d2c25c0ac5013819de3d85614804df46255a

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