radis.io.exomol module

Created on Sun May 22 18:11:23 2022

@author: erwan

fetch_exomol(molecule, database=None, local_databases=None, databank_name='EXOMOL-{molecule}', isotope='1', load_wavenum_min=None, load_wavenum_max=None, columns=None, cache=True, verbose=True, clean_cache_files=True, return_local_path=False, return_partition_function=False, engine='default', output='pandas', skip_optional_data=True)[source]

Stream ExoMol file from EXOMOL website. Unzip and build a HDF5 file directly.

Returns a Pandas DataFrame containing all lines.

Parameters:
  • molecule (str) – ExoMol molecule

  • database (str) – database name. Ex: POKAZATEL or BT2 for H2O. See KNOWN_EXOMOL_DATABASE_NAMES. If None and there is only one database available, use it.

  • local_databases (str) – where to create the RADIS HDF5 files. Default "~/.radisdb/exomol". Can be changed in radis.config["DEFAULT_DOWNLOAD_PATH"] or in ~/radis.json config file

  • databank_name (str) – name of the databank in RADIS Configuration file Default "EXOMOL-{molecule}"

  • isotope (str or int) – load only certain isotopes, sorted by terrestrial abundances : '1', '2', etc. Default 1.

    Note

    In RADIS, isotope abundance is included in the line intensity calculation. However, the terrestrial abundances used may not be relevant to non-terrestrial applications. By default, the abundance is given reading HITRAN data. If the molecule does not exist in the HITRAN database, the abundance is read from the radis/radis_default.json configuration file, which can be modified by editing radis.config after import or directly by editing the user ~/radis.json user configuration file (overwrites radis_default.json). In the radis/radis_default.json file, values were calculated with a simple model based on the terrestrial isotopic abundance of each element.

  • load_wavenum_min, load_wavenum_max (float (cm-1)) – load only specific wavenumbers.

  • columns (list of str) – list of columns to load. If None, returns all columns in the file.

Other Parameters:
  • cache (bool, or 'regen' or 'force') – if True, use existing HDF5 file. If False or 'regen', rebuild it. If 'force', crash if not cache file found. Default True.

  • verbose (bool)

  • clean_cache_files (bool) – if True clean downloaded cache files after HDF5 are created.

  • return_local_path (bool) – if True, also returns the path of the local database file.

  • return_partition_function (bool) – if True, also returns a PartFuncExoMol object.

  • engine (‘vaex’, ‘feather’) – which memory-mapping library to use. If ‘default’ use the value from ~/radis.json

  • output (‘pandas’, ‘vaex’, ‘jax’) – format of the output DataFrame. If 'jax', returns a dictionary of jax arrays. If 'vaex', output is a vaex.dataframe.DataFrameLocal

    Note

    Vaex DataFrames are memory-mapped. They do not take any space in RAM and are extremely useful to deal with the largest databases.

  • 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:

Returns:

  • df (pd.DataFrame or vaex.dataframe.DataFrameLocal) – Line list A HDF5 file is also created in local_databases and referenced in the RADIS config file with name databank_name

  • local_path (str) – path of local database file if return_local_path

Examples

Compare CO cross-sections from HITRAN, HITEMP, GEISA, and ExoMol

Compare CO cross-sections from HITRAN, HITEMP, GEISA, and ExoMol

Calculate a spectrum from ExoMol

Calculate a spectrum from ExoMol

Notes

if using load_only_wavenum_above/below or isotope, the whole database is anyway downloaded and uncompressed to local_databases fast access .HDF5 files (which will take a long time on first call). Only the expected wavenumber range & isotopes are returned. The .HFD5 parsing uses hdf2df()

References