package documentation

Helper routines that calculate values or give information about arrays

Module grid Regrids a numpy array.
Module index Helpers for array operations involving indexing
Package mask Routines that use masks to assist in array operations
Module pad Padding operations
Module shift Helpers for array operations

From __init__.py:

Function apply_offset Apply offset to array a, shifting the elements with periodic boundary conditions
Function ensure_odd_shape Get a slice of array a such that each axis has an odd number of entries. The resulting slice is always the same size or smaller than a
Function get_centre_offset_brightest_pixel Get the offset from the centre of array a of the brightest element of a
Function indices_of_mask Get the indices that are masked by mask m
Function manhattan_distance Generate an array of shape where each element is the manhattan distances from point
Function manhattan_distance_mask Calculate a mask that is the manhattan distance dist from the array ii holding coord information, where the axis index_axis is has the N coordinates.
Function offsets_from_centre_of_mask Get the offsets to all masked elements of mask from the centre of mask.
Function offsets_from_point For an array of shape shape get the offsets from a specific point in array coordinates.
Function offsets_manhattan_distance Get the offsets required to visit each element of an array of dimension ndim that is dist manhattan distance away or less from a point.
Type Variable T Undocumented
def apply_offset(a: np.ndarray[S[N], T], offset: np.ndarray[[N], int]) -> np.ndarray[S[N], T]:

Apply offset to array a, shifting the elements with periodic boundary conditions

def ensure_odd_shape(a: np.ndarray[S[N], T], axes: tuple[int, ...] | None = None) -> np.ndarray[Q[N], T]:

Get a slice of array a such that each axis has an odd number of entries. The resulting slice is always the same size or smaller than a

def get_centre_offset_brightest_pixel(a: np.ndarray[S[N], T]) -> np.ndarray[[N], T]:

Get the offset from the centre of array a of the brightest element of a

def indices_of_mask(m: np.ndarray[S[N], bool]) -> tuple[np.ndarray[[N], int], ...]:

Get the indices that are masked by mask m

def manhattan_distance(shape: S[N], point: np.ndarray[[N], T] = None) -> np.ndarray[S[N], T]:

Generate an array of shape where each element is the manhattan distances from point

def manhattan_distance_mask(ii: np.ndarray[[*S[N], N, *Q[M]], T], dist: int | tuple[int, ...] = 1, index_axis: int = 0) -> np.ndarray[[*S[N], *Q[M]], T]:

Calculate a mask that is the manhattan distance dist from the array ii holding coord information, where the axis index_axis is has the N coordinates.

def offsets_from_centre_of_mask(mask: np.ndarray[S[N], bool]) -> np.ndarray[[N, *S[N]], int]:

Get the offsets to all masked elements of mask from the centre of mask.

def offsets_from_point(shape: S[N], point: np.ndarray[[N], T] = None, scale: S[N] = None) -> np.ndarray[S[N], T]:

For an array of shape shape get the offsets from a specific point in array coordinates.

def offsets_manhattan_distance(dist: int | tuple[int, ...] = 1, ndim: Literal[N] = 3) -> np.ndarray[[N, M], T]:

Get the offsets required to visit each element of an array of dimension ndim that is dist manhattan distance away or less from a point.

T =

Undocumented

Value
TypeVar('T')