hwoutils.radial#
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#
|
Calculate radial distance from center for each pixel. |
|
Compute the radial profile of a 2D image. |
Module Contents#
- hwoutils.radial.radial_distance(shape, center=None)[source]#
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.
- Parameters:
shape (tuple[int, int])
center (tuple[float, float] | None)
- Return type:
jax.Array
- hwoutils.radial.radial_profile(image, pixel_scale_arcsec=1.0, center=None, nbins=None)[source]#
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.
- Parameters:
image (jax.Array)
pixel_scale_arcsec (float)
center (tuple[float, float] | None)
nbins (int | None)
- Return type:
tuple[jax.Array, jax.Array]