Python Wrapper for FastChem chemical scheme
Project description
TauREx-FastChem plugin
A Python wrapper built using the TauREx is available. The wrapper also installs all available datafiles included with FastChem
Installation
You can install one of the prebuilt binary wheels for Windows, macOS and manylinux through pip:
pip install taurex_fastchem
Installing from source
To install from source a valid C/C++ compiler must be present. You can compile it by doing:
git clone https://github.com/ucl-exoplanets/FastChem.git
cd FastChem
pip install .
Running in TauREx
Once installed you can select the chemical model through the chemistry_type keyword under Chemistry.
[Chemistry]
chemistry_type = fastchem
metallicity = 1.0
selected_elements = H, He, C, N, O, Ti, V, S, K
ratio_elements = C, N, Ti
ratios_to_O = 0.5,0.001, 1e-4
with_ions = True
[Fitting]
Ti_O_ratio:fit = True
Ti_O_ratio:prior = "LogUniform(bounds=(-6,2))"
S_O_ratio:fit = True
S_O_ratio:prior = "LogUniform(bounds=(-6,2))"
metallicity:fit = True
metallicity:prior = "LogUniform(bounds=(-6,2))"
Input arguments:
These arguments apply to both the TauREx input file and python interface.
Argument | Description | Type | Default | Required |
---|---|---|---|---|
H_He_ratio | He/H ratio | float | 0.083 | |
selected_elements | List of elements to include in model | list of string | All elements in FastChem | |
ratio_elements | List of elements to set the ratio | list of string | ||
ratios_to_O | ratio of each 'ratio_element' relative to oxygen | array | ||
elements_abundance_file | Path to file that defines initial abundances (in dex) | string | Builtin (solar) | |
metallicity | Metallicity relative to initial abundance | float | 1.0 | |
elements_datafile | Path to file containing elements and their masses | string | Built-in (chemical_abundances.dat) | |
species_datafile | Path to file containing species and thermochemical data | string | Built-in (logK.dat) | |
chem_accuracy | ||||
with_ions | Include ions | bool | False | |
pressure_accuracy | ||||
newton_error | ||||
max_chem_iter | ||||
max_press_iter | ||||
max_nedler_iter | ||||
longdouble | Use 80 bit floats for faster convergence | bool | False |
Retrieval Parameters:
Fitting Parameter | Description |
---|---|
metallicity | Metallicity relative to solar |
The wrapper will generate oxygen retrieval parameters for all metallic elements within the chemical model. If Ti is present (either by default or specifing in selected_elements) then a Ti_O_ratio retrieval parameter will be available. Using the default selected_parameters will give access to:
Fitting Parameter | Description |
---|---|
Al_O_ratio | Al/O ratio |
Ar_O_ratio | Ar/O ratio |
C_O_ratio | C/O ratio |
Ca_O_ratio | Ca/O ratio |
Cl_O_ratio | Cl/O ratio |
Co_O_ratio | Co/O ratio |
Cr_O_ratio | Cr/O ratio |
Cu_O_ratio | Cu/O ratio |
F_O_ratio | F/O ratio |
Fe_O_ratio | Fe/O ratio |
Ge_O_ratio | Ge/O ratio |
K_O_ratio | K/O ratio |
Mg_O_ratio | Mg/O ratio |
Mn_O_ratio | Mn/O ratio |
N_O_ratio | N/O ratio |
Na_O_ratio | Na/O ratio |
Ne_O_ratio | Ne/O ratio |
Ni_O_ratio | Ni/O ratio |
P_O_ratio | P/O ratio |
S_O_ratio | S/O ratio |
Si_O_ratio | Si/O ratio |
Ti_O_ratio | Ti/O ratio |
V_O_ratio | V/O ratio |
Zn_O_ratio | Zn/O ratio |
Running in Python
You can import the chemistry scheme in Python pretty easily
>>> from taurex_fastchem import FastChem
>>> fc = FastChem(selected_elements=['H','He','C','O','N','K','e-'],
with_ions=True, metallicity=1.0)
You can either pass it into a TauREx forward model like so:
>>> tm = TransmissionModel(chemistry=fc)
Or use it independently to compute volume mixing ratios by passing in temperature and pressure ( Pascal ) arrays:
>>> nlayers = 10
>>> temperature = np.linspace(300,100,nlayers)
>>> pressure = np.logspace(5,-3, nlayers) # Pa
>>> fc.initialize_chemistry(nlayers,temperature,pressure)
>>> fc.gases
['H', 'He', 'O', 'C', 'K', 'N', 'e-', ..., 'O+', 'O-', 'O2+', 'O2-']
>>> fc.mixProfile
array([[3.87435866e-036, 9.95149979e-039, 7.62616463e-042,
1.23490910e-045, 2.58839801e-050, 3.41640407e-056,
9.40930967e-064, 9.08433703e-074, 1.41255491e-087,
1.38065040e-167],
...,
[1.42400626e-001, 1.42400626e-001, 1.42400626e-001,
1.42400626e-001, 1.42400626e-001, 1.42400791e-001,
1.42398731e-001, 1.42398284e-001, 1.42367067e-001,
9.96186945e-001]])
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file taurex_fastchem-1.0.0.dev0.tar.gz
.
File metadata
- Download URL: taurex_fastchem-1.0.0.dev0.tar.gz
- Upload date:
- Size: 2.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/3.10.0 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f6fffeefda17b289ec9c6625878f453b07f5f3ed915aa1eb04e7a96248f6b3c |
|
MD5 | 08d5350c6ed5af92e68843add4ab2d64 |
|
BLAKE2b-256 | cc8da492302f3cf1884d82195d877d6cc9ea388f4b52f5a5e8f9bf43f54cd5f6 |
File details
Details for the file taurex_fastchem-1.0.0.dev0-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: taurex_fastchem-1.0.0.dev0-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 168.5 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f357d93e40178950682c7404dacfa779c8b6439d1da9cebff37ddc434654d2a |
|
MD5 | 52ceb794c29ec428fee5f5ff51666c7a |
|
BLAKE2b-256 | 569d9b3f4fd7f67b66c77ec60a3d86d01db12db5578e0ec2dc56aa5775fc4268 |
File details
Details for the file taurex_fastchem-1.0.0.dev0-cp39-cp39-manylinux2010_i686.whl
.
File metadata
- Download URL: taurex_fastchem-1.0.0.dev0-cp39-cp39-manylinux2010_i686.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.9, manylinux: glibc 2.12+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31b7faf711ef9e185b2546b68ee18396377fa319d9a2785281c89dd81eb8186c |
|
MD5 | 1995eb1835852dc2e750c02192603b8d |
|
BLAKE2b-256 | 284f28d4f0793486ebd943c58cf1bcded62a96256aae236c9eda235f2099a6fb |
File details
Details for the file taurex_fastchem-1.0.0.dev0-cp39-cp39-manylinux1_x86_64.whl
.
File metadata
- Download URL: taurex_fastchem-1.0.0.dev0-cp39-cp39-manylinux1_x86_64.whl
- Upload date:
- Size: 2.4 MB
- Tags: CPython 3.9
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 694c6abef4642723f89e1b5fa49fb83b3107da93d926c4598470883c7493ddac |
|
MD5 | 9319126206ef5960d8cf49abfab7cf2b |
|
BLAKE2b-256 | d3d65359f2d7ef3dcb354a6e85bb208695eed6c7f71c4046287b562cb98f4d07 |
File details
Details for the file taurex_fastchem-1.0.0.dev0-cp39-cp39-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: taurex_fastchem-1.0.0.dev0-cp39-cp39-macosx_10_9_x86_64.whl
- Upload date:
- Size: 193.2 kB
- Tags: CPython 3.9, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e5f03bad6fcfa2ed5ae7f8162e9e59f6a2175453fc0effffce9bc8556b5ce8f |
|
MD5 | be48a1b142848bf9bce0b375a4847887 |
|
BLAKE2b-256 | f5329f348da73101e91ebc99b73a227316b097f4ea9cfc2507e19bd0bbbc00fb |
File details
Details for the file taurex_fastchem-1.0.0.dev0-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: taurex_fastchem-1.0.0.dev0-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 169.8 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e729d80053344e79d6ebd2ec535ec6c65f06c20178d3f9c3e81b436e29c1989c |
|
MD5 | b1a06bf3efac4646f46daf4370da0c63 |
|
BLAKE2b-256 | f81f227066460d8ed42c7b3ad4b3a2f439eea555fb4a7795c42347cc75984bd1 |
File details
Details for the file taurex_fastchem-1.0.0.dev0-cp38-cp38-manylinux2010_i686.whl
.
File metadata
- Download URL: taurex_fastchem-1.0.0.dev0-cp38-cp38-manylinux2010_i686.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.8, manylinux: glibc 2.12+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 059b52e70c0f47ef3656a74deade26e37db60ef3f07be3bd91d76ee52b83af55 |
|
MD5 | 6e60a2dc8d0d271f5e5a7db17aad492f |
|
BLAKE2b-256 | f85685f47e43418b7d5fc7e4067c01e41891b0f0713965275f0f502477bfa1d5 |
File details
Details for the file taurex_fastchem-1.0.0.dev0-cp38-cp38-manylinux1_x86_64.whl
.
File metadata
- Download URL: taurex_fastchem-1.0.0.dev0-cp38-cp38-manylinux1_x86_64.whl
- Upload date:
- Size: 2.4 MB
- Tags: CPython 3.8
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45bd44b3fe7fa8683e8b09bcfb19f844d424633cdc7ea4ab7bf80c1d12ed46fc |
|
MD5 | e38e1ecec3bf605248537b048988679e |
|
BLAKE2b-256 | c32bb984605a379abb15d76177644a26891023e99ddd81885e4d3e097c810b48 |
File details
Details for the file taurex_fastchem-1.0.0.dev0-cp38-cp38-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: taurex_fastchem-1.0.0.dev0-cp38-cp38-macosx_10_9_x86_64.whl
- Upload date:
- Size: 192.9 kB
- Tags: CPython 3.8, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66f013868bbff176248174f7845df7c833fc9305c4e61b1af132334069dcb959 |
|
MD5 | d0ebb935479ccd92d63ded17e0505037 |
|
BLAKE2b-256 | 68b669aacb95e0d65e912f17fc1c80b14940387d4600709152f43dc6e2a6647d |
File details
Details for the file taurex_fastchem-1.0.0.dev0-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: taurex_fastchem-1.0.0.dev0-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 168.4 kB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f85200825a23506c996ab150dd01499ee2d95d9d7b5c5ac5d71bc07793b0c80b |
|
MD5 | 8b3b5dcc587d2f8b6e902a1043682600 |
|
BLAKE2b-256 | 5dc97166f0e113a48956ba63eb2d62bf633df7fc6fc141525edebacb066c622f |
File details
Details for the file taurex_fastchem-1.0.0.dev0-cp37-cp37m-manylinux2010_i686.whl
.
File metadata
- Download URL: taurex_fastchem-1.0.0.dev0-cp37-cp37m-manylinux2010_i686.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.7m, manylinux: glibc 2.12+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3509c11b96b6922e6f8b3f29bd427957a3c3844044261581ee74f12ee8e719de |
|
MD5 | f05e8760ec1f1f165cc4d7fb033ca98b |
|
BLAKE2b-256 | 1fb73b73b3a95b17dd110c88dcf9c83f68e7a24dc4ecc3d430113c50ec2a651e |
File details
Details for the file taurex_fastchem-1.0.0.dev0-cp37-cp37m-manylinux1_x86_64.whl
.
File metadata
- Download URL: taurex_fastchem-1.0.0.dev0-cp37-cp37m-manylinux1_x86_64.whl
- Upload date:
- Size: 2.4 MB
- Tags: CPython 3.7m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9be0b1b8a7f0bb163fb58aa3cad3810b9b88129644f3d850f59c4d36d5d19465 |
|
MD5 | 724137dbbc09c58f2ed1c967f6753fc7 |
|
BLAKE2b-256 | 34427c2aba674b3af9d652d89e07c3c51b389c626dc79f9f7b17568351edb2ee |
File details
Details for the file taurex_fastchem-1.0.0.dev0-cp37-cp37m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: taurex_fastchem-1.0.0.dev0-cp37-cp37m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 192.3 kB
- Tags: CPython 3.7m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66b98f191ca4044682425799a7fb15f8ae0586551cbc272e22505d3871f949f3 |
|
MD5 | 6aca41950787cdd665648dec2b528605 |
|
BLAKE2b-256 | dde3b2572e9f7872091520828f49ffd29b3d0281213356c68d43397fdf1fb8db |
File details
Details for the file taurex_fastchem-1.0.0.dev0-cp36-cp36m-win_amd64.whl
.
File metadata
- Download URL: taurex_fastchem-1.0.0.dev0-cp36-cp36m-win_amd64.whl
- Upload date:
- Size: 168.6 kB
- Tags: CPython 3.6m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83ecf6dc2a8b0d1e61aef1164add006da8a2bb9f628c8cbf1012f3f3066160f6 |
|
MD5 | 3f2b8cf572983feb56b11afe4d9d5ec3 |
|
BLAKE2b-256 | 9864f5e65c642e89b4e8cf0c089c669bb318bf77bffb65fa7c53158491012038 |
File details
Details for the file taurex_fastchem-1.0.0.dev0-cp36-cp36m-manylinux2010_i686.whl
.
File metadata
- Download URL: taurex_fastchem-1.0.0.dev0-cp36-cp36m-manylinux2010_i686.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.6m, manylinux: glibc 2.12+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74ea30910e4f39b5d1d2bdc27b027e917d2efe4130c6c1354cbfc8007265aeda |
|
MD5 | 880ff5ca8d5ffbfb7f2d074be17f8a9f |
|
BLAKE2b-256 | 9e5ce3d11f3d230274f841a9918318d6d553031146d4e031423ddd3aef02d1ea |
File details
Details for the file taurex_fastchem-1.0.0.dev0-cp36-cp36m-manylinux1_x86_64.whl
.
File metadata
- Download URL: taurex_fastchem-1.0.0.dev0-cp36-cp36m-manylinux1_x86_64.whl
- Upload date:
- Size: 2.4 MB
- Tags: CPython 3.6m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16a95ef2674b3e48851d9b53214d2aed54b9ac15755ed15bfad463dacdd5c40e |
|
MD5 | e7d38a8bad64a05319b711dd92438f77 |
|
BLAKE2b-256 | 3fae2d65ee38273b4c9759a67759b4d1e81ebe7913322bb8fe4695b52e1ab20b |
File details
Details for the file taurex_fastchem-1.0.0.dev0-cp36-cp36m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: taurex_fastchem-1.0.0.dev0-cp36-cp36m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 192.3 kB
- Tags: CPython 3.6m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2398176921e1e9af3029a4259ce9e057330ea518590903ac4e2b877b0cb2fbbb |
|
MD5 | 7f80f12d51ead6f3709949bd249cfd3e |
|
BLAKE2b-256 | 409ce287da5a4e26981ff0dc9325971496b2e3679e409b985612b1f61e3df48c |