path (str) – path for Exomol data directory/tag. For instance, “/home/CO/12C-16O/Li2015”
nurange (array) – wavenumber range list (cm-1) or wavenumber array
margin (float) – margin for nurange (cm-1)
crit (float) – line strength lower limit for extraction
bkgdatm (str) – background atmosphere for broadening. e.g. H2, He,
broadf (bool) – if False, the default broadening parameters in .def file is used
Other Parameters:
engine (str) – which memory mapping engine to use : ‘vaex’, ‘pytables’ (HDF5), ‘feather’
skip_optional_data (bool) – If False, fetch all fields which are marked as available in the ExoMol definition
file. If True, load only the first 4 columns of the states file
(“i”, “E”, “g”, “J”). The structure of the columns above 5 depend on the
the definitions file (*.def) and the Exomol version.
If skip_optional_data=False, two errors may occur:
a field is marked as present/absent in the *.def field but is
absent/present in the *.states file (ie both files are inconsistent).
The trans/states files can be very large. For the first time to read it,
we convert it to the feather or hdf5-format. After the second-time,
we use the feather/hdf5 format instead.
Examples
# Init database, download files if needed.mdb=MdbExomol(local_path,molecule=molecule,name=databank_name,local_databases=local_databases,# nurange=[load_wavenum_min, load_wavenum_max],engine="vaex",)# Get cache files to load :mgr=mdb.get_datafile_manager()local_files=[mgr.cache_file(f)forfinmdb.trans_file]# Load filesdf=mdb.load(local_files,columns=columns_exomol,lower_bound=([('nu_lines',load_wavenum_min)]ifload_wavenum_minelse[])+([("Sij0",mdb.crit)]ifnotnp.isneginf(mdb.crit)else[]),upper_bound=([('nu_lines',load_wavenum_max)]ifload_wavenum_maxelse[]),output="jax",# or "pytables", "vaex")
nu_lines (nd array): line center (cm-1)
Sij0 (nd array): line strength at T=Tref (cm)
dev_nu_lines (np array): line center in device (cm-1)
logsij0 (np array): log line strength at T=Tref
A (np array): Einstein A coefficient
elower (np array): the lower state energy (cm-1)
gpp (np array): statistical weight
jlower (np array): J_lower
jupper (np array): J_upper
n_Tref (np array): temperature exponent
alpha_ref (np array): alpha_ref (gamma0)
n_Tref_def: default temperature exponent in .def file, used for jlower not given in .broad
alpha_ref_def: default alpha_ref (gamma0) in .def file, used for jlower not given in .broad
compute j2b (code a0, map from jlower to alpha_ref)
Args:
bdat: exomol .broad data given by exomolapi.read_broad
alpha_ref_default: default value
n_Texp_default: default value
jlower_max: maximum number of jlower
Returns:
j2alpha_ref[jlower] provides alpha_ref for jlower
j2n_Texp[jlower] provides nT_exp for jlower
compute jj2b (code a1, map from (jlower, jupper) to alpha_ref and n_Texp)
Args:
bdat: exomol .broad data given by exomolapi.read_broad
j2alpha_ref_def: default value from a0
j2n_Texp_def: default value from a0
jupper_max: maximum number of jupper
Returns:
jj2alpha_ref[jlower,jupper] provides alpha_ref for (jlower, jupper)
jj2n_Texp[jlower,jupper] provides nT_exp for (jlower, jupper)
Note:
The pair of (jlower, jupper) for which broadening parameters are not given, jj2XXX contains None.
extract g_upper (gup), E_lower (elower), and J_lower and J_upper from states
DataFrame and insert them into the transition DataFrame.
Parameters:
states (states DataFrame - the i, E, g, J are in the 4 first columns)
trans (transition numpy array)
dic_def (Informations about additional quantum labels)
skip_optional_data (bool . If True fetch all quantum labels in dic_def[‘quantum_labels’] from states into transitions (_l for lower, _u for upper states))
Return type:
A, nu_lines, elower, gup, jlower, jupper, mask, **quantum_labels
Notes
We first convert pandas DataFrame to ndarray. The state counting numbers in states DataFrame is used as indices of the new array for states (newstates). We remove the state count numbers as the column of newstate, i.e. newstates[:,k] k=0: E, 1: g, 2: J. Then, we can directly use the state counting numbers as mask.
States by default has columns
# i E g J v010.0100121.448467310234.345384520348.690712730
numinf (List[float]) – limit points ([w(0),w(1),...,w(n)], n+1 elements) defining
the spectral ranges appearing in the name of *.trans.bz2 files
(["w(0)-w(1)","w(1)-w(2)",...,w(n-1)-w(n)], n elements)
numtag (List[str]) – tag for wavelength ranges.
Note – For some molecules, ExoMol provides multiple trans files. numinf and numtag are the ranges and identifiers for the multiple trans files.
dic_def (dict) – Info from def file to read extra quantum numbers
engine (str) – parsing engine to use (‘vaex’, ‘csv’)
skip_optional_data (bool) – If False, fetch all fields which are marked as available in the ExoMol definition
file. If True, load only the first 4 columns of the states file
(“i”, “E”, “g”, “J”). The structure of the columns above 5 depend on the
the definitions file (*.def) and the Exomol version.
If skip_optional_data=False, two errors may occur:
a field is marked as present/absent in the *.def field but is
absent/present in the *.states file (ie both files are inconsistent).