pytmosph3r.observations.transmission
Module Contents
- compute_optical_depth_mie(P, T, rays_lengths, cross_section, mie_abs_coeff, opacity_indices, rays_list, n_rays, n_intersection, tau)[source]
Computes tau, the optical depth.
- compute_optical_depth(P, T, rays_lengths, cross_section, opacity_indices, rays_list, n_rays, n_intersection, tau)[source]
Computes tau, the optical depth.
- class Transmission(rays=None, store_transmittance=None, identical=None, memory_aware=None, per_angle=True)[source]
Bases:
pytmosph3r.log.Logger
The transmission module computes the transit depth \((R_P/R_S)^2\) given a set of
rays
crossing the atmosphere.The transmission module has several parameters:
- Parameters:
rays (
Rays
or dict) – Defining the grid (n_radial, n_angular) of light rays that cross the atmosphere.store_transmittance (bool) – Stores transmittance in output.
identical (bool) – Activates the search for identical cells for which to compute the opacities only once. (Should be used when there is a lot of homogeneous data in the model).
memory_aware (bool) – Try to stay under a memory fixed threshold (experimental).
per_angle (bool) – Compute the transit depth per angle in the grid of rays, to be able to free the memory of the optical depths of the rays of that angle once they’re done. Defaults to True.
- property opacity
- property atmosphere
- store_transmittance
Stores transmittance in output.
- identical
Computes only once the opacity for cells with identical physical properties (True by default). You can use this to your advantage when an atmosphere has multiple cells with the same properties. If your atmosphere is completely heterogeneous however, consider removing this option (searching for identical cells is a waste of time).
- memory_aware
Divide the computation of opacities to fit into memory.
- per_angle
Divide the computation along azimuthal angles of the rays grid.
- wn_contribution
Pointer to function to use for contribution by wns (by default computes integral, but can be set to compute transmittance by setting it to wn_to_transmittance).
- dim
For internal use only. Determines on which dimension the optical depth is computed (radial/angular dimension(s)). (0,1) will iterate over both.
- shape
For internal use only. Shape of the transmittance (without the spectral dimension).
- size
For internal use only. Length of cross-sections).
- build(model)[source]
Builds an atmospheric grid based on altitude coordinates. See
AltitudeAtmosphere
.
- prepare_opacities(*args, **kwargs)[source]
Prepares opacities list that need to be computed by exo_k. Cells with the same physical properties are grouped together to compute their opacity only once. Timed function. Use
_prepare_opacities()
if time is not needed.
- compute_integral(*args, **kwargs)[source]
Computes integral by iterating over opacities given by
prepate_opacities()
and ifmemory_aware
, usewn_chunks()
to subdivide the work along the spectral axis. Timed function. Usecompute_contribution()
if time is not needed.
- compute_contribution(opacities, wn_chunks=None)[source]
Computes integral by iterating over
opacities
given byprepate_opacities()
forwn_chunks
spectral ranges if specified, else ifmemory_aware
, subdivide the spectral axis usingwn_chunks()
.- Parameters:
opacities (tuple) – Tuple containing a list of data points for which we compute the absorption, formed like this: ((P,T,X), A, X, C), where P is the pressure, T the temperature, X the VMR, A the aerosols reff densities (see
PrepareAerosols
), and C the coordinates (z,lat,lon) of the point. The first tuple (P,T,X) should be unique, and is stored slightly differently in theidentical
case (hence the separation/redundancy), but that could be changed in future developments.
- wn_chunks(nb_xsec)[source]
Subdivides the work along the spectral axis. Useful when cross sections + transmittance are too large to fit into memory.
- Parameters:
nb_xsec (int) – Size of the cross-sections array (opacities) to compute.
- grid_to_transmittance(bounds=None)[source]
Computes transmittance for rays between bounds.
- Parameters:
bounds (tuple) – Must be ((r_s,r_e), (a_s,a_e)), where r_s and r_e are the radial start and end points, and a_s and a_e the angular ones.