elliptical_annulus_footprint

astroimtools.filtering.elliptical_annulus_footprint(a_inner, a_outer, b_inner, theta=0, dtype=<class 'int'>)[source]

Create an elliptical annulus footprint.

A pixel is considered to be entirely in or out of the footprint depending on whether its center is in or out of the footprint. The size of the output array is the minimal bounding box for the footprint.

Parameters:
a_innerint

The inner semimajor axis.

a_outerint

The outer semimajor axis.

b_innerint

The inner semiminor axis. The outer semiminor axis is calculated using the same axis ratio as the semimajor axis:

\[b_{outer} = b_{inner} \left( \frac{a_{outer}}{a_{inner}} \right)\]
thetafloat, optional

The rotation angle in radians of the semimajor axis. The angle is measured counterclockwise from the positive x axis.

dtypedata-type, optional

The data type of the output ndarray.

Returns:
footprintndarray

A footprint where array elements are 1 within the footprint and 0 otherwise.

Examples

>>> import numpy as np
>>> from astroimtools import elliptical_annulus_footprint
>>> elliptical_annulus_footprint(2, 4, 1, theta=np.pi/2.)
array([[0, 0, 1, 0, 0],
       [0, 1, 1, 1, 0],
       [0, 1, 0, 1, 0],
       [0, 1, 0, 1, 0],
       [1, 0, 0, 0, 1],
       [0, 1, 0, 1, 0],
       [0, 1, 0, 1, 0],
       [0, 1, 1, 1, 0],
       [0, 0, 1, 0, 0]])