radial_distance

astroimtools.utils.radial_distance(position, shape)[source]

Return an array where each value is the Euclidean distance from a given position.

Parameters:
positiontuple

An (x, y) tuple of pixel coordinates for the central position (i.e., zero radial distance).

shapetuple

The size of the output array along each axis.

Returns:
resultndarray

An array containing the Euclidean radial distances from the input position.

Examples

>>> from astroimtools import radial_distance
>>> radial_distance((1, 1), (3, 3))  
array([[1.41421356, 1.        , 1.41421356],
       [1.        , 0.        , 1.        ],
       [1.41421356, 1.        , 1.41421356]])