coronalyze.interfaces
=====================

.. py:module:: coronalyze.interfaces

.. autoapi-nested-parse::

   Interface adapters for integrating with external packages.



Submodules
----------

.. toctree::
   :maxdepth: 1

   /autoapi/coronalyze/interfaces/coronagraphoto/index


Functions
---------

.. autoapisummary::

   coronalyze.interfaces.analyze_observation
   coronalyze.interfaces.extract_image
   coronalyze.interfaces.get_fwhm


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

.. py:function:: analyze_observation(image, planet_pos, wavelength_nm, diameter_m = 6.0, pixel_scale_mas = 21.8, max_apertures = 200)

   High-level analysis: compute Mawet SNR for a planet detection.

   Convenience wrapper that combines FWHM calculation with SNR computation.

   Args:
       image: 2D detector image.
       planet_pos: Planet position (y, x) in pixels.
       wavelength_nm: Observation wavelength in nanometers.
       diameter_m: Primary aperture diameter in meters.
       pixel_scale_mas: Pixel scale in milliarcseconds per pixel.
       max_apertures: Maximum buffer size for static array shapes.

   Returns:
       Signal-to-noise ratio using Mawet 2014 methodology.


.. py:function:: extract_image(detector_readout)

   Convert detector readout to an analysis-ready image.

   Currently a pass-through, but can be extended to handle:
   - Multiple detector planes
   - Unit conversions
   - Bad pixel masking

   Args:
       detector_readout: Raw detector output from coronagraphoto simulation.

   Returns:
       2D image array suitable for analysis.


.. py:function:: get_fwhm(wavelength_nm, diameter_m = 6.0, pixel_scale_mas = 21.8)

   Calculate the FWHM of the PSF in pixels.

   Uses the diffraction limit: FWHM ≈ λ/D

   Args:
       wavelength_nm: Observation wavelength in nanometers.
       diameter_m: Primary aperture diameter in meters.
       pixel_scale_mas: Pixel scale in milliarcseconds per pixel.

   Returns:
       FWHM in pixels.


