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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.12 Windows x86-64

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

Uploaded CPython 3.12 macOS 12.0+ ARM64

acepython-0.0.9-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.9-cp311-cp311-win_amd64.whl (435.2 kB view details)

Uploaded CPython 3.11 Windows x86-64

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

Uploaded CPython 3.11 macOS 12.0+ ARM64

acepython-0.0.9-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.9-cp310-cp310-win_amd64.whl (435.2 kB view details)

Uploaded CPython 3.10 Windows x86-64

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

Uploaded CPython 3.10 macOS 12.0+ ARM64

acepython-0.0.9-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.9-cp39-cp39-win_amd64.whl (435.2 kB view details)

Uploaded CPython 3.9 Windows x86-64

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

Uploaded CPython 3.9 macOS 12.0+ ARM64

acepython-0.0.9-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.9.tar.gz.

File metadata

  • Download URL: acepython-0.0.9.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.9.tar.gz
Algorithm Hash digest
SHA256 43e1dd96016824217252309f25d1d29bac3389d1bace416af373a89da6aa54bd
MD5 72cd7c6b96561daed5467bab73d00a3b
BLAKE2b-256 5bf43d7f6c6c7a1a16cf1c2c1bf41e7d25a865641876a286e167e895e50c96b6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.9-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c69ace0c2bc261ddc4519503478432a69bf3871490dd2be3c0a839691987e4e6
MD5 30c3d93804edae4b1c4e12a52c9417e6
BLAKE2b-256 5aaf80e5a27fab848b89ef8f6327140a6ba3d5cedb06d784fb8ec83f7eb31bc9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.9-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 b114e6f0c6d58e3323da7a44bdbb6c3245f9932c4a127f215f9f1c6b245fc837
MD5 bf143f672cc13124af289a73e4cbdf5d
BLAKE2b-256 7d85b08c073afdd557f82de7229ddc78cb75a73150a24b5c030319fc4e5917c8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.9-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 67a075f3abd9517a57fd494074da519923a6afe65bcbee24999b26f71f941ddb
MD5 3ddc55d63eeda8ed1477ea96cc47d298
BLAKE2b-256 6bdc6045e873501ff96cc34fd577dc48c47d69ee3a4d51edcc1645679866eed4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.9-cp312-cp312-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 f87d5e8f972ecd86f27edc2d3d39ef3571e3d36e7545bbf60d1c7c088c8869e8
MD5 3ce51f7bd59e02730493798e47e5d558
BLAKE2b-256 85d087ae5376f7cd098fa563db6e4dacd16205016026bb4c51b6c807a5e65827

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.9-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 dedcc10b0fba1a63811f88da60f222cf6e3c8522868a2a548fab57b30863ba93
MD5 c88069ca78045e5d1e2c9bcfb177c444
BLAKE2b-256 1bd1241a65c650b9b414e46ba5414eb9a28e162a15613c1517a38025c228843d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.9-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 0ee3ef9117996eafdd48f62e62119e681e25289b24c5dac1ae6a9ca9e5beb348
MD5 76786d0c580deacdc4e656a7d5e6505c
BLAKE2b-256 994c98a555565bbdf0b0cf8facabcb6d083f3e580887e95ba0e87f8f048939c7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.9-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 565077b581462ad4c565eb71a51eeaa379a7188fad4bf18ce8ffbb93a159825e
MD5 b7d62326ffe0925fa1476a6b3ba5fb3e
BLAKE2b-256 8e9d445536ff34f716b086a7f1416176688efabd668f9d82640e0d2eecbf87d6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bc5f0ae380e67b451645bcacc7da362f77a3b7cc184d1f9300074a108ecf6370
MD5 33f2ac4092d22206d6a0a0982818d2fc
BLAKE2b-256 62e0210c87f140f49c0af623bcf38e8f1141039a1de426d87ec92cf2463454dc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.9-cp311-cp311-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 eda609eef6fcb4d9425365e4e6ead5bdd6279fd4a412db6c820236892c819489
MD5 df47a3bc515801f9b1dc64bc069a0269
BLAKE2b-256 300c91b3a1de04eb085e0ad463168e5a9d0f2b7bc8abba86fabbb66c541f5c75

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.9-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 617bbb6067ca58df3b38540605f880d111dac44ba8656f59d5a39603ae8e1701
MD5 54e87de47332c1ad7445c3442309b0d8
BLAKE2b-256 2edf008c4933e5b98075028e70e77448f5437aa4c811f9d61ce72b0f7cff1953

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.9-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 e8fc31130f0f7ffbce99b929921ae758222afc29987a27c8b9ae138ed7809db5
MD5 65cec74cd9bf08cd21212ea9f99a2d72
BLAKE2b-256 ea65e2261a8c99310aed052f0f0d2b64182de10d26babe3aa2a6ab4fe8bc4354

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.9-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 c7801aa456d82fe84c088bdb18125ffb96c4dbce59701c61bd08960ef228d686
MD5 9e0bc0d0be51413271a613a452d75298
BLAKE2b-256 32239b0b38627b61cb595013295785e63872f8ca092e2fddb72efff41e54c96f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 47007a1b39291dee82343f7cb00142111f6b4cfc1f9e79b2cf68e50ee7f659fc
MD5 70768e852ae90d27dcd15a3df31359ad
BLAKE2b-256 3f97bd6ad2e8a94d7ab6b446f00d98e5df5279c05744836c04737f91db7fab19

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.9-cp310-cp310-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 fc170ac6167606f65909551696ee88009387a667eebdc1ebfada470613201ce3
MD5 2f7fd0ebb6b41392ab40feff9b6b3d00
BLAKE2b-256 50838999590a03ca715d2dee36addd661f415c091ad3f5efc3da869ad547818a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.9-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 60f7590908e40c0e489ab6d23582cbf57d2768c9bb723e44bf492ec73fe2edd8
MD5 8947db32c23cb623a85bbd08a635e9fd
BLAKE2b-256 867c27b544b68a921816d1ab14dae554b01702874fb3a04be2302b0f6c6cebf3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: acepython-0.0.9-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 435.2 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.9-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 c0e7d578eae943ac7d51ce1bf88028a2016c4d6581c95c100f8b51c783b3e189
MD5 e8eee55fc14dbe2fcaf55575c1b21be9
BLAKE2b-256 de70b2b7c3d9ef1973a2438f6c43100c7b109bf4b03b8b4a86574002dee59bd3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.9-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 4e4e20d85857740666621073d8fe5f4ac5edc8a69cc7c12726d81d8606b58b24
MD5 c6ecc9ad90b988f3655b544987b81e53
BLAKE2b-256 774bc0b8a9935f66f89ab5fd891ab02210618140c076b82a8345bb9413903af4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.9-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 589c8cafeab190ab16d2f5dc77da3b937016b11504744b512376fb866efa8f53
MD5 af7b0e50531d855ba4defa45fe48c4d4
BLAKE2b-256 b38afa33fde15ad3fba254c38828eaea5dffe128f4035d38dc5806cd3fc9dd7c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.9-cp39-cp39-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 901a22459316672ed952e78ddbb3ac603cb42e26726eddc8527daf9a3b2476d3
MD5 9a5909b08ac231aacfc88b98fda75a79
BLAKE2b-256 cefcc2abc1247a4b679bb649f06e08cab8ae4a9d41f54d31b4cf9b10fee8f4e9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.9-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e09387c958209319c1fd1ecf5718be33f56072ae25549a8c249e5928d12074eb
MD5 ba236631f4d2f305d69ff3ebc1539893
BLAKE2b-256 83b570091165501f897c0f885b9d7092a140f045f195ea6fc345b64ada4d2eb1

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