skyscapes.physical_model.exojax.components.base
===============================================

.. py:module:: skyscapes.physical_model.exojax.components.base

.. autoapi-nested-parse::

   Abstract base classes for atmosphere components.

   Each abstract class declares the contract its concrete subclasses must
   implement. Returning a structured :class:`Contribution` (rather than a
   bare ``dtau``) lets the atmosphere combine absorption, Rayleigh, and
   cloud contributions uniformly without each component caring whether the
   others are present.



Classes
-------

.. autoapisummary::

   skyscapes.physical_model.exojax.components.base.Contribution
   skyscapes.physical_model.exojax.components.base.AbstractTPProfile
   skyscapes.physical_model.exojax.components.base.AbstractAbsorption
   skyscapes.physical_model.exojax.components.base.AbstractScattering
   skyscapes.physical_model.exojax.components.base.AbstractClouds
   skyscapes.physical_model.exojax.components.base.AbstractSurface


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

.. py:class:: Contribution

   Bases: :py:obj:`NamedTuple`


   Per-layer optical-property contribution from one component.

   Fields:
       dtau_total: Layer optical depth this component adds to the total
           opacity budget, shape ``(n_layers, n_nu)``.
       dtau_scatter: Subset of ``dtau_total`` that is *scattering*
           (non-absorbing), shape ``(n_layers, n_nu)``. For a pure
           absorber this is zero. For Rayleigh ``ssa=1`` so it equals
           ``dtau_total``. For a partly-absorbing cloud with single-
           scattering albedo ``ssa_c``, this is ``ssa_c * dtau_cloud``.
       g_weighted_num: ``g * dtau_scatter`` numerator for the weighted-
           average asymmetry parameter, shape ``(n_layers, n_nu)``.
           Rayleigh contributes zero (isotropic, ``g=0``). A cloud with
           asymmetry ``g_c`` contributes ``g_c * ssa_c * dtau_cloud``.


   .. py:attribute:: dtau_total
      :type:  jaxtyping.Array


   .. py:attribute:: dtau_scatter
      :type:  jaxtyping.Array


   .. py:attribute:: g_weighted_num
      :type:  jaxtyping.Array


.. py:class:: AbstractTPProfile

   Bases: :py:obj:`equinox.Module`


   Temperature-pressure profile.


   .. py:method:: compute_Tarr(rt_engine, T_eq_K_scalar, T_alpha_scalar)
      :abstractmethod:


      Return layer temperatures, shape ``(n_layers,)``.



.. py:class:: AbstractAbsorption

   Bases: :py:obj:`equinox.Module`


   Per-layer absorption opacity from line lists / cross-sections.

   Concrete implementations iterate over the atmosphere's
   :class:`MolecularSpecies` tuple, calling each species' ``opa``
   engine and summing the contributions.


   .. py:method:: compute(species, Tarr, pressure, gravity, rt_engine)
      :abstractmethod:


      Absorption contribution.

      ``dtau_scatter`` and ``g_weighted_num`` are zero for pure
      absorbers, but the return shape is the same as for scattering
      components so the atmosphere can combine them uniformly.



.. py:class:: AbstractScattering

   Bases: :py:obj:`equinox.Module`


   Per-layer scattering opacity (e.g. Rayleigh).


   .. py:method:: compute(species, bulk, gravity, rt_engine, n_layers, n_nu)
      :abstractmethod:


      Scattering contribution from tracked species + optional bulk gas.

      For a pure scatterer ``dtau_total == dtau_scatter``;
      ``g_weighted_num`` is zero for isotropic Rayleigh.



.. py:class:: AbstractClouds

   Bases: :py:obj:`equinox.Module`


   Per-layer cloud opacity (mixed scattering + absorption).


   .. py:method:: compute(log_pressure_bar_scalar, log_opt_depth_scalar, pressure, n_nu)
      :abstractmethod:


      Cloud contribution.

      For a single-scattering-albedo cloud the scattering and
      absorption parts are both nonzero; for a purely scattering
      cloud ``dtau_total == dtau_scatter``.



.. py:class:: AbstractSurface

   Bases: :py:obj:`equinox.Module`


   Bottom-of-atmosphere reflectivity.


   .. py:method:: compute_refl(log_albedo_scalar, n_nu)
      :abstractmethod:


      Return surface reflectivity, shape ``(n_nu,)``.



