:mod:`pytmosph3r.transmission` ============================== .. py:module:: pytmosph3r.transmission Module Contents --------------- .. function:: compute_optical_depth_mie(P, T, rays_lengths, cross_section, mie_abs_coeff, opacity_indices, rays_list, n_rays, n_intersection, tau) Computes tau, the optical depth. .. function:: compute_optical_depth(P, T, rays_lengths, cross_section, opacity_indices, rays_list, n_rays, n_intersection, tau) Computes tau, the optical depth. .. py:class:: Transmission(rays=None, store_transmittance=None, identical=None, memory_aware=None, per_angle=True) Bases: :class:`pytmosph3r.log.Logger` The transmission module computes the transit depth :math:`(R_P/R_S)^2` given a set of :attr:`rays` crossing the atmosphere. :param rays: Defining the grid (`n_radial`, `n_angular`) of light rays that cross the atmosphere. :type rays: :class:`~pytmosph3r.rays.Rays` or dict :param store_transmittance: Stores transmittance in output. :type store_transmittance: bool :param identical: 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). :type identical: bool :param memory_aware: Try to stay under a memory fixed threshold (experimental). :type memory_aware: bool :param per_angle: 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. :type per_angle: bool .. attribute:: store_transmittance Stores transmittance in output. .. attribute:: 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). .. attribute:: memory_aware Divide the computation of opacities to fit into memory. .. attribute:: per_angle Divide the computation along azimuthal angles of the rays grid. .. attribute:: 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). .. attribute:: dim For internal use only. Determines on which dimension the optical depth is computed (radial/angular dimension(s)). (0,1) will iterate over both. .. attribute:: shape For internal use only. Shape of the transmittance (without the spectral dimension). .. attribute:: size For internal use only. Length of cross-sections). .. attribute:: rays Light rays characteristics. See :class:`~pytmosph3r.rays.Rays`. .. method:: default_values(self) .. method:: build(self, model) Builds an atmospheric grid based on altitude coordinates. See :class:`~pytmosph3r.atmosphere.AltitudeAtmosphere`. .. method:: opacity(self) .. method:: atmosphere(self) .. method:: prepare_opacities(self, *args, **kwargs) 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 :func:`_prepare_opacities` if time is not needed. .. method:: compute_integral(self, *args, **kwargs) Computes integral by iterating over opacities given by :func:`prepate_opacities` and if :attr:`memory_aware`, use :func:`wn_chunks` to subdivide the work along the spectral axis. Timed function. Use :func:`compute_contribution` if time is not needed. .. method:: compute_contribution(self, opacities) Computes integral by iterating over opacities given by :func:`prepate_opacities` and if :attr:`memory_aware`, use :func:`wn_chunks` to subdivide the work along the spectral axis. .. method:: wn_chunks(self, xsec_size) Subdivides the work along the spectral axis. Useful when cross sections + transmittance are too large to fit into memory. :param xsec_size: Size of the cross-sections array (opacities) to compute. :type xsec_size: int .. method:: wn_to_integral(self, *args, **kwargs) .. method:: wn_to_transmittance(self, indices, log_p, temperature, gas_vmr, aer_reff_densities, wn_range) .. method:: transmittance_to_integral(self, transmittance) .. method:: compute_optical_depth(self) Computes tau, the optical depth. .. method:: angle_to_integral(self) .. method:: grid_to_transmittance(self, bounds=None) Computes transmittance for rays between bounds. :param bounds: 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. :type bounds: tuple .. method:: compute(self, model) Sums all optical depths and computes the transit depth (ratio of visible radius of the planet on the radius of the star to the square :math:`(R_P/R_S)^2`). :returns: Spectrum :math:`(R_P/R_S)^2` :rtype: Spectrum (exo_k object) .. method:: inputs(self) .. method:: outputs(self)