radis.db.utils module¶
Created on Thu May 28 14:47:36 2015.
@author: Erwan
- check_molecule_data_structure(fname, verbose=True)[source]¶
Check that
fname
has a valid JSON structure for molecular data.- Parameters:
fname (str) – molecular data JSON file
Notes
Order in the json doesnt matter, however, the order of the electronic_level_names matters: the index of all levels should match the
index
key of these states.
- getFile(*relpath)[source]¶
Converts the relative path of a database file in a the full path. Used by processing script not to worry about where the database is stored
Examples of use:
radis.db.getFile('CN','CN_Violet_vib.dat') radis.db.getFile('CN\CN_Violet_vib.dat') radis.db.getFile('CN\\CN_Violet_vib.dat')
- get_default_jsonfile(molecule)[source]¶
Return full path of default jsonfile for spectroscopic constants for a molecule.
These are stored in:
radisdb[molecule]*.json
and defined in radis/config.json
- get_dunham_coefficients(molecule, isotope, electronic_state, jsonfile='default', return_doi=False)[source]¶
Returns Dunham coefficients
Yij
formolecule
,isotope
,electronic_state
by parsing a JSON file of molecule data.Dunham coefficients are identified as starting with
Y
(i.e.alpha_e
won’t be recognized)- Parameters:
molecule (str) – molecule name
isotope (int) – isotope number
electronic_state (str) – electronic state name
jsonfile (str, or
default
) – path to json file. Ifdefault
, the default JSON file defined in radis/config.json is used. Seeget_default_jsonfile()
- Other Parameters:
return_doi (bool) – if True, returns the value of key
"#doi"
or"#DOI"
if it exists, and None if it doesn’t.- Returns:
dict (coeffs)
str (doi, if
return_doi
)
See also
- get_herzberg_coefficients(molecule, isotope, electronic_state, jsonfile='default', return_doi=False)[source]¶
Returns spectroscopic coefficients with Herzberg conventions for
molecule
,isotope
,electronic_state
by parsing a JSON file of molecule data.Herzberg coefficients are the usual:
\[\begin{split}\\omega_e, \\alpha_e, B_e, D_e, etc.\end{split}\]The extensive list of parameters considered as Herzberg coefficients is found in
herzberg_coefficients
- Parameters:
molecule (str) – molecule name
isotope (int) – isotope number
electronic_state (str) – electronic state name
jsonfile (str, or
default
) – path to json file. Ifdefault
, themolecules_data
JSON file in theradis.db
database is used. Seeget_default_jsonfile()
- Other Parameters:
return_doi (bool)
if True, returns the value of key ``”#doi”`` or ``”#DOI”`` if it exists,
and None if it doesn’t.
- Returns:
dict (coeffs)
str (doi, if
return_doi
)