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 |
Apply offset to array a, shifting the elements with periodic boundary conditions |
| Function | ensure |
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 |
Get the offset from the centre of array a of the brightest element of a |
| Function | indices |
Get the indices that are masked by mask m |
| Function | manhattan |
Generate an array of shape where each element is the manhattan distances from point |
| Function | manhattan |
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 |
Get the offsets to all masked elements of mask from the centre of mask. |
| Function | offsets |
For an array of shape shape get the offsets from a specific point in array coordinates. |
| Function | offsets |
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 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 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_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.