hwoutils.radial
===============

.. py:module:: hwoutils.radial

.. autoapi-nested-parse::

   Radial utilities for image analysis.

   Functions for computing radial distance grids and extracting radial profiles
   from 2D images. All functions are JIT-compilable and differentiable.



Functions
---------

.. autoapisummary::

   hwoutils.radial.radial_distance
   hwoutils.radial.radial_profile


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

.. py:function:: radial_distance(shape, center = None)

   Calculate radial distance from center for each pixel.

   Args:
       shape: Image shape (ny, nx).
       center: Center coordinates (cy, cx). If None, uses geometric center
           ``((ny-1)/2, (nx-1)/2)``.

   Returns:
       2D array of radial distances in pixels.


.. py:function:: radial_profile(image, pixel_scale_arcsec = 1.0, center = None, nbins = None)

   Compute the radial profile of a 2D image.

   Bins pixels by their distance from center and computes the mean value
   in each radial bin.

   Args:
       image: 2D input image.
       pixel_scale_arcsec: Conversion factor from pixels to physical units
           (e.g. λ/D per pixel). Default 1.0 gives bins in pixels.
       center: Center coordinates (cy, cx). If None, uses geometric center.
       nbins: Number of radial bins. If None, uses ``floor(max_dim / 2)``.

   Returns:
       ``(separations, profile)`` where separations are bin centers in
       physical units and profile is the mean value in each bin.


