yippy.stellar_intens
====================

.. py:module:: yippy.stellar_intens

.. autoapi-nested-parse::

   Module for handling stellar intensity data from stellar_intens files.



Classes
-------

.. autoapisummary::

   yippy.stellar_intens.StellarIntens


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

.. py:class:: StellarIntens(yip_dir, stellar_intens_file, stellar_diam_file)

   Class to handle and interpolate stellar intensity data.

   This class loads stellar intensity data and corresponding stellar diameters,
   providing an interpolation interface to get the stellar intensity map for a given
   stellar diameter.

   Attributes:
       ln_interp (CubicSpline):
           A spline interpolator that operates on the natural logarithm of the
           stellar intensities to ensure that interpolated values are non-negative.

   Args:
       yip_dir (Path):
           Path to the directory containing the yield input package (YIP).
       stellar_intens_file (str):
           Filename of the FITS file containing the stellar intensity data.
       stellar_diam_file (str):
           Filename of the FITS file containing the stellar diameters.


   .. py:attribute:: diams


   .. py:attribute:: psfs


   .. py:attribute:: ln_interp


   .. py:method:: __call__(stellar_diam, lam=None, D=None)

      Returns the stellar intensity map at a specified stellar diameter.

      Stellar intensity is interpolated based on a specified diameter using the
      previously configured cubic spline interpolator. The interpolation considers
      the logarithm of the intensity to ensure that all computed values are positive.

      Args:
          stellar_diam (Quantity):
              The desired stellar diameter for which to retrieve the intensity map, in
              units of lambda/D.
          lam (Quantity, optional):
              Wavelength of observation, required if stellar_diam is in angular units.
          D (Quantity, optional):
              Diameter of the telescope, required if stellar_diam is in angular units.

      Returns:
          NDArray:
              An interpolated 2D map of the stellar intensity at the given
              stellar diameter.



