pytmosph3r.opacity

Module Contents

class Opacity(rayleigh: bool = False, cia: List[str] | None = None, wn_range: Tuple[float, float] | None = None, k_data=None, doppler=None)[source]

Bases: pytmosph3r.log.Logger, exo_k.util.spectral_object.Spectral_object

This module is the (main) link between pytmosph3r and exo_k. It will load the gas databases (load_gas_database()), and compute the opacities (compute()) of a list of cells of the atmosphere (using their physical properties: P, T, etc).

The parameters of the Opacity module are:

Parameters:
  • rayleigh (bool, optional) – Activates Rayleigh. Defaults to None.

  • cia (list, optional) – List of molecules for which to compute Collision Induced Absorption. Defaults to None. Example: ['H2','He'].

  • wn_range (tuple, optional) – Range (wn_min, wn_max) of wave numbers to select for the computations. Defaults to None.

  • k_data (exo_k.Kdatabase, optional) – Exo_k object containing the gas database (especially useful if you will run multiple models, with the same data). Defaults to None.

  • cia_data (exo_k.Kdatabase, optional) – Exo_k object containing the CIA database (especially useful if you will run multiple models, with the same data). Defaults to None.

rayleigh = False

Activate Rayleigh (by default, it is deactivated).

doppler = None

Activate Doppler (by default, it is deactivated). Dictionary containing ‘Kp’ and ‘phi’ values. TODO

wn_range: Tuple[float, float] | None = None
cia = None

List of molecules to look for when computing CIA pairs.

k_data: exo_k.Kdatabase | None = None
classmethod fromQuantity(rayleigh: bool = False, cia: List | None = None, w_range: List | None = None)[source]

Create an Opacity object using astropy quantity for wn_range.

Parameters:
  • rayleigh (bool)

  • cia (List[str])

  • w_range (List[Quantity]) – Range of quantity to determine (wn_min, wn_max) ie wn_range

Returns:

Opacity

load_gas_database(model)[source]

Loading exo_k gas/CIA/aerosols databases, and potentially clip the spectral range.

compute(log_p, temperature, gas_vmr, aer_reff_densities, winds, coords, wn_range)[source]

Compute the opacities for a list of cells of the atmosphere.

Parameters:
  • log_p (ndarray) – Log10(pressure) of each cell

  • temperature (ndarray) – Temperature of each cell

  • gas_vmr (ndarray) – gas dictionary ({gas_name: VMR}) of each cell

  • aer_reff_densities (ndarray) – Aerosol data of each cell (see PrepareAerosols)

  • winds (ndarray) – Winds (u,v,w) of each cell

  • coords (ndarray) – Coordinates (z,lat,lon) of each cell

  • wn_range (ndarray) – Wavenumber range to consider

property wns
property wnedges
outputs()[source]