:py:mod:`exo_k.adatabase` ========================= .. py:module:: exo_k.adatabase .. 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:: Adatabase(*str_filters, filenames=None, remove_zeros=False, **kwargs) Bases: :py:obj:`exo_k.util.spectral_object.Spectral_object` Class to group :class:`~exo_k.atable.Atable` objects and combine them in radiative transfer Initializes aerosol tables and supporting data from a list of filenames. :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` A local search path can be specified with 'search_path=' See the options of :class:`~exo_k.atable.Atable` __init__ method. .. py:property:: names Gives the names of the aerosols in the database .. py:method:: add_atables(*atables) Adds new :class:`~exo_k.atable.Atable` objects to a Adatabase. :param atables: As many Atables as you want. :type atables: :class:`~exo_k.atable.Atable` .. py:method:: copy() Creates a new instance of :class:`CIAdatabase` object and (deep) copies data into it .. py:method:: sample(wngrid, remove_zeros=True, use_grid_filter=True, sample_all_vars=True) Samples all the Atables in the database on the same wavenumber grid to be able to use them in radiative transfer modules. .. important:: For this method, the default options are remove_zeros=True and use_grid_filter=True. This ensures that you do not count several contributinns twice when you use two different aerosol tables to represent the same aerosol type over two different spectral window (typically VI and IR) :param wngrid: new wavenumber grid (cm-1) :type wngrid: :class:`array`, :class:`np.ndarray` .. seealso:: See :func:`exo_k.atable.Atable.sample` for further details on options. .. py:method:: convert_to_mks() Converts units of all Cia_tables to MKS. .. py:method:: absorption_coefficient(aer_reffs_densities, wngrid_limit=None, log_interp=None) Computes the opacity for the whole mix specified (assumes data in MKS). .. warning:: The unit and physical meaning of the result may change depending on the quantity provided in aer_reffs_densities. See :func:`exo_k.atable.Atable.absorption_coefficient` for further details. :param aer_reffs_densities: A dictionary with aerosol names as keys and lists containing 2 floats (or arrays) as values. The values are the particle effective radii and number densities (or ratio of aerosol to gas number density). :type aer_reffs_densities: :class:`dict` :param wngrid_limit: Smaller and bigger wavenumbers inside which to perform the calculation. :type wngrid_limit: :class:`array`, :class:`np.ndarray`, *optional* :returns: The opacity profile for the aerosols. :rtype: array .. py:method:: optical_properties(aer_reffs_densities, wngrid_limit=None, log_interp=None, compute_all_opt_prop=True) Computes the optical properties for the mix of aerosols (assumes data in MKS). .. warning:: The unit and physical meaning of the result may change depending on the quantity provided in aer_reffs_densities. See :func:`exo_k.atable.Atable.absorption_coefficient` for further details. :param aer_reffs_densities: A dictionary with aerosol names as keys and lists containing 2 floats (or arrays) as values. The values are the particle effective radii and number densities (or ratio of aerosol to gas number density). :type aer_reffs_densities: :class:`dict` :param wngrid_limit: Smaller and bigger wavenumbers inside which to perform the calculation. :type wngrid_limit: :class:`array`, :class:`np.ndarray`, *optional* :returns: The optical properties profile for the aerosols (in m^2). :rtype: array