petitRADTRANS.radtrans
======================

.. py:module:: petitRADTRANS.radtrans

.. autoapi-nested-parse::

   Stores the Radtrans object.



Attributes
----------

.. autoapisummary::

   petitRADTRANS.radtrans._MISSING_FLOAT
   petitRADTRANS.radtrans._MISSING_NEG_INF


Classes
-------

.. autoapisummary::

   petitRADTRANS.radtrans.Radtrans


Functions
---------

.. autoapisummary::

   petitRADTRANS.radtrans._noop_opacity_fn
   petitRADTRANS.radtrans._interpolate_linear_sorted


Module Contents
---------------

.. py:data:: _MISSING_FLOAT

.. py:data:: _MISSING_NEG_INF

.. py:function:: _noop_opacity_fn(wavelengths, pressures)

   Return zero opacity matrix with shape (n_wavelengths, n_pressures).


.. py:function:: _interpolate_linear_sorted(x_grid, y_grid, x_query)

   Linearly interpolate ``y(x)`` on a sorted 1D grid for a scalar query.


.. py:class:: Radtrans(pressures: jax.typing.ArrayLike = None, wavelength_boundaries: jax.typing.ArrayLike = None, line_species: list[str] | tuple[str] = None, gas_continuum_contributors: list[str] | tuple[str] = None, rayleigh_species: list[str] | tuple[str] = None, cloud_species: list[str] | tuple[str] = None, line_opacity_mode: str = 'c-k', line_by_line_opacity_sampling: int = 1, scattering_in_emission: bool = True, emission_angle_grid: jax.typing.ArrayLike = None, anisotropic_cloud_scattering: bool = 'auto', retain_line_opacities_for_plotting: bool = False, path_input_data: str = None)

   Calculate spectra using a given set of opacities.

   Args:
       pressures (Optional):
           (bar) Array defining the pressure grid to be used for the spectral calculations.
       wavelength_boundaries (Optional):
           List containing left and right border of wavelength region to be considered, in micron. If nothing else
           is specified, it will be equal to ``[0.05, 300]``, hence using the full petitRADTRANS wavelength range
           (0.11 to 250 microns for ``'c-k'`` mode, 0.3 to 30 microns for the ``'lbl'`` mode). The larger the
           range the longer the computation time.
       line_species (Optional):
           List of strings, denoting which line absorber species to include.
       gas_continuum_contributors (Optional):
           List of strings, denoting which continuum absorber species to include.
       rayleigh_species (Optional):
           List of strings, denoting which Rayleigh scattering species to include.
       cloud_species (Optional):
           List of strings, denoting which cloud opacity species to include.
       line_opacity_mode (Optional[string]):
           If equal to ``'c-k'``: use low-resolution mode, at :math:`\\lambda/\\Delta \\lambda = 1000`, with the
           correlated-k assumption. if equal to ``'lbl'``: use high-resolution mode, at
           :math:`\\lambda/\\Delta \\lambda = 10^6`, with a line-by-line treatment.
       line_by_line_opacity_sampling (Optional[int]):
           If ``mode = 'lbl'``, then this will only load every line_by_line_opacity_sampling-nth point of the
           high-resolution opacities. This can be used to save time and RAM.
           The user should verify whether this leads to solutions which are identical to the results of the
           non down-sampled :math:`10^6` resolution.
       scattering_in_emission (Optional[bool]):
           Will be ``False`` by default.
           If ``True`` scattering will be included in the emission spectral calculations. Note that this increases
           the runtime of pRT!
       emission_angle_grid (Optional):
           Array defining the cosines of the angle grid to be used for the emission spectrum calculations,
           and their weights. The array is of shape (2, n_angles), with emission_angle_grid[0] being the cosines of
           the angles, and emission_angle_grid[1] being the weights.
           A dictionary of array with keys 'cos_angles' and 'weights' can also be used.
           If None, a default set of values and weights are used.
       anisotropic_cloud_scattering (Optional[bool, str]):
           If True, anisotropic cloud scattering opacities are used for the spectral calculations.
           If False, isotropic cloud scattering opacities are used for the spectral calculations.
           If 'auto' (recommended), anisotropic_cloud_scattering is set to True for emission spectrum
           calculations, and to False for transmission spectrum calculations.
       retain_line_opacities_for_plotting (Optional[bool]):
           If True, keep per-species unstacked line opacity tables after the
           stacked runtime layout has been built. This is intended for plotting
           and debugging only and increases memory usage.
       path_input_data (Optional[str]):
           Path to the input_data folder, containing the files to be loaded by petitRADTRANS.


   .. py:attribute:: __dat_opacity_files_warning_message
      :value: Multiline-String

      .. raw:: html

         <details><summary>Show Value</summary>

      .. code-block:: python

         """loading opacities from .dat files is discouraged, the HDF5 format offer better performances at for a lower memory usage
         
         Converting petitRADTRANS .dat opacity files into HDF5 can be done by executing:
         >>> from petitRADTRANS.opacities.file_conversion import convert_all
         >>> convert_all()
         
         Alternatively, the petitRADTRANS HDF5 files can be downloaded (see https://petitradtrans.readthedocs.io/en/latest/content/available_opacities.html)"""

      .. raw:: html

         </details>




   .. py:attribute:: __line_opacity_property_setting_warning_message
      :value: Multiline-String

      .. raw:: html

         <details><summary>Show Value</summary>

      .. code-block:: python

         """setting a Radtrans line opacity property should be avoided
         These properties are loaded from the opacity data in the input_data directory and are inter-dependent (they need to be updated for consistency)
         It is recommended to create a new Radtrans instance instead"""

      .. raw:: html

         </details>




   .. py:attribute:: __property_setting_warning_message
      :value: Multiline-String

      .. raw:: html

         <details><summary>Show Value</summary>

      .. code-block:: python

         """setting a Radtrans property directly is not recommended
         Create a new Radtrans instance (recommended) or re-do all the setup steps necessary for the modification to be taken into account"""

      .. raw:: html

         </details>




   .. py:attribute:: _frequency_grid_misalignment_tolerance
      :type:  float
      :value: 0.002



   .. py:attribute:: _pressures


   .. py:attribute:: _line_species
      :value: ()



   .. py:attribute:: _gas_continuum_contributors
      :value: ()



   .. py:attribute:: _rayleigh_species
      :value: ()



   .. py:attribute:: _cloud_species
      :value: ()



   .. py:attribute:: _line_opacity_mode
      :value: 'c-k'



   .. py:attribute:: _line_by_line_opacity_sampling
      :value: 1



   .. py:attribute:: _scattering_in_emission
      :value: True



   .. py:attribute:: _retain_line_opacities_for_plotting
      :value: False



   .. py:attribute:: _anisotropic_cloud_scattering
      :value: 'auto'



   .. py:attribute:: _sum_opacities_emission
      :type:  bool
      :value: False



   .. py:attribute:: _anisotropic_cloud_scattering_emission
      :type:  bool


   .. py:attribute:: _path_input_data
      :value: None



   .. py:attribute:: __scattering_in_transmission
      :value: False



   .. py:attribute:: __sum_opacities
      :value: False



   .. py:attribute:: __absorber_present


   .. py:attribute:: _lines_loaded_opacities


   .. py:attribute:: _cias_loaded_opacities


   .. py:attribute:: _clouds_loaded_opacities


   .. py:attribute:: _emission_angle_grid


   .. py:method:: __getattr__(name)

      Override of the object base __getattr__ method, in order to hint towards pRT3 names when pRT2 names are used.



   .. py:property:: anisotropic_cloud_scattering


   .. py:property:: cias_loaded_opacities


   .. py:property:: clouds_loaded_opacities


   .. py:property:: cloud_species


   .. py:property:: emission_angle_grid


   .. py:property:: frequencies


   .. py:property:: frequency_bins_edges


   .. py:property:: gas_continuum_contributors


   .. py:property:: line_by_line_opacity_sampling


   .. py:property:: lines_loaded_opacities


   .. py:property:: line_opacity_mode


   .. py:property:: line_species


   .. py:property:: path_input_data


   .. py:property:: pressures
      :type: jax.typing.ArrayLike



   .. py:property:: rayleigh_species


   .. py:property:: scattering_in_emission


   .. py:property:: wavelength_boundaries


   .. py:method:: _clouds_have_effect(mass_fractions, cloud_fraction)

      Check if the clouds have any effect, i.e. if the cloud species MMR is greater than 0.

      Args:
          mass_fractions: atmospheric mass mixing ratios
          cloud_fraction: cloud coverage fraction



   .. py:method:: _has_partial_coverage_background_cloud(opaque_cloud_top_pressure=None, power_law_opacity_350nm=None, power_law_opacity_coefficient=None)
      :staticmethod:


      Check whether runtime-only cloud opacities should participate in cloud_fraction mixing.



   .. py:method:: _normalize_patchy_clouds(patchy_clouds=None, complete_coverage_clouds=None)


   .. py:method:: _get_complete_coverage_cloud_species(patchy_clouds)


   .. py:method:: _get_partial_coverage_cloud_species(patchy_clouds)


   .. py:method:: _compute_additional_continuum_opacities(frequencies, pressures, additional_absorption_opacities_function, additional_scattering_opacities_function, cloud_photosphere_median_optical_depth)
      :staticmethod:



   .. py:method:: _init_spectral_function(is_emission, reference_gravity, return_clear_spectrum, mass_fractions, cloud_fraction, opaque_cloud_top_pressure, has_partial_coverage_background_cloud=False, patchy_clouds=None, complete_coverage_clouds=None)

      Initializations and checks common to calculate_flux and calculate_transit_radii.



   .. py:method:: _stack_loaded_line_opacities(temperature_pressure_grids=None, temperature_grid_sizes_map=None, pressure_grid_sizes_map=None, opacity_grids=None)


   .. py:method:: _set_unstacked_line_opacity_debug_data(temperature_pressure_grids, temperature_grid_sizes, pressure_grid_sizes, opacity_grids)


   .. py:method:: _set_sum_opacities(emission, line_opacity_mode, scattering_in_emission)
      :staticmethod:



   .. py:method:: _resolve_solver_pressures(pressures=None)


   .. py:method:: _calculate_flux(pressures, temperatures, reference_gravity, opacities, continuum_opacities_scattering, irradiation_geometry, star_irradiation_cos_angle, stellar_intensity, reflectances, emissivities, cloud_f_sed, photospheric_cloud_optical_depths, cloud_photosphere_wavelength_boundaries, cloud_anisotropic_scattering_opacities, cloud_absorption_opacities, adaptive_feautrier_iterations, return_contribution=False, return_angle_dependent_intensities=False, sum_opacities=True, chunk_feautrier=True, feautrier_chunk_size=1536)

      Compute the emission flux for the already-prepared opacity state.

      This helper converts opacities into optical depths, chooses the
      appropriate radiative-transfer solver, and optionally evaluates the
      emission contribution function.

      Args:
          reference_gravity:
              Reference gravity in cgs units used in the optical-depth
              calculation.
          opacities:
              Total absorption opacity array prepared by
              ``_calculate_opacities``.
          continuum_opacities_scattering:
              Continuum scattering opacity array with frequency and layer
              dimensions.
          irradiation_geometry:
              Irradiation geometry passed to the emission solver.
          star_irradiation_cos_angle:
              Cosine of the stellar irradiation angle.
          stellar_intensity:
              Incident stellar intensity spectrum on the model frequency grid.
          reflectances:
              Surface reflectance spectrum.
          emissivities:
              Surface emissivity spectrum.
          cloud_f_sed:
              Cloud settling parameter forwarded to the optical-depth helper
              when photospheric cloud scaling is requested.
          photospheric_cloud_optical_depths:
              Optional target cloud optical depth used by the photospheric
              cloud parametrization.
          cloud_photosphere_wavelength_boundaries:
              Optional wavelength interval used when evaluating the
              photospheric cloud optical depth.
          cloud_anisotropic_scattering_opacities:
              Cloud anisotropic scattering opacities used when scattering in
              emission is enabled.
          cloud_absorption_opacities:
              Cloud absorption opacity contribution used by the optical-depth
              calculation.
          adaptive_feautrier_iterations:
              Whether to adapt the number of scattering iterations in the
              Feautrier solver.
          return_contribution:
              If ``True``, also return the emission contribution function.
          return_angle_dependent_intensities:
              If ``True``, return angle-dependent intensities. Non-scattering
              emission returns a zero placeholder with the correct shape.
          chunk_feautrier:
              If ``True``, evaluate the Feautrier solver in frequency chunks.
          feautrier_chunk_size:
              Number of frequency bins per chunk when ``chunk_feautrier`` is
              enabled.

      Returns:
          Tuple ``(flux, emission_contribution, optical_depths,
          relative_cloud_scaling_factor)`` on the internal frequency grid.



   .. py:method:: _maybe_calculate_photosphere_radius(planet_radius, return_photosphere_radius, temperatures, mean_molar_masses, reference_gravity, opacities, continuum_opacities_scattering, cloud_f_sed, cloud_photosphere_median_optical_depth, cloud_photosphere_wavelength_boundaries, cloud_anisotropic_scattering_opacities, cloud_absorption_opacities, optical_depths)


   .. py:method:: _calculate_radius_hydrostatic_equilibrium(pressures, temperatures, mean_molar_masses, reference_gravity, planet_radius)


   .. py:method:: _get_photosphere_optical_depths(pressures, optical_depths, reference_gravity, opacities, continuum_opacities_scattering, cloud_f_sed, cloud_photosphere_median_optical_depth, cloud_photosphere_wavelength_boundaries, cloud_anisotropic_scattering_opacities, cloud_absorption_opacities, sum_opacities)


   .. py:method:: _interpolate_photosphere_radius_profile(pressures, optical_depths, radius_hydrostatic_equilibrium)


   .. py:method:: _calculate_opacities(pressures, temperatures, mass_fractions, mean_molar_masses, reference_gravity, opaque_cloud_top_pressure=None, cloud_particle_mean_radii=None, cloud_particle_radius_distribution_std=None, cloud_particle_radius_distribution='lognormal', cloud_particle_number_density_grid=None, cloud_hansen_a=None, cloud_hansen_b=None, clouds_particle_porosity_factor=None, cloud_f_sed=None, eddy_diffusion_coefficients=None, haze_factor=1.0, power_law_opacity_350nm=None, power_law_opacity_coefficient=None, gray_opacity=None, cloud_photosphere_median_optical_depth=None, cloud_fraction=1.0, patchy_clouds=None, return_cloud_contribution=False, return_opacities=False, additional_absorption_opacities_function=None, additional_scattering_opacities_function=None, compute_clear_opacities=False, sum_opacities=False, anisotropic_cloud_scattering=None, target_particle_radii=None, target_pressure=None)

      Build line, continuum, and cloud opacity products for a spectrum calculation.

      The method interpolates line opacities to the current atmospheric
      structure, computes gas and cloud continuum contributions, combines
      them according to the active line-opacity mode, and optionally builds a

      Args:
          temperatures:
              Atmospheric temperature profile in K.
          mass_fractions:
              Mapping from species name to mass-fraction profile.
          mean_molar_masses:
              Mean molecular mass profile in amu.
          reference_gravity:
              Reference gravity in cgs units.
          opaque_cloud_top_pressure:
              Optional pressure in bar where an opaque cloud deck is imposed.
          cloud_particle_mean_radii:
              Optional cloud particle mean radii keyed by cloud species.
          cloud_particle_radius_distribution_std:
              Width of the log-normal particle size distribution.
          cloud_particle_radius_distribution:
              Cloud particle size distribution model, typically
              ``"lognormal"`` or ``"hansen"``.
          cloud_particle_number_density_grid:
              Optional per-species particle number density grid.
          cloud_hansen_a:
              Optional Hansen ``a`` parameter profiles keyed by cloud species.
          cloud_hansen_b:
              Optional Hansen ``b`` parameter profiles keyed by cloud species.
          clouds_particle_porosity_factor:
              Optional porosity factors keyed by cloud species.
          cloud_f_sed:
              Cloud settling parameter, either scalar or per-species mapping.
          eddy_diffusion_coefficients:
              Optional eddy diffusion coefficient profile or mapping.
          haze_factor:
              Scalar multiplier for Rayleigh scattering.
          power_law_opacity_350nm:
              Optional reference scattering opacity at 0.35 micron.
          power_law_opacity_coefficient:
              Wavelength exponent for the parametrized scattering opacity.
          gray_opacity:
              Optional gray absorption opacity added everywhere.
          cloud_photosphere_median_optical_depth:
              Optional target median cloud optical depth near the photosphere.
          cloud_fraction:
              Cloud coverage fraction for mixed cloudy and clear columns.
          patchy_clouds:
              Cloud species affected by ``cloud_fraction`` and therefore
              excluded from the always-cloudy branch.
          return_cloud_contribution:
              If ``True``, propagate cloud contribution products required by
              downstream diagnostics.
          additional_absorption_opacities_function:
              Optional user-supplied absorption opacity callback.
          additional_scattering_opacities_function:
              Optional user-supplied scattering opacity callback.
          compute_clear_opacities:
              If ``True``, also construct clear-column opacities.
          target_particle_radii:
              Particle radius to target for selective bin disabling. Radius bin closest the input value will be disabled.
          target_pressure:
              Pressure to target for selective bin disabling. Pressure bin closest to the input value will be disabled.

      Returns:
          Tuple containing cloudy opacities, cloudy scattering opacities,
          cloud-only opacity diagnostics, particle radii products, a flag for
          scattering in transmission, and optional clear-column opacity
          products.



   .. py:method:: _calculate_transit_radii(pressures, temperatures, mean_molar_masses, reference_gravity, reference_pressure, planet_radius, variable_gravity, opacities, continuum_opacities_scattering, sum_opacities, return_contributions)

      Compute transmission-spectrum radii for the prepared opacity state.

      Args:
          temperatures:
              Atmospheric temperature profile in K.
          mean_molar_masses:
              Mean molecular mass profile in amu.
          reference_gravity:
              Reference gravity in cgs units at ``reference_pressure``.
          reference_pressure:
              Pressure in bar where ``planet_radius`` is defined.
          planet_radius:
              Planet radius in cm at ``reference_pressure``.
          variable_gravity:
              If ``True``, use a $1/r^2$ gravity profile in the transmission
              calculation.
          opacities:
              Total opacity array produced by ``_calculate_opacities``.
          continuum_opacities_scattering:
              Continuum scattering opacity array.
          sum_opacities:
              Whether the main transmission spectrum should use the summed
              opacity contract.
          return_contributions:
              Whether to evaluate the transmission contribution function on
              the same opacity contract as the main transmission spectrum.

      Returns:
          Tuple ``(transit_radii, radius_hydrostatic_equilibrium,
          transmission_contribution)``.



   .. py:method:: _init_frequency_grid()


   .. py:method:: _init_frequency_grid_from_frequency_grid(frequency_grid, wavelength_boundaries, sampling=1)
      :staticmethod:



   .. py:method:: _init_frequency_grid_from_lines()


   .. py:method:: _tree_flatten()


   .. py:method:: _tree_unflatten(aux_data, children)
      :classmethod:



   .. py:method:: calculate_contribution_spectra(mode, opaque_cloud_top_pressure=None, power_law_opacity_350nm=None, power_law_opacity_coefficient=None, gray_opacity=None, cloud_photosphere_median_optical_depth=None, additional_absorption_opacities_function=None, additional_scattering_opacities_function=None, stellar_intensities=None, **kwargs)

      Calculate total and per-opacity-source spectra for attribution studies.

      The method evaluates the requested spectral mode once with all active
      opacity sources and then repeats the calculation for each individual
      initialization-time or runtime opacity source, returning a dictionary of
      spectra keyed by contribution name.

      Args:
          mode:
              Either ``"emission"`` or ``"transmission"``.
          opaque_cloud_top_pressure:
              Optional opaque cloud deck pressure in bar.
          power_law_opacity_350nm:
              Optional reference scattering opacity for the parametrized power
              law cloud model.
          power_law_opacity_coefficient:
              Wavelength exponent for the parametrized scattering opacity.
          gray_opacity:
              Optional gray absorption opacity.
          cloud_photosphere_median_optical_depth:
              Optional target cloud optical depth near the photosphere.
          additional_absorption_opacities_function:
              Optional user-provided absorption opacity callback.
          additional_scattering_opacities_function:
              Optional user-provided scattering opacity callback.
          stellar_intensities:
              Optional stellar intensity spectrum used in emission mode.
          **kwargs:
              Additional keyword arguments forwarded to
              ``calculate_flux`` or ``calculate_transit_radii``.

      Returns:
          Nested dictionary containing the total spectrum under ``"Total"``
          and contribution spectra grouped by opacity source.



   .. py:method:: calculate_flux(temperatures: jax.typing.ArrayLike, mass_fractions: dict[str, jax.typing.ArrayLike], mean_molar_masses: jax.typing.ArrayLike, reference_gravity: float, planet_radius: float = None, opaque_cloud_top_pressure: float = None, cloud_particle_mean_radii: dict[str, jax.typing.ArrayLike] = None, cloud_particle_radius_distribution_std: float | dict[str, jax.typing.ArrayLike] = None, cloud_particle_radius_distribution: str = 'lognormal', cloud_hansen_a: dict[str, jax.typing.ArrayLike] = None, cloud_hansen_b: dict[str, jax.typing.ArrayLike] = None, cloud_particle_number_density_grid: dict[str, jax.typing.ArrayLike] = None, clouds_particle_porosity_factor: dict[str, float] = None, cloud_f_sed: float = None, eddy_diffusion_coefficients: jax.typing.ArrayLike = None, haze_factor: float = 1.0, power_law_opacity_350nm: float = None, power_law_opacity_coefficient: float = None, gray_opacity: float = None, cloud_photosphere_wavelength_boundaries: jax.typing.ArrayLike = None, cloud_photosphere_median_optical_depth: float = None, cloud_fraction: float = 1.0, patchy_clouds: list[str] | tuple[str] = None, complete_coverage_clouds: list[str] = None, irradiation_geometry: str = 'dayside_ave', stellar_intensities: jax.typing.ArrayLike = None, star_effective_temperature: float = None, star_radius: float = None, orbit_semi_major_axis: float = None, star_irradiation_angle: float = 0.0, reflectances: jax.typing.ArrayLike = None, emissivities: jax.typing.ArrayLike = None, additional_absorption_opacities_function: Callable = None, additional_scattering_opacities_function: Callable = None, adaptive_feautrier_iterations: bool = False, chunk_feautrier: bool = True, feautrier_chunk_size: int = 1536, frequencies_to_wavelengths: bool = True, return_contribution: bool = False, return_clear_spectrum: bool = False, return_photosphere_radius: bool = False, return_rosseland_optical_depths: bool = False, return_cloud_contribution: bool = False, return_opacities: bool = False, return_abundances: bool = False, return_stellar_intensities: bool = False, return_angle_dependent_intensities: bool = False, return_particle_radii_bins: bool = False, return_particle_radii: bool = False, target_particle_radii: jax.typing.ArrayLike = None, pressures: jax.typing.ArrayLike = None, target_pressure: jax.typing.ArrayLike = None) -> tuple[jax.typing.ArrayLike, jax.typing.ArrayLike, dict[str, Any]]

      Method to calculate the atmosphere's emitted flux (emission spectrum).

      Args:
          temperatures:
              The atmospheric temperature in K, at each atmospheric layer
              (1-d numpy array, same length as pressure array).
          mass_fractions:
              Dictionary of mass fractions for all atmospheric absorbers.
              Dictionary keys are the species names. Every mass fraction array has same length as pressure array.
          mean_molar_masses:
              The atmospheric mean molecular weight in amu, at each atmospheric layer
              (1-d numpy array, same length as pressure array).
          reference_gravity (float):
              Surface gravity in cgs. Vertically constant for emission spectra.
          planet_radius: planet radius at maximum pressure in cm. Only used to calculate the planet's changing
              Photospheric radius as function of wavelength, if return_photosphere_radius is True.
          opaque_cloud_top_pressure (Optional[float]):
              Pressure, in bar, where opaque cloud deck is added to the absorption opacity.
          cloud_particle_mean_radii (Optional):
              Dictionary of mean particle radii for all cloud species.
              Dictionary keys are the cloud species names. Every radius array has same length as pressure array.
          cloud_particle_radius_distribution_std:
              Width of the log-normal cloud particle size distribution.
              May be a shared scalar or a per-species dictionary whose
              values are scalars or layer profiles.
          cloud_particle_radius_distribution (Optional[string]):
              The cloud particle size distribution to use.
              Can be either 'lognormal' (default) or 'hansen'.
              If hansen, the cloud_hansen_b parameters must be used.
          cloud_hansen_a (Optional[dict]):
              A dictionary of the 'a' parameter values for each included cloud species and for each atmospheric
              layer, formatted as the kzz argument. Equivalent to cloud_particle_mean_radii.
              If cloud_hansen_a is not included and dist is "hansen", then it will be computed using Kzz and fsed
              (recommended).
          cloud_hansen_b (Optional[dict]):
              A dictionary of the 'b' parameter values for each included cloud species and for each atmospheric
              layer, formatted as the kzz argument. This is the width of the hansen distribution normalized by
              the particle area (1/cloud_hansen_a^2)
          cloud_particle_number_density_grid (Optional[dict]):
              EXPERIMENTAL
          clouds_particle_porosity_factor (Optional[dict]):
              A dictionary of porosity factors depending on the cloud species. This can be useful when opacities
              are calculated using the Distribution of Hollow Spheres (DHS) method.
          cloud_f_sed (Optional[float]):
              Cloud settling parameter.
          eddy_diffusion_coefficients (Optional[float]):
              The atmospheric eddy diffusion coefficient in cgs (i.e. :math:`\rm cm^2/s`), at each atmospheric
              layer (1-d numpy array, same length as pressure array).
          haze_factor (Optional[float]):
              Scalar factor, increasing the gas Rayleigh scattering cross-section.
          power_law_opacity_350nm (Optional[float]):
              Scattering opacity at 0.35 micron, in cgs units (cm^2/g).
          power_law_opacity_coefficient (Optional[float]):
              Has to be given if kappa_zero is defined, this is the
              wavelength powerlaw index of the parametrized scattering
              opacity.
          gray_opacity (Optional[float]):
              Gray opacity value, to be added to the opacity at all pressures and wavelengths
              (units :math:`\rm cm^2/g`)
          cloud_photosphere_median_optical_depth (Optional[float]):
              Median optical depth (across ``wavelength_boundaries``) of the clouds from the top of the
              atmosphere down to the gas-only photosphere. This parameter can be used for enforcing the presence
              of clouds in the photospheric region.
          cloud_photosphere_wavelength_boundaries (Optional[NDArray]):
              Min and max wavelength boundaries when calculating the median of the photospheric cloud optical
              depth. By default, the whole spectral range is used.
          cloud_fraction:
              Mix a column without cloud with a column with cloud to the requested fraction
              (0 = clear, 1 = full cloud cover). Cloud sources such as
              power-law clouds and opaque cloud decks follow the same mixing.
              By default, assume a full cloud cover.
          patchy_clouds:
              List of cloud species affected by ``cloud_fraction``.
              Runtime-only cloud sources such as power-law clouds and opaque
              cloud decks are always mixed by ``cloud_fraction``.
          complete_coverage_clouds:
              Deprecated alias for the complement of ``patchy_clouds``.
          irradiation_geometry (Optional[string]):
              if equal to ``'dayside_ave'``: use the dayside average geometry.
              If equal to ``'planetary_ave'``: use the planetary average geometry.
              If equal to ``'non-isotropic'``: use the non-isotropic geometry.
          stellar_intensities (Optional[array]):
              The stellar intensity to use. If None, it will be calculated using a PHOENIX model.
          star_effective_temperature (Optional[float]):
              The temperature of the host star in K, used only if the
              scattering is considered. If not specified, the direct light contribution is not calculated.
          star_radius (Optional[float]):
              The radius of the star in cm. If specified, used to scale the to scale the stellar flux,
              otherwise it uses PHOENIX radius.
          orbit_semi_major_axis (Optional[float]):
              The distance of the planet from the star. Used to scale the stellar flux when the scattering of the
              direct light is considered.
          star_irradiation_angle (Optional[float]):
              Inclination angle of the direct light with respect to the normal to the atmosphere. Used only in
              the non-isotropic geometry scenario.
          reflectances (Optional):
              Reflectances of the surface (layer with the highest pressure).
          emissivities (Optional):
              Emissivities of the surface (layer with the highest pressure).
          additional_absorption_opacities_function (Optional[function]):
              A python function that takes wavelength arrays in microns and pressure arrays in bars
              as input, and returns an absorption opacity matrix in units of cm^2/g, in the shape of
              number of wavelength points x number of pressure points.
              This opacity will then be added to the atmospheric absorption opacity.
              This must not be used to add atomic / molecular line opacities in low-resolution mode (c-k),
              because line opacities require a proper correlated-k treatment.
              It may be used to add simple cloud absorption laws, for example, which
              have opacities that vary only slowly with wavelength, such that the current
              model resolution is sufficient to resolve any variations.
          additional_scattering_opacities_function (Optional[function]):
              A python function that takes wavelength arrays in microns and pressure arrays in bars
              as input, and returns an isotropic scattering opacity matrix in units of cm^2/g, in the shape of
              number of wavelength points x number of pressure points.
              This opacity will then be added to the atmospheric absorption opacity.
              It may be used to add simple cloud absorption laws, for example, which
              have opacities that vary only slowly with wavelength, such that the current
              model resolution is sufficient to resolve any variations.
          adaptive_feautrier_iterations (Optional[bool]):
              If True, adapt the number of iterations of the Feautrier scattering-method
              (scattering_in_emission=True) based on the photon destruction probability.
          frequencies_to_wavelengths (Optional[bool]):
              if True, convert the frequencies (Hz) output to wavelengths (cm),
              and the flux per frequency output (erg.s-1.cm-2/Hz) to flux per wavelength (erg.s-1.cm-2/cm)
          return_contribution (Optional[bool]):
              If True, calculate the emission contribution function.
          return_clear_spectrum (Optional[bool]):
              If True, return the clear spectrum in addition to a cloudy spectrum.
          return_photosphere_radius (Optional[bool]):
              If True, calculate and return the photosphere radius.
          return_rosseland_optical_depths (Optional[bool]):
              If True, calculate and return the Rosseland opacities and optical depths.
          return_cloud_contribution (Optional[bool]):
              If True, calculate the cloud contribution.
          return_opacities (Optional[bool]):
              If True, return the absorption opacities and scattering opacities for species and clouds, as well
              as optical depths
          return_abundances (Optional[bool]):
              If True, return the mass fractions.
          return_stellar_intensities (Optional[bool]):
              If True, include the stellar intensities used by the emission
              solver in the auxiliary output mapping.
          return_angle_dependent_intensities (Optional[bool]):
              If True, include the angle-dependent intensities in the
              auxiliary output mapping.
          return_particle_radii_bins (Optional[bool]):
              If True, return the particle radii bins.
          return_particle_radii (Optional[bool]):
              If True, return the particle radii.
          target_particle_radii (Optional[ArrayLike]:
              Particle radius to target for selective bin disabling. Radius bin closest the input value will be disabled.
          target_pressure (Optional[ArrayLike]:
              Pressure to target for selective bin disabling. Pressure bin closest to the input value will be disabled.



   .. py:method:: _calculate_flux_kernel(temperatures, mass_fractions, mean_molar_masses, reference_gravity, pressures=None, planet_radius=None, opaque_cloud_top_pressure=None, cloud_particle_mean_radii=None, cloud_particle_radius_distribution_std=None, cloud_particle_radius_distribution='lognormal', cloud_hansen_a=None, cloud_hansen_b=None, cloud_particle_number_density_grid=None, clouds_particle_porosity_factor=None, cloud_f_sed=None, eddy_diffusion_coefficients=None, haze_factor=1.0, power_law_opacity_350nm=None, power_law_opacity_coefficient=None, gray_opacity=None, cloud_photosphere_wavelength_boundaries=None, cloud_photosphere_median_optical_depth=None, cloud_fraction=1.0, patchy_clouds=None, irradiation_geometry='dayside_ave', stellar_intensities=None, star_effective_temperature=None, star_radius=None, orbit_semi_major_axis=None, star_irradiation_angle=0.0, reflectances=None, emissivities=None, additional_absorption_opacities_function=None, additional_scattering_opacities_function=None, adaptive_feautrier_iterations=False, chunk_feautrier=True, feautrier_chunk_size=1536, frequencies_to_wavelengths=True, return_contribution=False, return_clear_spectrum=False, return_photosphere_radius=False, return_cloud_contribution=False, return_opacities=False, return_abundances=False, return_stellar_intensities=False, return_angle_dependent_intensities=False, return_particle_radii_bins=False, return_particle_radii=False, target_particle_radii=None, target_pressure=None, sum_opacities=True, anisotropic_cloud_scattering=None)

      JIT-compiled kernel for calculate_flux. See calculate_flux for parameter docs.



   .. py:method:: calculate_flux_autodiff(temperatures: jax.typing.ArrayLike, mass_fractions: dict[str, jax.typing.ArrayLike], mean_molar_masses: jax.typing.ArrayLike, reference_gravity: float, *, pressures: jax.typing.ArrayLike = None, cloud_parameters: dict[str, Any] | None = None, irradiation_geometry: str = 'dayside_ave', stellar_intensities: jax.typing.ArrayLike = None, star_irradiation_angle: float = 0.0, reflectances: jax.typing.ArrayLike = None, emissivities: jax.typing.ArrayLike = None, additional_absorption_opacities_function: Callable = None, additional_scattering_opacities_function: Callable = None, chunk_feautrier: bool = True, feautrier_chunk_size: int = 1536, frequencies_to_wavelengths: bool = True) -> tuple[jax.typing.ArrayLike, jax.typing.ArrayLike, dict[str, any]]

      Autodiff-oriented emission-spectrum API with grouped cloud controls.

      The method uses the same pure JAX kernel as calculate_flux, but collapses the
      cloud-configuration surface into a single keyword argument and only accepts direct
      stellar intensities on the irradiation side.

      Example:
          >>> cloud_parameters = {
          ...     'cloud_f_sed': cloud_f_sed,
          ...     'eddy_diffusion_coefficients': eddy_diffusion_coefficients,
          ...     'cloud_particle_radius_distribution_std': 1.05,
          ... }
          >>> _, flux, _ = atmosphere.calculate_flux_autodiff(
          ...     temperatures=temperatures,
          ...     mass_fractions=mass_fractions,
          ...     mean_molar_masses=mean_molar_masses,
          ...     reference_gravity=reference_gravity,
          ...     cloud_parameters=cloud_parameters,
          ...     frequencies_to_wavelengths=False,
          ... )
          >>> temperature_gradient = jax.grad(
          ...     lambda t: jnp.sum(
          ...         atmosphere.calculate_flux_autodiff(
          ...             temperatures=t,
          ...             mass_fractions=mass_fractions,
          ...             mean_molar_masses=mean_molar_masses,
          ...             reference_gravity=reference_gravity,
          ...             cloud_parameters=cloud_parameters,
          ...             frequencies_to_wavelengths=False,
          ...         )[1]
          ...     )
          ... )(temperatures)



   .. py:method:: calculate_photosphere_radius(temperatures: jax.typing.ArrayLike, mean_molar_masses: jax.typing.ArrayLike, reference_gravity: float, planet_radius: float, opacities: jax.typing.ArrayLike, continuum_opacities_scattering: jax.typing.ArrayLike, cloud_f_sed: float, cloud_photosphere_median_optical_depth: float, cloud_anisotropic_scattering_opacities: jax.typing.ArrayLike, cloud_absorption_opacities: jax.typing.ArrayLike, optical_depths: jax.typing.ArrayLike = None, cloud_photosphere_wavelength_boundaries: jax.typing.ArrayLike = None, pressures: jax.typing.ArrayLike = None) -> jax.typing.ArrayLike

      Estimate the wavelength-dependent photosphere radius.

      The photosphere radius is obtained by computing or reusing optical
      depths, locating the layer where the angle-averaged optical depth
      reaches $2/3$, and interpolating the hydrostatic radius profile to that
      pressure.

      Args:
          temperatures:
              Atmospheric temperature profile in K.
          mean_molar_masses:
              Mean molecular mass profile in amu.
          reference_gravity:
              Reference gravity in cgs units.
          planet_radius:
              Radius in cm at the deepest atmospheric layer.
          opacities:
              Total opacity array used for the emission calculation.
          continuum_opacities_scattering:
              Continuum scattering opacity array.
          cloud_f_sed:
              Cloud settling parameter used when photospheric cloud scaling is
              active.
          cloud_photosphere_median_optical_depth:
              Optional target cloud optical depth near the photosphere.
          cloud_anisotropic_scattering_opacities:
              Cloud anisotropic scattering opacities.
          cloud_absorption_opacities:
              Cloud absorption opacities.
          optical_depths:
              Precomputed optical depths. If omitted, they are recomputed.
          cloud_photosphere_wavelength_boundaries:
              Optional wavelength bounds used for the photospheric cloud model.

      Returns:
          Photosphere radius on the internal frequency grid, in cm.



   .. py:method:: calculate_rosseland_planck_opacities(temperatures: numpy.typing.NDArray[float], mass_fractions: dict[str, numpy.typing.NDArray[float]], mean_molar_masses: numpy.typing.NDArray[float], reference_gravity: float, opaque_cloud_top_pressure: float = None, cloud_particle_mean_radii: dict[str, jax.typing.ArrayLike] = None, cloud_particle_radius_distribution_std: float | dict[str, jax.typing.ArrayLike] = None, cloud_particle_radius_distribution: str = 'lognormal', cloud_hansen_a: dict[str, jax.typing.ArrayLike] = None, cloud_hansen_b: dict[str, jax.typing.ArrayLike] = None, clouds_particle_porosity_factor: dict[str, float] = None, cloud_f_sed: float = None, eddy_diffusion_coefficients: float = None, haze_factor: float = 1.0, power_law_opacity_350nm: float = None, power_law_opacity_coefficient: float = None, gray_opacity: float = None) -> tuple[numpy.typing.NDArray[float], numpy.typing.NDArray[float], dict[str, any]]

      Method to calculate the atmosphere's Rosseland and Planck mean opacities.

      Args:
          temperatures:
              the atmospheric temperature in K, at each atmospheric layer
              (1-d numpy array, same length as pressure array).
          mass_fractions:
              dictionary of mass fractions for all atmospheric absorbers.
              Dictionary keys are the species names.
              Every mass fraction array
              has same length as pressure array.
          mean_molar_masses:
              the atmospheric mean molecular weight in amu,
              at each atmospheric layer
              (1-d numpy array, same length as pressure array).
          reference_gravity (float):
              Surface gravity in cgs. Vertically constant for emission
              spectra.
          opaque_cloud_top_pressure (Optional[float]):
              Pressure, in bar, where opaque cloud deck is added to the
              absorption opacity.
          cloud_particle_mean_radii (Optional):
              dictionary of mean particle radii for all cloud species.
              Dictionary keys are the cloud species names.
              Every radius array has same length as pressure array.
          cloud_particle_radius_distribution_std:
              Width of the log-normal cloud particle size distribution.
              May be a shared scalar or a per-species dictionary whose
              values are scalars or layer profiles.
          cloud_particle_radius_distribution (Optional[string]):
              The cloud particle size distribution to use.
              Can be either 'lognormal' (default) or 'hansen'.
              If hansen, the cloud_hansen_b parameters must be used.
          cloud_hansen_a (Optional[dict]):
              A dictionary of the 'a' parameter values for each
              included cloud species and for each atmospheric layer,
              formatted as the kzz argument. Equivalent to radius arg.
              If cloud_hansen_a is not included and dist is "hansen", then it will
              be computed using Kzz and fsed (recommended).
          cloud_hansen_b (Optional[dict]):
              A dictionary of the 'b' parameter values for each
              included cloud species and for each atmospheric layer,
              formatted as the kzz argument. This is the width of the hansen
              distribution normalized by the particle area (1/cloud_hansen_a^2)
          clouds_particle_porosity_factor (Optional[dict]):
              A dictionary containing the particle porosity factor for each cloud species.
          cloud_f_sed (Optional[float]):
              cloud settling parameter
          eddy_diffusion_coefficients (Optional):
              the atmospheric eddy diffusion coefficient in cgs
              (i.e. :math:`\rm cm^2/s`),
              at each atmospheric layer
              (1-d numpy array, same length as pressure array).
          haze_factor (Optional[float]):
              Scalar factor, increasing the gas Rayleigh scattering
              cross-section.
          power_law_opacity_350nm (Optional[float]):
              Scattering opacity at 0.35 micron, in cgs units (cm^2/g).
          power_law_opacity_coefficient (Optional[float]):
              Has to be given if kappa_zero is defined, this is the
              wavelength powerlaw index of the parametrized scattering
              opacity.
          gray_opacity (Optional[float]):
              Gray opacity value, to be added to the opacity at all
              pressures and wavelengths (units :math:`\rm cm^2/g`)



   .. py:method:: calculate_transit_radii(temperatures: jax.typing.ArrayLike, mass_fractions: dict[str, jax.typing.ArrayLike], mean_molar_masses: jax.typing.ArrayLike, reference_gravity: float, reference_pressure: float, planet_radius: float, variable_gravity: bool = True, opaque_cloud_top_pressure: float = None, cloud_particle_mean_radii: dict[str, jax.typing.ArrayLike] = None, cloud_particle_radius_distribution_std: float | dict[str, jax.typing.ArrayLike] = None, cloud_particle_radius_distribution: str = 'lognormal', cloud_hansen_a: dict[str, jax.typing.ArrayLike] = None, cloud_hansen_b: dict[str, jax.typing.ArrayLike] = None, cloud_particle_number_density_grid: dict[str, jax.typing.ArrayLike] = None, clouds_particle_porosity_factor: dict[str, float] = None, cloud_f_sed: float = None, eddy_diffusion_coefficients: float = None, haze_factor: float = 1.0, power_law_opacity_350nm: float = None, power_law_opacity_coefficient: float = None, gray_opacity: float = None, cloud_fraction: float = 1.0, patchy_clouds: list[str] | tuple[str] = None, complete_coverage_clouds: list[str] = None, additional_absorption_opacities_function: Callable = None, additional_scattering_opacities_function: Callable = None, frequencies_to_wavelengths: bool = True, return_contribution: bool = False, return_clear_spectrum: bool = False, return_cloud_contribution: bool = False, return_radius_hydrostatic_equilibrium: bool = False, return_opacities: bool = False, return_abundances: bool = False, return_particle_radii_bins: bool = False, return_particle_radii: bool = False, return_particle_densities: bool = False, target_particle_radii: jax.typing.ArrayLike = None, pressures: jax.typing.ArrayLike = None, target_pressure: jax.typing.ArrayLike = None) -> tuple[jax.typing.ArrayLike, jax.typing.ArrayLike, dict[str, Any]]

      Method to calculate the atmosphere's transmission radius
      (for the transmission spectrum).

          Args:
              temperatures:
                  the atmospheric temperature in K, at each atmospheric layer
                  (1-d numpy array, same length as pressure array).
              mass_fractions:
                  dictionary of mass fractions for all atmospheric absorbers.
                  Dictionary keys are the species names.
                  Every mass fraction array
                  has same length as pressure array.
              mean_molar_masses:
                  the atmospheric mean molecular weight in amu,
                  at each atmospheric layer
                  (1-d numpy array, same length as pressure array).
              reference_gravity (float):
                  Surface gravity in cgs at reference radius and pressure.
              reference_pressure (float):
                  Reference pressure P0 in bar where R(P=P0) = R_pl,
                  where R_pl is the reference radius (parameter of this
                  method), and g(P=P0) = gravity, where gravity is the
                  reference gravity (parameter of this method)
              planet_radius (float):
                  Reference radius R_pl, in cm.
              variable_gravity (Optional[bool]):
                  Standard is ``True``. If ``False`` the gravity will be
                  constant as a function of pressure, during the transmission
                  radius calculation.
              opaque_cloud_top_pressure (Optional[float]):
                  Pressure, in bar, where opaque cloud deck is added to the
                  absorption opacity.
              cloud_particle_mean_radii (Optional):
                  dictionary of mean particle radii for all cloud species.
                  Dictionary keys are the cloud species names.
                  Every radius array has same length as pressure array.
              cloud_particle_radius_distribution_std:
                  Width of the log-normal cloud particle size distribution.
                  May be a shared scalar or a per-species dictionary whose
                  values are scalars or layer profiles.
              cloud_particle_radius_distribution (Optional[string]):
                  The cloud particle size distribution to use.
                  Can be either 'lognormal' (default) or 'hansen'.
                  If hansen, the cloud_hansen_b parameters must be used.
              cloud_hansen_a (Optional[dict]):
                  A dictionary of the 'a' parameter values for each
                  included cloud species and for each atmospheric layer,
                  formatted as the kzz argument. Equivalent to radius arg.
                  If cloud_hansen_a is not included and dist is "hansen", then it will
                  be computed using Kzz and fsed (recommended).
              cloud_hansen_b (Optional[dict]):
                  A dictionary of the 'b' parameter values for each
                  included cloud species and for each atmospheric layer,
                  formatted as the kzz argument. This is the width of the hansen
                  distribution normalized by the particle area (1/cloud_hansen_a^2)
              cloud_particle_number_density_grid (Optional[dict]):
                  EXPERIMENTAL
              clouds_particle_porosity_factor (Optional[dict]):
                  A dictionary of porosity factors depending on the cloud species. This can be useful when opacities
                  are calculated using the Distribution of Hollow Spheres (DHS) method.
              cloud_f_sed (Optional[float]):
                  cloud settling parameter
              eddy_diffusion_coefficients (Optional):
                  the atmospheric eddy diffusion coefficient in cgs
                  (i.e. :math:`\rm cm^2/s`),
                  at each atmospheric layer
                  (1-d numpy array, same length as pressure array).
              haze_factor (Optional[float]):
                  Scalar factor, increasing the gas Rayleigh scattering
                  cross-section.
              power_law_opacity_350nm (Optional[float]):
                  Scattering opacity at 0.35 micron, in cgs units (cm^2/g).
              power_law_opacity_coefficient (Optional[float]):
                  Has to be given if kappa_zero is defined, this is the
                  wavelength powerlaw index of the parametrized scattering
                  opacity.
              gray_opacity (Optional[float]):
                  Gray opacity value, to be added to the opacity at all
                  pressures and wavelengths (units :math:`\rm cm^2/g`)
              cloud_fraction:
                  Mix a column without cloud with a column with cloud to the requested fraction
                  (0 = clear, 1 = full cloud cover). Runtime-only cloud sources such as
                  power-law clouds and opaque cloud decks follow the same mixing.
                  By default, assume a full cloud cover.
              patchy_clouds:
                  List of cloud species affected by ``cloud_fraction``.
                  Runtime-only cloud sources such as power-law clouds and opaque
                  cloud decks are always mixed by ``cloud_fraction``.
              complete_coverage_clouds:
                  Deprecated alias for the complement of ``patchy_clouds``.
              additional_absorption_opacities_function (Optional[function]):
                  A python function that takes wavelength arrays in microns and pressure arrays in bars
                  as input, and returns an absorption opacity matrix in units of cm^2/g, in the shape of
                  number of wavelength points x number of pressure points.
                  This opacity will then be added to the atmospheric absorption opacity.
                  This must not be used to add atomic / molecular line opacities in low-resolution mode (c-k),
                  because line opacities require a proper correlated-k treatment.
                  It may be used to add simple cloud absorption laws, for example, which
                  have opacities that vary only slowly with wavelength, such that the current
                  model resolution is sufficient to resolve any variations.
              additional_scattering_opacities_function (Optional[function]):
                  A python function that takes wavelength arrays in microns and pressure arrays in bars
                  as input, and returns an isotropic scattering opacity matrix in units of cm^2/g, in the shape of
                  number of wavelength points x number of pressure points.
                  This opacity will then be added to the atmospheric absorption opacity.
                  It may be used to add simple cloud absorption laws, for example, which
                  have opacities that vary only slowly with wavelength, such that the current
                  model resolution is sufficient to resolve any variations.
              frequencies_to_wavelengths (Optional[bool]):
                  If True, convert the frequencies (Hz) output to wavelengths (cm).
              return_contribution (Optional[bool]):
                  If True the transmission and emission contribution function is calculated.
              return_clear_spectrum (Optional[bool]):
                  If True, return the clear spectrum in addition to a cloudy spectrum.
              return_cloud_contribution (Optional[bool]):
                  If True, calculate and return the cloud contribution.
              return_radius_hydrostatic_equilibrium (Optional[bool]):
                  If True, return the radius at hydrostatic equilibrium of the planet.
              return_opacities (Optional[bool]):
                  If True, return the absorption opacities and scattering opacities.
              return_abundances (Optional[bool]):
                  If True, return the mass fractions.
              return_particle_radii_bins (Optional[bool]):
                  If True, return the particles radii bins.
              return_particle_radii (Optional[bool]):
                  If True, return the particles radii.
              return_particle_densities (Optional[bool]):
                  If True, return the particles densities.
              target_particle_radii (Optional[ArrayLike]:
                  Particle radius to target for selective bin disabling. Radius bin closest the input value will be disabled.
              target_pressure (Optional[ArrayLike]:
                  Pressure to target for selective bin disabling. Pressure bin closest to the input value will be disabled.



   .. py:method:: _calculate_transit_radii_full_kernel(temperatures, mass_fractions, mean_molar_masses, reference_gravity, reference_pressure, planet_radius, pressures=None, variable_gravity=True, opaque_cloud_top_pressure=None, cloud_particle_mean_radii=None, cloud_particle_radius_distribution_std=None, cloud_particle_radius_distribution='lognormal', cloud_hansen_a=None, cloud_hansen_b=None, cloud_particle_number_density_grid=None, clouds_particle_porosity_factor=None, cloud_f_sed=None, eddy_diffusion_coefficients=None, haze_factor=1.0, power_law_opacity_350nm=None, power_law_opacity_coefficient=None, gray_opacity=None, cloud_photosphere_median_optical_depth=None, cloud_fraction=1.0, patchy_clouds=None, additional_absorption_opacities_function=None, additional_scattering_opacities_function=None, frequencies_to_wavelengths=True, return_contribution=False, return_clear_spectrum=False, return_radius_hydrostatic_equilibrium=False, return_cloud_contribution=False, return_opacities=False, return_abundances=False, return_particle_radii_bins=False, return_particle_radii=False, return_particle_densities=False, target_particle_radii=None, target_pressure=None, sum_opacities=False, anisotropic_cloud_scattering=None)

      JIT-compiled kernel for calculate_transit_radii. See calculate_transit_radii for parameter docs.



   .. py:method:: calculate_transit_radii_autodiff(temperatures: jax.typing.ArrayLike, mass_fractions: dict[str, jax.typing.ArrayLike], mean_molar_masses: jax.typing.ArrayLike, reference_gravity: float, reference_pressure: float, planet_radius: float, *, pressures: jax.typing.ArrayLike = None, variable_gravity: bool = True, cloud_parameters: dict[str, Any] | None = None, additional_absorption_opacities_function: Callable = None, additional_scattering_opacities_function: Callable = None, frequencies_to_wavelengths: bool = True) -> tuple[jax.typing.ArrayLike, jax.typing.ArrayLike, dict[str, Any]]

      Autodiff-oriented transmission-spectrum API with grouped cloud controls.

      The method mirrors calculate_transit_radii while collapsing cloud controls into a
      single keyword argument and keeping the differentiated call surface small.

      Example:
          >>> cloud_parameters = {
          ...     'cloud_f_sed': cloud_f_sed,
          ...     'eddy_diffusion_coefficients': eddy_diffusion_coefficients,
          ...     'cloud_particle_radius_distribution_std': 1.05,
          ... }
          >>> _, transit_radii, _ = atmosphere.calculate_transit_radii_autodiff(
          ...     temperatures=temperatures,
          ...     mass_fractions=mass_fractions,
          ...     mean_molar_masses=mean_molar_masses,
          ...     reference_gravity=reference_gravity,
          ...     reference_pressure=reference_pressure,
          ...     planet_radius=planet_radius,
          ...     cloud_parameters=cloud_parameters,
          ...     frequencies_to_wavelengths=False,
          ... )
          >>> temperature_gradient = jax.grad(
          ...     lambda t: jnp.sum(
          ...         atmosphere.calculate_transit_radii_autodiff(
          ...             temperatures=t,
          ...             mass_fractions=mass_fractions,
          ...             mean_molar_masses=mean_molar_masses,
          ...             reference_gravity=reference_gravity,
          ...             reference_pressure=reference_pressure,
          ...             planet_radius=planet_radius,
          ...             cloud_parameters=cloud_parameters,
          ...             frequencies_to_wavelengths=False,
          ...         )[1]
          ...     )
          ... )(temperatures)



   .. py:method:: get_wavelengths()

      Convert the frequency grid into wavelengths in centimeter.



   .. py:method:: load_all_opacities()


   .. py:method:: load_cia_opacities(path_input_data)


   .. py:method:: load_cloud_opacities(path_input_data)

      Load the cloud opacities.

      Args:
          path_input_data: path to petitRADTRANS input_data directory



   .. py:method:: load_hdf5_ktables(file_path_hdf5, frequencies, g_size, temperature_pressure_grid_size, return_radtrans_opacities=True, return_host_array=False)
      :classmethod:


      Load k-coefficient tables in HDF5 format, based on the ExoMol setup.



   .. py:method:: load_line_opacities(path_input_data)

      Load the line opacities for spectral calculation.
      The default pressure-temperature grid is a log-uniform (10, 13) grid.

      Args:
          path_input_data: path to petitRADTRANS input_data directory



