exo_k.ciadatabase

@author: jeremy leconte

Module containing a class to handle a database of CIA tables to compute opacities with it.

Module Contents

class CIAdatabase(*str_filters, filenames=None, molecule_pairs=None, molecules=None, remove_zeros=True, **kwargs)[source]

Bases: exo_k.util.spectral_object.Spectral_object

Class to group Cia_table objects and combine them in radiative transfer

Initializes cia tables and supporting data. The files to load can be specified either using (in order of precedence) a list of filenames, molecule pairs, or molecules. See below for details.

Any number of filters (strings) can be provided to refine the search to files whose names contain the filters.

Parameters
  • filenames (list, optional) – List of names (not full path) of the input cia files. The files must be in the global search path.

  • molecule_pairs (list of size 2 lists, optional) – List of the molecule pairs we want to consider, specified as an array with two strings (like [‘H2’,’H2’] or [‘N2’,’H2O’]). The order of the molecules in the pair is irrelevant.

  • molecules (list of strings, optional) – A list of all the molecules we want to consider. Exo_k will look for all the possible pairs for which a cia file is found.

The default path searched is set with exo_k.settings.Settings.set_cia_search_path() or add_cia_search_path(). A local search path can be specified with the search_path keyword.

See the options of Cia_table __init__ method.

add_cia_tables(self, *cia_tables)[source]

Adds new Cia_table objects to a CIA database (inplace).

Parameters

cia_tables (Cia_table) – As many cia tables as you want.

copy(self)[source]

Creates a new instance of CIAdatabase object and (deep) copies data into it

sample(self, wngrid, remove_zeros=False, use_grid_filter=False)[source]

Samples all the cia_table in the database on the same wavenumber grid to be able to use them in radiative transfer modules (inplace).

Parameters

wngrid (array) – new wavenumber grid (cm-1)

See also

See :func:`exo_k.cia_table.Cia_table.sample for further details on options.

convert_to_mks(self)[source]

Converts units of all Cia_tables to MKS (inplace).

cia_cross_section(self, logP_array, T_array, gas_comp, wngrid_limit=None)[source]

Computes the absorption coefficient in m^-1 for the whole mix specified (assumes data in MKS).

Parameters
  • logP_array (array) –

  • T_array (array) – log10 Pressure (Pa) and temperature profiles

  • gas_comp (Gas_mix object) – behaves like a dict with mol names as keys and vmr as values.

  • wngrid_limit (array, optional) – Smaller and bigger wavenumbers inside which to perform the calculation.

Returns

The cia effective cross section coefficient profile for the whole gas (in m^2).

Return type

array