Python Wrapper for GGchem chemical scheme
Project description
TauREx-GGchem plugin
A Python wrapper built using the TauREx is available. The wrapper also installs all available datafiles included with GGchem
Installation
You can install one of the prebuilt binary wheels for Windows, macOS and manylinux through pip:
pip install taurex_ggchem
Installing from source
To install from source a valid C/C++ and FORTRAN compiler must be present. You can compile it by doing:
git clone https://github.com/ucl-exoplanets/GGchem.git
cd GGchem
pip install .
Running in TauREx
Once installed you can select the chemical model through the chemistry_type keyword under Chemistry.
[Chemistry]
chemistry_type = ggchem
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
equilibrium_condensation = 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:
Argument | Description | Type | Default | Required |
---|---|---|---|---|
dispol_files | Path to thermochemical data | list of strings | Built-in (BarklemCollet,StockKitzmann_withoutTsuji, WoitkeRefit ) | |
abundance_profile | Initial abundance profile. Either solar, meteor, ocean or earth | string | 'solar' | |
selected_elements | List of elements to include | list of string | All elements in GGchem | |
ratio_elements | List of elements to set the ratio | list of string | ||
ratios_to_O | ratio of each 'ratio_element' relative to oxygen | array | ||
he_h_ratio | He/H ratio | float | 0.083 | |
metallicity | Metallicity relative to initial abundance | float | 1.0 | |
include_charge | Include ions | bool | False | |
equilibrium_condensation | Include condenstation | bool | False | |
dustchem_file | Dust chemistry file | string | Built-in (DustChem.dat) | |
Tfast | Lowest temperature (K) to use faster method | float | 1000 | |
new_back_it | integer | 6 | ||
new_back_fac | float | 1e5 | ||
new_pre_method | integer | 2 | ||
new_full_it | bool | False | ||
new_fast_level | integer | 1 |
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 |
---|---|
C_O_ratio | C/O ratio |
N_O_ratio | N/O ratio |
Na_O_ratio | Na/O ratio |
Mg_O_ratio | Mg/O ratio |
Si_O_ratio | Si/O ratio |
Fe_O_ratio | Fe/O ratio |
Al_O_ratio | Al/O ratio |
Ca_O_ratio | Ca/O ratio |
Ti_O_ratio | Ti/O ratio |
S_O_ratio | S/O ratio |
Cl_O_ratio | Cl/O ratio |
K_O_ratio | K/O ratio |
Li_O_ratio | Li/O ratio |
F_O_ratio | F/O ratio |
P_O_ratio | P/O ratio |
V_O_ratio | V/O ratio |
Cr_O_ratio | Cr/O ratio |
Mn_O_ratio | Mn/O ratio |
Ni_O_ratio | Ni/O ratio |
Zr_O_ratio | Zr/O ratio |
W_O_ratio | W/O ratio |
Running in Python
You can import the chemistry scheme in Python pretty easily
>>> from taurex_ggchem import GGChem
>>> gg = GGChem(metallicity=1.0,
selected_elements=['H','He','C','O','N','K'],
abundance_profile='earthcrust',
equilibrium_condensation=True)
You can either pass it into a TauREx forward model like so:
>>> tm = TransmissionModel(chemistry=gg)
Or use it independently to compute volume mixing ratios for gas-phase and condensates by passing in temperature and pressure ( Pascal ) arrays:
>>> nlayers = 100
>>> T = numpy.linspace(400,1000,nlayers)
>>> P = numpy.logspace(1,5, nlayers)
>>> gg.initialize_chemistry(nlayers=nlayers, temperature_profile=T, pressure_profile=P)
>>> gg.gases
['H', 'He', 'C', 'O', 'N',..., 'N3', 'O3', 'C3H']
>>> gg.mixProfile
array([[4.75989782e-04, 4.93144149e-04, 5.10561665e-04, ...,
2.89575385e-05, 2.47386006e-05, 2.10241059e-05],
...,
[2.49670621e-16, 1.44224904e-16, 8.29805526e-17, ...,
9.48249338e-42, 4.75884162e-42, 2.37999459e-42]])
>>> gg.condensates
['C[s]', 'H2O[s]', 'H2O[l]', 'NH3[s]', 'CH4[s]', 'CO[s]', 'CO2[s]']
>>> gg.condensateMixProfile
array([[0.00000000e+00, 0.00000000e+00, 0.00000000e+00,...,
0.00000000e+00, 0.00000000e+00],
[0.00000000e+00, 0.00000000e+00, 0.00000000e+00, ...,
0.00000000e+00, 9.82922802e-10, 1.88551848e-10, 2.88471985e-11,
4.40651877e-12, 6.95597887e-13],
...,
[0.00000000e+00, 0.00000000e+00, 0.00000000e+00, ...,
0.00000000e+00, 0.00000000e+00]])
Bibliography
If you use the plugin please cite the relevant articles. TauREx will output it at program end. You can get the citation from Python like so:
from taurex import __citations__
print(__citations__)
print(gg.nice_citation())
Which gives:
TauREx III: A fast, dynamic and extendable framework for retrievals
Al-Refaie, Ahmed F., Changeat, Quentin, Waldmann, Ingo P., Tinetti, Giovanna
arXiv, 1912.07759, 2019
Equilibrium chemistry down to 100 K - Impact of silicates and phyllosilicates on the carbon to oxygen ratio
Woitke, P., Helling, Ch., Hunter, G. H., Millard, J. D., Turner, G. E., Worters, M., Blecic, J., Stock, J. W.
A&A, 614, A1, 2018
You can also generate bibtex from the input file like so:
taurex -i myinput.par --bibtex mybib.bib
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 Distributions
Built Distributions
Hashes for taurex_ggchem-1.0.0.dev0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50a493f50730190faaba49eb447671a3b3409fbf4b6402ae3af51c3af5847ba0 |
|
MD5 | d242ba3b060a73f48bebef8bdacbd87f |
|
BLAKE2b-256 | b5fa79a04472955d531bf80cd3d5039a72b6d013693cad4e5737b034dc638a3c |
Hashes for taurex_ggchem-1.0.0.dev0-cp39-cp39-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c78f3bb649169e8eba45fb6aa57adcc104c3b3c613eab669bfd145fd8171309 |
|
MD5 | 7753f5649c85a72aaf33c73306ca6bf4 |
|
BLAKE2b-256 | 5c64c508eff73858d3f244058ed36e29c18cf3c0ac97e687d1dec2018f7401e1 |
Hashes for taurex_ggchem-1.0.0.dev0-cp39-cp39-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49df2d601977396b2e47f3431baf21983c499b3ed4938f455d02bed6100c605d |
|
MD5 | c0438d99ec34a68c37186ac8e8b5aede |
|
BLAKE2b-256 | 2340db36f8e8313bb49cbc775f79e52448584611781b20a87fa9fb02c389b66a |
Hashes for taurex_ggchem-1.0.0.dev0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98c378e3c253a42bbe1c4d6f00ead572c2afbe5fe9b84d85a8000472f28e49ed |
|
MD5 | 7cf7484435afc77b180ea4609142e277 |
|
BLAKE2b-256 | 3e39863db1679c19902ae159388143a0dac1055571775ccc99c1cc92da7f2399 |
Hashes for taurex_ggchem-1.0.0.dev0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7a7bae8418bcd28d727f5fa34ea9a3eb8c0c66a1505e74bfe4feac0a8c11760 |
|
MD5 | 8b686ef2717a996067e287e2e6e8d6b6 |
|
BLAKE2b-256 | e2731fe2b2d118e9206fbde667891dfd46b2022eb001507a0f7e316ced24c56f |
Hashes for taurex_ggchem-1.0.0.dev0-cp38-cp38-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e1cc4597ed32b2c8c54605c550b03b4d85a5ece395689fa82a7cb9696130869 |
|
MD5 | 73800231ea7c86550c2c3723af0e6b49 |
|
BLAKE2b-256 | 28f0c8b761259926cb0c51d284d289f811a109abd4d627574cb4d9a81925cf36 |
Hashes for taurex_ggchem-1.0.0.dev0-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 813a2dcd156193691e6f24d421447b5b80a68ee828258b27b7cc20b02c1fb44c |
|
MD5 | 9e94833141f47efe3d65d6545b1a3950 |
|
BLAKE2b-256 | 667beabc6acc37f36a1790fb43aa05aac6ca5c1e41bf936c5046d3d39e1c9c18 |
Hashes for taurex_ggchem-1.0.0.dev0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 778b4c7ccf19b13fe59066d8d6a283128805fda65f90f7935507a0ba4e37ebf7 |
|
MD5 | 32b9a0849607464e47dba96bdc58db19 |
|
BLAKE2b-256 | 8657851e7306cdd59d3ac377f3591997f7e3e36e222429b41787007479482fc9 |
Hashes for taurex_ggchem-1.0.0.dev0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f54ab4f78041bb5c3af87dc69f71f9ec3264b96d028299a7c7445057a1304479 |
|
MD5 | 12058fe8eea6fff8dd82ef520fd894eb |
|
BLAKE2b-256 | 8559ae3ee1fb8a39051c9e69983e0429413ad491cca47b1ebaafc5eddb11594a |
Hashes for taurex_ggchem-1.0.0.dev0-cp37-cp37m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d711c7bbfa97ba2170d7151532e8e8c3de48be2dc248e3defd593b431eb58838 |
|
MD5 | 802292e2a9157f255965d9b77cb93679 |
|
BLAKE2b-256 | 0b848b65dab6a4dee8133665f826cbfa0c558732e5d5b58eadf7e3abb851e160 |
Hashes for taurex_ggchem-1.0.0.dev0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f83dd3e4ec89b4bf36744a384e85f1d2686d8390f8fbce18a05b2ed0a53ac87 |
|
MD5 | 17bbf800cf8a4c0b215b3d583a11a9ff |
|
BLAKE2b-256 | e86f1bde32fd56eb3645d8aeec1548a970122ba6030e309a63306973a7b4fd33 |
Hashes for taurex_ggchem-1.0.0.dev0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d17842f81ae310f4fe101e6bc292013c24d788b8a591ac9889243726372c54a |
|
MD5 | 12cea768a295948daa1cbdc84181bdeb |
|
BLAKE2b-256 | 88afd1891020010d8b644fb678b686874d52deacbd15e6f2cce2de255c957b09 |
Hashes for taurex_ggchem-1.0.0.dev0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e23743edcdac541d201cd6a841be7ae5da51656517f92579b88d97d5cb2df92f |
|
MD5 | 38bacb066ef85fad98e7cc9cecc3b1b8 |
|
BLAKE2b-256 | d6663fc519684dc1ce233248ec97be3fd01f89d94adc60cab3b4dabf47e2139d |
Hashes for taurex_ggchem-1.0.0.dev0-cp36-cp36m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b73c50c792708fcc9b42daac4809d7d6588c7918d4d7a56c8bc2f7a2e9f2cb96 |
|
MD5 | 304d5c76dfc37a2ebf961bdd9047073f |
|
BLAKE2b-256 | 6c293c556481051d1e72f6957bcd7457b74539f8106cfa479a788e36c3065bbe |
Hashes for taurex_ggchem-1.0.0.dev0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b554862dcd1bbacdbb6399b9bf3f92ce7e1fb981a76b0a7ad466f1319e6159ee |
|
MD5 | fdb22b71fe33b4ac6da25512f86d0d26 |
|
BLAKE2b-256 | 48450b7a35726af8dc3a6ce9d8637593fa47a66ee3ad69bbb675bff54bf65c97 |
Hashes for taurex_ggchem-1.0.0.dev0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26696d894a3631007c42f367380f56fef6c4e3c68fc9cef52b98fb2fcc333511 |
|
MD5 | 825a5837ec42d639076aeea6a56417f6 |
|
BLAKE2b-256 | 8b15b98afcbeb8c3991dbc23668cd547569c11130ce41cad99c16811c912189c |