skyscapes.background.leinert
============================

.. py:module:: skyscapes.background.leinert

.. autoapi-nested-parse::

   Zodiacal light model based on Leinert et al. (1998).

   All functions are pure JAX and JIT-compatible.  Provides both position-dependent
   (Leinert Table 17) and wavelength-dependent (Table 19) zodiacal brightness.

   Migrated from orbix.observatory.zodiacal -- see that module's history for
   full references.



Attributes
----------

.. autoapisummary::

   skyscapes.background.leinert.AYO_DEFAULT_ZODI_MAG_V
   skyscapes.background.leinert.V_BAND_WAVELENGTH_NM
   skyscapes.background.leinert.LEINERT_BETA_DEG
   skyscapes.background.leinert.LEINERT_SOLAR_LON_DEG
   skyscapes.background.leinert.LEINERT_TABLE17
   skyscapes.background.leinert.LEINERT_WAVELENGTH_UM
   skyscapes.background.leinert.LEINERT_B_LAMBDA
   skyscapes.background.leinert._LOG_WAVELENGTH_UM
   skyscapes.background.leinert._LOG_B_LAMBDA
   skyscapes.background.leinert._LEINERT_TABLE17_FILLED
   skyscapes.background.leinert._REF_IDX
   skyscapes.background.leinert._REFERENCE_VALUE
   skyscapes.background.leinert._NORMALIZED_TABLE17


Functions
---------

.. autoapisummary::

   skyscapes.background.leinert._clamped_log10_um
   skyscapes.background.leinert._fill_sentinels
   skyscapes.background.leinert.zodi_color_correction
   skyscapes.background.leinert.leinert_zodi_factor
   skyscapes.background.leinert.leinert_zodi_spectral_radiance
   skyscapes.background.leinert.leinert_zodi_mag
   skyscapes.background.leinert.ayo_default_zodi_mag
   skyscapes.background.leinert.ayo_default_zodi_flux_jy
   skyscapes.background.leinert.create_zodi_spectrum_jax


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

.. py:data:: AYO_DEFAULT_ZODI_MAG_V
   :value: 22.0


.. py:data:: V_BAND_WAVELENGTH_NM
   :value: 550.0


.. py:data:: LEINERT_BETA_DEG

.. py:data:: LEINERT_SOLAR_LON_DEG

.. py:data:: LEINERT_TABLE17

.. py:data:: LEINERT_WAVELENGTH_UM

.. py:data:: LEINERT_B_LAMBDA

.. py:data:: _LOG_WAVELENGTH_UM

.. py:data:: _LOG_B_LAMBDA

.. py:function:: _clamped_log10_um(wavelength_nm)

   Log10(wavelength in um), clamped to the tabulated Table 19 range.

   interpax.interp1d defaults to extrap=False (NaN outside the knot range);
   clamping the query wavelength to the table's domain before interpolating
   means a wavelength outside Table 19's 0.2-140 um span resolves to the
   nearest tabulated edge value instead of NaN.


.. py:function:: _fill_sentinels(table)

   Fill near-Sun exclusion cells with the nearest valid value.

   Sentinel cells (-1) are filled along the elongation axis so lookups
   clamp instead of returning NaN.


.. py:data:: _LEINERT_TABLE17_FILLED

.. py:data:: _REF_IDX

.. py:data:: _REFERENCE_VALUE

.. py:data:: _NORMALIZED_TABLE17

.. py:function:: zodi_color_correction(wavelength_nm, reference_wavelength_nm = V_BAND_WAVELENGTH_NM, photon_units = True)

   Wavelength-dependent color correction from Leinert Table 19.

   Args:
       wavelength_nm: Target wavelength in nm.
       reference_wavelength_nm: Reference wavelength in nm.
       photon_units: If True, include lambda/lambda_ref factor for photon flux.

   Returns:
       Flux ratio (target / reference).


.. py:function:: leinert_zodi_factor(ecliptic_lat_deg, solar_lon_deg = 135.0)

   Position-dependent zodiacal brightness factor from Leinert Table 17.

   Returns brightness relative to (solar_lon=90 deg, ecliptic_lat=0 deg).

   Queries inside the near-Sun exclusion zone return the nearest tabulated
   brightness (clamped), not NaN.

   Args:
       ecliptic_lat_deg: Ecliptic latitude in degrees.
       solar_lon_deg: Solar longitude in degrees (default 135 deg for coronagraphs).

   Returns:
       Dimensionless brightness factor.


.. py:function:: leinert_zodi_spectral_radiance(wavelength_nm, ecliptic_lat_deg = 0.0, solar_lon_deg = 135.0)

   Zodiacal spectral radiance in W/(m^2 sr um) from Leinert tables.

   Args:
       wavelength_nm: Observation wavelength in nm.
       ecliptic_lat_deg: Ecliptic latitude in degrees.
       solar_lon_deg: Solar longitude in degrees.

   Returns:
       Spectral radiance in W/(m^2 sr um).


.. py:function:: leinert_zodi_mag(wavelength_nm, ecliptic_lat_deg = 0.0, solar_lon_deg = 135.0)

   Zodiacal surface brightness in mag/arcsec^2 from Leinert tables.

   Args:
       wavelength_nm: Observation wavelength in nm.
       ecliptic_lat_deg: Ecliptic latitude in degrees.
       solar_lon_deg: Solar longitude in degrees.

   Returns:
       Surface brightness in mag/arcsec^2.


.. py:function:: ayo_default_zodi_mag(wavelength_nm)

   AYO-default zodiacal brightness: 22 mag/arcsec^2 at V with color correction.

   Args:
       wavelength_nm: Observation wavelength in nm.

   Returns:
       Surface brightness in mag/arcsec^2.


.. py:function:: ayo_default_zodi_flux_jy(wavelength_nm)

   AYO-default zodiacal brightness in Jy/arcsec^2.

   The AYO 22 mag V-band figure is treated as AB and converted via
   hwoutils.conversions.mag_to_flux_jy (astropy-exact AB zero point). If a
   Johnson-V calibration is ever required, the AB<->Johnson-V offset is
   ~0.044 mag.

   Args:
       wavelength_nm: Observation wavelength in nm.

   Returns:
       Surface brightness in Jy/arcsec^2.


.. py:function:: create_zodi_spectrum_jax(wavelengths_nm, reference_flux_jy = None, reference_wavelength_nm = V_BAND_WAVELENGTH_NM)

   Create zodiacal light spectrum in Jy/arcsec^2 from reference flux.

   Args:
       wavelengths_nm: Array of wavelengths in nm.
       reference_flux_jy: Reference flux (default: 22 mag at V).
       reference_wavelength_nm: Reference wavelength in nm.

   Returns:
       Array of surface brightness in Jy/arcsec^2.


