skyscapes.scene
===============

.. py:module:: skyscapes.scene

.. autoapi-nested-parse::

   Scene hierarchy: AbstractStar + Planet + System + Scene wiring.



Submodules
----------

.. toctree::
   :maxdepth: 1

   /autoapi/skyscapes/scene/container/index
   /autoapi/skyscapes/scene/planet/index
   /autoapi/skyscapes/scene/star/index
   /autoapi/skyscapes/scene/system/index


Classes
-------

.. autoapisummary::

   skyscapes.scene.Scene
   skyscapes.scene.Planet
   skyscapes.scene.AbstractStar
   skyscapes.scene.FlatStar
   skyscapes.scene.Star
   skyscapes.scene.System


Package Contents
----------------

.. py:class:: Scene

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


   Field-of-view container: planetary system + named background sources.

   Attributes:
       system: The planetary system (star + planets + disk).
       zodi: Optional zodiacal-light background (any
           :mod:`skyscapes.background` zodi variant).


   .. py:attribute:: system
      :type:  skyscapes.scene.system.System


   .. py:attribute:: zodi
      :type:  skyscapes.background.Zodi | None
      :value: None



   .. py:property:: star

      Convenience accessor for the host star.



   .. py:property:: planets

      Convenience accessor for the planet tuple.



   .. py:property:: disk

      Convenience accessor for the system's disk (may be ``None``).



   .. py:method:: __repr__()

      Tree-shaped summary of the contained system + zodi.



.. py:class:: Planet

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


   Composed planet: intrinsic params + orbit dynamics + physical-model physics.

   All stellar-context-dependent methods take a ``star`` keyword argument
   rather than holding a reference internally.  This keeps ``System`` as
   the single source of truth for the host star.

   Attributes:
       Rp_Rearth: Planet radius [Earth radii], shape ``(K,)``.
       Mp_Mearth: Planet mass [Earth masses], shape ``(K,)``.
       orbit: Orbital dynamics (trajectory parameterization).
       physical_model: Spectral physics (reflectivity / emission).


   .. py:attribute:: Rp_Rearth
      :type:  jaxtyping.Array


   .. py:attribute:: Mp_Mearth
      :type:  jaxtyping.Array


   .. py:attribute:: orbit
      :type:  orbix.system.orbit.AbstractOrbit


   .. py:attribute:: physical_model
      :type:  skyscapes.physical_model.AbstractPhysicalModel


   .. py:property:: n_planets
      :type: int


      Number of planets ``K`` carried by this composed module.



   .. py:method:: mean_anomaly(t_jd, *, star)

      Mean anomaly mod 360 [deg], shape ``(K, T)``.

      ``t_jd`` must be shape ``(T,)`` -- no rank polymorphism. Callers
      that hold a scalar should wrap it in ``jnp.asarray([t])`` at the
      call site.



   .. py:method:: propagate(trig_solver, t_jd, *, star)

      Delegate to ``orbit.propagate``; returns ``(r_AU, phase_rad, dist_AU)``.



   .. py:method:: position_arcsec(trig_solver, t_jd, *, star)

      On-sky position, shape ``(2, K, T)`` -- (dRA, dDec) in arcsec.



   .. py:method:: alpha_dMag(trig_solver, t_jd, *, star, wavelength_nm = 600.0)

      Projected separation [arcsec] and delta-mag, each ``(K, T)``.

      For ``LambertianPhysicalModel`` (grey), the chosen ``wavelength_nm``
      is irrelevant and the output matches ``orbix.Planets.alpha_dMag``
      by construction. For ``GridPhysicalModel`` / future wavelength-
      dependent models, ``dMag`` is evaluated at ``wavelength_nm``;
      pick a value within the model's spectral grid.



   .. py:method:: contrast(trig_solver, wavelength_nm, t_jd, *, star)

      Planet-to-star contrast at (wavelength, time), shape ``(K, T)``.



   .. py:method:: spec_flux_density(trig_solver, wavelength_nm, t_jd, *, star)

      Planet flux density [ph/s/m^2/nm], shape ``(K, T)``.



   .. py:method:: __repr__()

      Nested summary: planet count + intrinsic params + orbit + physical_model.



.. py:class:: AbstractStar

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


   Abstract stellar source.

   Attributes:
       Ms_kg: Stellar mass in kilograms.
       dist_pc: Distance to the star in parsecs.


   .. py:attribute:: Ms_kg
      :type:  equinox.AbstractVar[float]


   .. py:attribute:: dist_pc
      :type:  equinox.AbstractVar[float]


   .. py:method:: spec_flux_density(wavelength_nm, time_jd)
      :abstractmethod:


      Return spectral flux density in ph/s/m^2/nm.



.. py:class:: FlatStar

   Bases: :py:obj:`AbstractStar`


   Flat-spectrum star -- constant flux independent of wavelength or time.


   .. py:attribute:: Ms_kg
      :type:  float


   .. py:attribute:: dist_pc
      :type:  float


   .. py:attribute:: flux_phot_per_nm_m2
      :type:  float


   .. py:method:: spec_flux_density(wavelength_nm, time_jd)

      Constant flux, broadcast to wavelength_nm's shape.

      ``time_jd`` is part of the AbstractStar interface but ignored here.



   .. py:method:: __repr__()

      Compact one-line summary of mass, distance, and flux.



.. py:class:: Star(*, Ms_kg, dist_pc, wavelengths_nm, times_jd, flux_density_jy, ra_deg = 0.0, dec_deg = 0.0, diameter_arcsec = 0.0, luminosity_lsun = 1.0)

   Bases: :py:obj:`AbstractStar`


   Time- and wavelength-dependent star backed by an interpax 2D spline.


   .. py:attribute:: Ms_kg
      :type:  float


   .. py:attribute:: dist_pc
      :type:  float


   .. py:attribute:: ra_deg
      :type:  float


   .. py:attribute:: dec_deg
      :type:  float


   .. py:attribute:: diameter_arcsec
      :type:  float


   .. py:attribute:: luminosity_lsun
      :type:  float


   .. py:attribute:: _wavelengths_nm
      :type:  jaxtyping.Array


   .. py:attribute:: _times_jd
      :type:  jaxtyping.Array


   .. py:attribute:: _flux_density_phot
      :type:  jaxtyping.Array


   .. py:attribute:: _flux_interp
      :type:  interpax.Interpolator2D


   .. py:method:: spec_flux_density(wavelength_nm, time_jd)

      Scalar or array spectral flux density [ph/s/m^2/nm].



   .. py:method:: __repr__()

      One-line summary of metadata + wavelength/time grid extent.



.. py:class:: System

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


   Astrophysical scene: star + tuple of planets + optional disk.

   Attributes:
       star: Host star (``AbstractStar``).
       planets: Variable-length tuple of ``Planet``.
       trig_solver: Scalar Kepler-trig solver (static; see
           ``orbix.kepler.shortcuts.grid.get_grid_solver``). Required --
           callers must provide a built solver, not None.
       disk: Optional extended-source disk (``AbstractDisk | None``).
       midplane_inc_deg: System midplane inclination [deg] in the
           barycentric -> sky frame. Default 0.0 means "midplane = sky"
           and is intentionally indistinguishable from a real face-on
           system at this inclination; this ambiguity is acceptable
           because the field is diagnostic-only after load (no runtime
           hot path consults it). Populated by ``io.from_exovista``
           from the FITS star header. After load, frame rotation has
           already been baked into each ``Planet``'s orbital elements.
       midplane_pa_deg: System midplane position angle [deg]. Same
           semantics as ``midplane_inc_deg``.


   .. py:attribute:: star
      :type:  skyscapes.scene.star.AbstractStar


   .. py:attribute:: planets
      :type:  tuple[skyscapes.scene.planet.Planet, Ellipsis]


   .. py:attribute:: trig_solver
      :type:  collections.abc.Callable


   .. py:attribute:: disk
      :type:  skyscapes.disk.AbstractDisk | None
      :value: None



   .. py:attribute:: midplane_inc_deg
      :type:  float
      :value: 0.0



   .. py:attribute:: midplane_pa_deg
      :type:  float
      :value: 0.0



   .. py:property:: n_planets
      :type: int


      Total number of planets across all composed ``Planet`` modules.



   .. py:method:: positions(t_jd)

      Concatenated on-sky positions, shape ``(2, K_total, T)``.



   .. py:method:: contrasts(wavelength_nm, t_jd)

      Per-planet contrast, shape ``(K_total, T)``.



   .. py:method:: planet_flux_densities(wavelength_nm, t_jd)

      Per-planet flux density [ph/s/m^2/nm], shape ``(K_total, T)``.



   .. py:method:: alpha_dMag(t_jd)

      Per-planet projected separation + dMag, each shape ``(K_total, T)``.



   .. py:method:: __repr__()

      Tree-shaped summary: star + planets + disk + midplane geometry.



