radis.db.molparam module¶
- class MolParams(file=None, terrestrial_abundances=True, extra_file_json='/home/docs/checkouts/readthedocs.org/user_builds/radis/envs/master/lib/python3.8/site-packages/radis/db/molparams_extra.json')[source]¶
Bases:
object
Easy access to molecular parameters taken from HITRAN
molparam.txt
.Note
Starting from Radis 0.13.1 MolParams can also read extra parameters from a .json file
- Parameters
file (str) – if None the one in RADIS is taken. See https://github.com/radis/radis/blob/master/radis/db/molparam.txt
extra_file_json (str) – if not
None
, read extra molecular parameters from a Json file, for molecules not implemented in HITRANmolparam.txt
. SeeMOLPARAMS_EXTRA_PATH
Examples
Get earth abundance of CO2, isotope 1:
from radis.db.molparam import MolParams molpar = MolParams() molpar.get(2, 1, 'abundance') # 2 for CO2, 1 for isotope 1
Get Molecular ParametersUse Custom Abundances- Add-heading
Note
Isotope number was derived manually assuming the isonames were ordered in the database The isotope name (ex: CO2 626) is kept for comparison if ever needed
References
http://hitran.org/media/molparam.txt
- get(molecule, isotope, key: ['isoname', 'abundance', 'Q_296K', 'gj', 'molar_mass', 'isotope_name', 'isotope_name_exomol'])[source]¶
Get attribute of molecule, isotope.
- Parameters
molecule (str or int) – molecule name or molecule id
iso (int) – isotope number # (sorted by terrestrial abundance)
key (
'abundance'
,'mol_mass'
,'isotope_name'
,'isotope_name_exomol'
) – parameter
Examples
Get explicit name of an isotope:
from radis.db.molparam import MolParams mp = MolParams() print(mp.get("CO2", 1, "isotope_name")) # >> (12C)(16O)2 print(mp.get("CO2", 2, "isotope_name")) # >> (13C)(16O)2
Use Custom Abundances