:py:mod:`exo_k.ciadatabase` =========================== .. py:module:: exo_k.ciadatabase .. autoapi-nested-parse:: @author: jeremy leconte Module containing a class to handle a database of CIA tables to compute opacities with it. Module Contents --------------- .. py:class:: CIAdatabase(*str_filters, filenames=None, molecule_pairs=None, molecules=None, remove_zeros=True, **kwargs) Bases: :py:obj:`exo_k.util.spectral_object.Spectral_object` Class to group :class:`~exo_k.cia_table.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. :param filenames: List of names (not full path) of the input cia files. The files must be in the global search path. :type filenames: :class:`list`, *optional* :param molecule_pairs: 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. :type molecule_pairs: :class:`list` of :class:`size 2 lists`, *optional* :param molecules: 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. :type molecules: :class:`list` of :class:`strings`, *optional* The default path searched is set with :func:`exo_k.settings.Settings.set_cia_search_path` or :func:`~exo_k.settings.Settings.add_cia_search_path`. A local search path can be specified with the `search_path` keyword. See the options of :class:`~exo_k.cia_table.Cia_table` __init__ method. .. py:method:: add_cia_tables(*cia_tables) Adds new :class:`~exo_k.cia_table.Cia_table` objects to a CIA database (inplace). :param cia_tables: As many cia tables as you want. :type cia_tables: :class:`~exo_k.cia_table.Cia_table` .. py:method:: copy() Creates a new instance of :class:`CIAdatabase` object and (deep) copies data into it .. py:method:: sample(wngrid, remove_zeros=False, use_grid_filter=False) Samples all the cia_table in the database on the same wavenumber grid to be able to use them in radiative transfer modules (inplace). :param wngrid: new wavenumber grid (cm-1) :type wngrid: :class:`array`, :class:`np.ndarray` .. seealso:: :obj:`See` func:`exo_k.cia_table.Cia_table.sample for further details on options. .. py:method:: convert_to_mks() Converts units of all Cia_tables to MKS (inplace). .. py:method:: cia_cross_section(logP_array, T_array, gas_comp, wngrid_limit=None, Nw=None) Computes the absorption coefficient in m^-1 for the whole mix specified (assumes data in MKS). :param logP_array: :type logP_array: :class:`array`, :class:`np.ndarray` :param T_array: log10 Pressure (Pa) and temperature profiles :type T_array: :class:`array`, :class:`np.ndarray` :param gas_comp: behaves like a dict with mol names as keys and vmr as values. :type gas_comp: :class:`~exo_k.gas_mix.Gas_mix` object :param wngrid_limit: Smaller and bigger wavenumbers inside which to perform the calculation. :type wngrid_limit: :class:`array`, :class:`np.ndarray`, *optional* :returns: array: The cia effective cross section coefficient profile for the whole gas (in m^2). :param Nw: Number of wavenumber points of the table to output for the specific case where there would not be any active cia gas and wngrid_limit would not be None. :type Nw: :class:`int` .. py:method:: cia_cross_section_grid(logP_array, T_array, gas_comp, wngrid_limit=None, Nw=None) Computes the absorption coefficient in m^-1 for the whole mix specified (assumes data in MKS). :param logP_array: :type logP_array: :class:`1d array` :param T_array: log10 Pressure (Pa) and temperature grids :type T_array: :class:`1d array` :param gas_comp: behaves like a dict with mol names as keys and vmr as values. :type gas_comp: :class:`~exo_k.gas_mix.Gas_mix` object :param wngrid_limit: Smaller and bigger wavenumbers inside which to perform the calculation. :type wngrid_limit: :class:`array`, :class:`np.ndarray`, *optional* :returns: array: The cia effective cross section coefficient profile for the whole gas (in m^2). :param Nw: Number of wavenumber points of the table to output for the specific case where there would not be any active cia gas and wngrid_limit would not be None. :type Nw: :class:`int`