circular_footprint#
- rojak.atmosphere.regions.circular_footprint(radius)[source]#
Create a circular boolean footprint for use with
scipymorphological filters.- Parameters:
radius (int) – Radius of the circle in grid points.
- Returns:
A boolean NumPy ndarray of shape
(2*radius+1, 2*radius+1)whereTruevalues represent points within the circle.- Return type:
- Raises:
ValueError – If
radiusis \(\leq 0\).
Example: >>> footprint = circular_footprint(radius=2) >>> footprint.astype(int) array([[0, 0, 1, 0, 0],
[0, 1, 1, 1, 0], [1, 1, 1, 1, 1], [0, 1, 1, 1, 0], [0, 0, 1, 0, 0]])