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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.12 Windows x86-64

acepython-0.0.17-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.17-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.17-cp312-cp312-macosx_12_0_arm64.whl (811.6 kB view details)

Uploaded CPython 3.12 macOS 12.0+ ARM64

acepython-0.0.17-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.17-cp311-cp311-win_amd64.whl (435.9 kB view details)

Uploaded CPython 3.11 Windows x86-64

acepython-0.0.17-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.17-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.17-cp311-cp311-macosx_12_0_arm64.whl (811.3 kB view details)

Uploaded CPython 3.11 macOS 12.0+ ARM64

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

Uploaded CPython 3.10 Windows x86-64

acepython-0.0.17-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.17-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.17-cp310-cp310-macosx_12_0_arm64.whl (811.3 kB view details)

Uploaded CPython 3.10 macOS 12.0+ ARM64

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

Uploaded CPython 3.9 Windows x86-64

acepython-0.0.17-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.17-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.17-cp39-cp39-macosx_12_0_arm64.whl (811.4 kB view details)

Uploaded CPython 3.9 macOS 12.0+ ARM64

acepython-0.0.17-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.17.tar.gz.

File metadata

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

File hashes

Hashes for acepython-0.0.17.tar.gz
Algorithm Hash digest
SHA256 8d323d2c80e1fa32faa8d454ae738b2adcdb67dc8f1bb4db4dd2bed1a3f9090a
MD5 d5bc95904adcaa6dc332cdba9d30779b
BLAKE2b-256 12f519a3f7edc992b46ed58ead08cdffdd716a74f4ad79196f9539afd056802f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.17-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 9112f4245486f600c220d95b28a039e3896ab41901ef4aa0e01de45d26621bfc
MD5 1a0ba134ec6a071d5866eb6ad41600df
BLAKE2b-256 7fd676ed63b173fd0cf28153e260feb4882a8f1369d4256d4a9483f6638818b9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.17-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 139b6d8914505c8d9aeedeb8773f48e5b7d00142c3b53cdbc37b92a31c14d776
MD5 00cf997142acc11fa4519135f4a8da0f
BLAKE2b-256 148f71b58eebe571e871835ef361fc578d70a88e7d36d4cf23fa3c54b48aef3e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.17-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 50e152bd33f720b95a76e115f561a3345e0ed810595ef6045563dc77e99aa91a
MD5 74698e7628b06a2d54fb9866596005e1
BLAKE2b-256 2983b87181c481b1408993286447194020e5361e1dc7aafe3efdd5393814d8d2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.17-cp312-cp312-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 4a1ae1b0e0f82aa56e84e4adef34a6c34dba9671a32afda65dab3a66897a83b8
MD5 485bfbc3137355aef422c1cc818efb84
BLAKE2b-256 6bc9346277c381ab40afff915c0b50710b62ed6cb5dda1efd258fc60c3a63b0f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.17-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d15b323a3c27841f03a1f34e0f72365f16c0f533afc0aa937a73f285a7825d2d
MD5 011e4206382ea7f983202c875322ea66
BLAKE2b-256 9f4461270d0507dcc4a38a2a5b930b1e6dceaf1325529cb5ba581eb283ee863d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.17-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 ef73bf06f81f068a1d3459c03c5de8277ea5384393ce7c502c8d82db140df324
MD5 7f1dbd4accf6feeb6cc8a092ecb79c8a
BLAKE2b-256 f58ec5dab719f73cedfa2675498f1320d150c40fb33104b6d11b96c2ef3ebaba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.17-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 ea86cbcfb5596b08d41a97086f6f877259d02d87910bf52f7cb6e76784e5212e
MD5 599736eb8f7f16474e1fba2884b119e9
BLAKE2b-256 cc0bef984465fa76030bd9f42b2a0c6dfb6355996bacfb28de3e29cdd8c2cb21

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.17-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 54c3f78a7ef1c44dbaeb552c07f82f649074b0a49668ef8a8c24d101680cf8e5
MD5 abfd9e94c1ab19dba1cf84d1601b16b9
BLAKE2b-256 3b56260794e1cca9f9b3fd10f626cd79727720b7f7708669cae5980cbbd2f0f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.17-cp311-cp311-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 84c84f4910fa2bd02c6928f53c95f7ec8ec7426151ea62a685e512ee77ba2c33
MD5 c8a31795eba8c0df3b52d8edecc16d6e
BLAKE2b-256 f37765a52ad0103be59364bd5459a61852e5a22b097a40218f310daa916a7f34

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.17-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 af99c13273e1a743525459ba2f81cb9dddf101528d58d3329780e94bd304da77
MD5 e5514f89891136b03159198b0bc9b141
BLAKE2b-256 e061d721d1520810e5d34f44bef3d968338c328cf8553a703505a53c2b45a8ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.17-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c3430384116aebff84ee4a131ece0c411ecbdb43b544430bb766ec1c7c51b41f
MD5 7e2a43d99a1f273cb8c280495a9eaa55
BLAKE2b-256 4c59d868620c933263f4d95b0a8e844bcd750d85854769bef50abb7f03a91b1c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.17-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 b0d7cedaa0189d55eb4150b42baafcde2e18a26fd7a08d36e04f2cadbd647fd2
MD5 bc99f83f1b00ec540959f0f7562c8637
BLAKE2b-256 d9a1b2b1fd31c6c7357f49f2a74e1e6e0c24490e61dad8ae4f7b27c44999850f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.17-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 294d108ea9ebebc853d6b0bbde41f90ef0f0efba138102eaf8ba441df19e7002
MD5 50dbf12bba72fcfb8d3a90746657a7a5
BLAKE2b-256 a9c9b099efd44f00619f901d59f72553da354bc3752d791b21cc3612bfabebea

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.17-cp310-cp310-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 7282e846070c70c325c63494df6e56d4dc636df83c488c3deb31334a795ccb19
MD5 a8fb5aa471e24ddca3bde07cf7480f89
BLAKE2b-256 3a48ab02b7a451c4404750652449a8ce8b1e7f3a52585a9a84daa8cd3a42ae19

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.17-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 0b3734496f2b9d82ee68321db42d3726b9f5bb46a82a261dfa1b032558c95bb2
MD5 cd3be0f39cbf693d06b77952b9d8d218
BLAKE2b-256 65659f44807a632972e86ffc950f9daf7982d3a714038492d98d05d38ec16841

See more details on using hashes here.

File details

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

File metadata

  • Download URL: acepython-0.0.17-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 435.8 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for acepython-0.0.17-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 de914a97d073180dfad92ab6490fb5b8eebc506ffa72977e79036c79375c30ab
MD5 c67278a4419e18f5d758d84b89839932
BLAKE2b-256 b640f2eae75333577e5121f0a203c897a06882874f758a9894dfeb8238c2f0da

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.17-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 ae67e226d25f19ccedfed0391ee0afbb3dab42cd1c0f51f5fc5ed1ae96719f64
MD5 959061fac43ca1a7f1e3537858efa90f
BLAKE2b-256 de876ecfff30944c8b15321e969195c9da871e6cba4477f8a8e33ed4de8103c2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.17-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4d7dfae79e99f3c5e883d4cc97156927b536802f585114d49eb6f6610f0ed289
MD5 60d5c019d1671b6ada92056fbe44eb45
BLAKE2b-256 76afbf09041d241a4ad7033e904ef0c8ccafdd1dd3f90d127c61f648b2514271

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.17-cp39-cp39-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 96999ea402bb6f4fab504bb8d5ae205d6ffe6a9515a7c64c7991c076813916ad
MD5 696b8a1fb0fc6fd537bf48ee5a50e73f
BLAKE2b-256 84d046dc46c5f282cb06b2f3adae061bbdefe4f9d3d5847a493024b8ce55f8e4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acepython-0.0.17-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 bc9cd6a8b4ed2276edc32ed124b29e0974419c96a07679a4a17d1f7ed4debaff
MD5 8ebfa34c7e9fd19275d73440501fb1de
BLAKE2b-256 54bfe0e2ffa200057fb73546ccc88792ea451013bdbcb653f00800b5bf974b49

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