:py:mod:`exo_k.rayleigh` ======================== .. py:module:: exo_k.rayleigh .. autoapi-nested-parse:: @author: jeremy leconte Class for Rayleigh opacties. Module Contents --------------- .. py:class:: Rayleigh Bases: :py:obj:`exo_k.util.singleton.Singleton` Class to compute Rayleigh opacities .. py:method:: init(*args, **kwds) Initializes various parameters for Rayleigh computations .. py:method:: sigma(wns, vmr) Computes the Rayleigh cross section for the gas. This one is faster than sigma_array, but can be used only when vmr values are constants. :param wns: array of wavenumbers :type wns: :class:`array`, :class:`np.ndarray` :param vmr: Keys are molecule names. Values are the volume mixing ratios. For speedup, only the first value will be used because we assume that the vmr arrays are constant :type vmr: :class:`dict` of :class:`arrays` :returns: array of shape (wns.size) Rayleigh cross section for the whole gas in m^2/molecule .. py:method:: sigma_array(wns, vmr) Computes the Rayleigh cross section for the gas. :param wns: array of wavenumbers :type wns: :class:`array`, :class:`np.ndarray` :param vmr: Keys are molecule names. Values are arrays the volume mixing ratios :type vmr: :class:`dict` of :class:`arrays` :returns: array of shape (vmr.values.size, wns.size) Rayleigh cross section for the whole gas in m^2/molecule .. py:method:: sigma_mol(mol, wn2, wn4) Intermediary function to compute rayleigh for each molecule. :param mol: Molecule name. :type mol: :class:`str` :param wn2: Array of the wavenumber (in cm^-1) to the 2nd and 4th power. (To avoid recomputing it each time). :type wn2: :class:`array`, :class:`np.ndarrays` :param wn4: Array of the wavenumber (in cm^-1) to the 2nd and 4th power. (To avoid recomputing it each time). :type wn4: :class:`array`, :class:`np.ndarrays` :returns: to_add: bool Says whether the molecule has been found and the contribution needs to be added. tmp: array, np.ndarray of size self.wns or None The cross section for the molecule as a function of wns. None if the molecule has not been found.