pytmosph3r.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.- 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.
-
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
(self, model)[source]¶ Builds an atmospheric grid based on altitude coordinates. See
AltitudeAtmosphere
.
-
opacity
(self)¶
-
atmosphere
(self)¶
-
prepare_opacities
(self, *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
(self, *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
(self, opacities)[source]¶ Computes integral by iterating over opacities given by
prepate_opacities()
and ifmemory_aware
, usewn_chunks()
to subdivide the work along the spectral axis.
-
wn_chunks
(self, xsec_size)[source]¶ Subdivides the work along the spectral axis. Useful when cross sections + transmittance are too large to fit into memory.
- Parameters
xsec_size (int) – Size of the cross-sections array (opacities) to compute.
-
wn_to_transmittance
(self, indices, log_p, temperature, gas_vmr, aer_reff_densities, wn_range)[source]¶
-
grid_to_transmittance
(self, 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.