exo_k.rayleigh

@author: jeremy leconte

Class for Rayleigh opacties.

Module Contents

class exo_k.rayleigh.Rayleigh[source]

Bases: exo_k.util.singleton.Singleton

Class to compute Rayleigh opacities

init(*args, **kwds)[source]

Initializes various parameters for Rayleigh computations

sigma(wns, vmr, **kwargs)[source]

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.

Parameters:
  • wns (array, np.ndarray) – array of wavenumbers

  • vmr (dict of arrays) – 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

Returns:

array of shape (wns.size)

Rayleigh cross section for the whole gas in m^2/molecule

sigma_array(wns, vmr, **kwargs)[source]

Computes the Rayleigh cross section for the gas.

Parameters:
  • wns (array, np.ndarray) – array of wavenumbers

  • vmr (dict of arrays) – Keys are molecule names. Values are arrays the volume mixing ratios

Returns:

array of shape (vmr.values.size, wns.size)

Rayleigh cross section for the whole gas in m^2/molecule

sigma_mol(mol, wn2, wn4, haze_factor=None, **kwargs)[source]

Intermediary function to compute rayleigh for each molecule.

Parameters:
  • mol (str) – Molecule name.

  • wn2 (array, np.ndarrays) – Array of the wavenumber (in cm^-1) to the 2nd and 4th power. (To avoid recomputing it each time).

  • wn4 (array, np.ndarrays) – Array of the wavenumber (in cm^-1) to the 2nd and 4th power. (To avoid recomputing it each time).

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.