acryo.backend package
Module contents
- class acryo.backend.AnyArray[source]
Bases:
Generic
[acryo.backend._api._T
]Type representing a ndarray of numpy or cupy (or any other array that has similar API).
- astype(dtype: type[_T1]) acryo.backend._api.AnyArray[acryo.backend._api._T1] [source]
- conj() acryo.backend._api.AnyArray[acryo.backend._api._T] [source]
- dot(other: acryo.backend._api.AnyArray[acryo.backend._api._T]) acryo.backend._api.AnyArray[acryo.backend._api._T] [source]
- property dtype: numpy.dtype[acryo.backend._api._T]
- property imag: acryo.backend._api.AnyArray[numpy.float32]
- mean(axis: None = None) _T
- mean(axis: int | tuple[int, ...]) AnyArray[_T]
Helper for @overload to raise when called.
- property ndim: int
- property real: acryo.backend._api.AnyArray[numpy.float32]
- property shape: tuple[int, ...]
- class acryo.backend.Backend(name: str | None = None)[source]
Bases:
object
- affine_transform(img, matrix, output_shape: tuple[int, ...] | None = None, output=None, order: int = 3, mode: str = 'constant', cval: float = 0.0, prefilter: bool = True) acryo.backend._api.AnyArray[numpy.float32] [source]
Affine transform.
- arange(*args, dtype: type[_T], **kwargs) acryo.backend._api.AnyArray[acryo.backend._api._T] [source]
- arange(*args, dtype: None = 'None', **kwargs) acryo.backend._api.AnyArray
Return evenly spaced values within a given interval.
- argmax(x: acryo.backend._api.AnyArray[acryo.backend._api._T], axis: None = None) numpy.int64 [source]
- argmax(x: acryo.backend._api.AnyArray[acryo.backend._api._T], axis: int | tuple[int, ...]) acryo.backend._api.AnyArray[numpy.int64]
- argmin(x: acryo.backend._api.AnyArray[acryo.backend._api._T], axis: None = None) numpy.int64 [source]
- argmin(x: acryo.backend._api.AnyArray[acryo.backend._api._T], axis: int | tuple[int, ...]) acryo.backend._api.AnyArray[numpy.int64]
- array(x, dtype: type[_T] | numpy.dtype[acryo.backend._api._T]) acryo.backend._api.AnyArray[acryo.backend._api._T] [source]
- array(x: Union[acryo.backend._api.AnyArray[acryo.backend._api._T], numpy.ndarray[Any, numpy.dtype[acryo.backend._api._T]]], dtype: None = None) acryo.backend._api.AnyArray[acryo.backend._api._T]
Convert to numpy array.
- asarray(x, dtype: type[_T] | numpy.dtype[acryo.backend._api._T]) acryo.backend._api.AnyArray[acryo.backend._api._T] [source]
- asarray(x: Union[acryo.backend._api.AnyArray[acryo.backend._api._T], numpy.ndarray[Any, numpy.dtype[acryo.backend._api._T]]], dtype: None = None) acryo.backend._api.AnyArray[acryo.backend._api._T]
Convert to numpy array.
- asnumpy(x: Union[acryo.backend._api.AnyArray[acryo.backend._api._T], numpy.ndarray[Any, numpy.dtype[acryo.backend._api._T]]]) numpy.ndarray[Any, numpy.dtype[acryo.backend._api._T]] [source]
Convert to numpy array.
- cumsum(x: acryo.backend._api.AnyArray[acryo.backend._api._T], axis: int | None = None) acryo.backend._api.AnyArray[acryo.backend._api._T] [source]
- exp(x: acryo.backend._api.AnyArray[acryo.backend._api._T]) acryo.backend._api.AnyArray[acryo.backend._api._T] [source]
Return the exponential of an array.
- fftfreq(n: int, d: float = 1.0) acryo.backend._api.AnyArray[numpy.float64] [source]
Return the Discrete Fourier Transform sample frequencies.
- fftn(x: Union[acryo.backend._api.AnyArray[numpy.float32], acryo.backend._api.AnyArray[numpy.complex64]], s: tuple[int, int, int] | None = None, axes: int | tuple[int, ...] | None = None) acryo.backend._api.AnyArray[numpy.complex64] [source]
N-dimensional FFT.
- fftshift(x: acryo.backend._api.AnyArray[acryo.backend._api._T], axes=None) acryo.backend._api.AnyArray[acryo.backend._api._T] [source]
Shift zero-frequency component to center.
- fix(x: acryo.backend._api.AnyArray[acryo.backend._api._T]) acryo.backend._api.AnyArray[acryo.backend._api._T] [source]
Round to nearest integer towards zero.
- full(shape: int | tuple[int, ...], fill_value: Any, dtype: type[_T] | numpy.dtype[acryo.backend._api._T] | None = None) acryo.backend._api.AnyArray[acryo.backend._api._T] [source]
Return a new array of given shape and type, filled with fill_value.
- ifftn(x: Union[acryo.backend._api.AnyArray[numpy.float32], acryo.backend._api.AnyArray[numpy.complex64]], s: tuple[int, int, int] | None = None, axes: int | tuple[int, ...] | None = None) acryo.backend._api.AnyArray[numpy.complex64] [source]
N-dimensional inverse FFT.
- ifftshift(x: acryo.backend._api.AnyArray[acryo.backend._api._T], axes=None) acryo.backend._api.AnyArray[acryo.backend._api._T] [source]
Inverse shift zero-frequency component to center.
- indices(shape: tuple[int], dtype: type[_T] = np.int32) tuple[acryo.backend._api.AnyArray[_T]] [source]
- indices(shape: tuple[int, int], dtype: type[_T] = np.int32) tuple[acryo.backend._api.AnyArray[_T], acryo.backend._api.AnyArray[_T]]
- indices(shape: tuple[int, int, int], dtype: type[_T] = np.int32) tuple[acryo.backend._api.AnyArray[_T], acryo.backend._api.AnyArray[_T], acryo.backend._api.AnyArray[_T]]
- indices(shape: tuple[int, ...], dtype: type[_T] = np.int32) tuple[acryo.backend._api.AnyArray[_T], ...]
Return an array representing the indices of a grid.
- irfftn(x: acryo.backend._api.AnyArray[numpy.complex64], s: tuple[int, int, int] | None = None, axes: int | tuple[int, ...] | None = None) acryo.backend._api.AnyArray[numpy.float32] [source]
N-dimensional inverse FFT of real part.
- lowpass_filter(img, cutoff, order: int = 2) acryo.backend._api.AnyArray[numpy.float32] [source]
Lowpass filter in real space.
- lowpass_filter_ft(img, cutoff, order: int = 2) acryo.backend._api.AnyArray[numpy.complex64] [source]
Lowpass filter in Fourier space.
- map_coordinates(x: acryo.backend._api.AnyArray[acryo.backend._api._T], coords: acryo.backend._api.AnyArray[acryo.backend._api._T], order: int = 3, mode: str = 'constant', cval: float = - 1.0, prefilter: bool = True) acryo.backend._api.AnyArray[acryo.backend._api._T] [source]
- max(x: acryo.backend._api.AnyArray[acryo.backend._api._T], axis: None = None) acryo.backend._api._T [source]
- max(x: acryo.backend._api.AnyArray[acryo.backend._api._T], axis: int | tuple[int, ...]) acryo.backend._api.AnyArray[acryo.backend._api._T]
Return the maximum of an array or maximum along an axis.
- maycopy(x: acryo.backend._api.AnyArray[acryo.backend._api._T]) acryo.backend._api.AnyArray[acryo.backend._api._T] [source]
- mean(x: acryo.backend._api.AnyArray[acryo.backend._api._T], axis: None = None) acryo.backend._api._T [source]
- mean(x: acryo.backend._api.AnyArray[acryo.backend._api._T], axis: int | tuple[int, ...]) acryo.backend._api.AnyArray[acryo.backend._api._T]
Return the mean of array elements over a given axis.
- meshgrid(x0: acryo.backend._api.AnyArray[acryo.backend._api._T], copy: bool = True, sparse: bool = False, indexing: Literal['xy', 'ij'] = 'xy') tuple[acryo.backend._api.AnyArray[_T]] [source]
- meshgrid(x0: acryo.backend._api.AnyArray[acryo.backend._api._T], x1: acryo.backend._api.AnyArray[acryo.backend._api._T], copy: bool = True, sparse: bool = False, indexing: Literal['xy', 'ij'] = 'xy') tuple[acryo.backend._api.AnyArray[_T], acryo.backend._api.AnyArray[_T]]
- meshgrid(x0: acryo.backend._api.AnyArray[acryo.backend._api._T], x1: acryo.backend._api.AnyArray[acryo.backend._api._T], x2: acryo.backend._api.AnyArray[acryo.backend._api._T], copy: bool = True, sparse: bool = False, indexing: Literal['xy', 'ij'] = 'xy') tuple[acryo.backend._api.AnyArray[_T], acryo.backend._api.AnyArray[_T], acryo.backend._api.AnyArray[_T]]
Return coordinate matrices from coordinate vectors.
- min(x: acryo.backend._api.AnyArray[acryo.backend._api._T], axis: None = None) acryo.backend._api._T [source]
- min(x: acryo.backend._api.AnyArray[acryo.backend._api._T], axis: int | tuple[int, ...]) acryo.backend._api.AnyArray[acryo.backend._api._T]
Return the minimum of an array or minimum along an axis.
- missing_wedge_mask(rotator: scipy.spatial.transform._rotation.Rotation, tilt_range: tuple[float, float], shape: tuple[int, int, int])[source]
- property name: str
- pad(x: acryo.backend._api.AnyArray[acryo.backend._api._T], pad_width: Union[int, Sequence[int], Sequence[tuple[int, int]]], mode: str = 'constant', constant_values: float = 0.0) acryo.backend._api.AnyArray[acryo.backend._api._T] [source]
Pad an array.
- percentile(x: acryo.backend._api.AnyArray[acryo.backend._api._T], q: float, axis: None = None) acryo.backend._api._T [source]
- percentile(x: acryo.backend._api.AnyArray[acryo.backend._api._T], q: float, axis: int | tuple[int, ...]) acryo.backend._api.AnyArray[acryo.backend._api._T]
Compute the q-th percentile of the data along the specified axis.
- rfftn(x: acryo.backend._api.AnyArray[numpy.float32], s: tuple[int, int, int] | None = None, axes: int | tuple[int, ...] | None = None) acryo.backend._api.AnyArray[numpy.complex64] [source]
N-dimensional FFT of real part.
- rotated_crop(subimg, mtx: numpy.ndarray[Any, numpy.dtype[numpy.float32]], shape: tuple[int, int, int], order: int, cval: Union[float, Callable[[acryo.backend._api.AnyArray[numpy.float32]], Any]]) acryo.backend._api.AnyArray[numpy.float32] [source]
- spline_filter(input, order: int = 3, output: type[~_T] = <class 'numpy.float64'>, mode: str = 'mirror') acryo.backend._api.AnyArray[acryo.backend._api._T] [source]
- sqrt(x: acryo.backend._api.AnyArray[acryo.backend._api._T]) acryo.backend._api.AnyArray[acryo.backend._api._T] [source]
Return the non-negative square-root of an array.
- stack(arrays: Sequence[acryo.backend._api.AnyArray[acryo.backend._api._T]], axis: int = 0) acryo.backend._api.AnyArray[acryo.backend._api._T] [source]
Stack arrays in sequence along a new axis.
- sum(x: acryo.backend._api.AnyArray[acryo.backend._api._T], axis: None = None) acryo.backend._api._T [source]
- sum(x: acryo.backend._api.AnyArray[acryo.backend._api._T], axis: int | tuple[int, ...]) acryo.backend._api.AnyArray[acryo.backend._api._T]
Return the sum of array elements over a given axis.
- tensordot(a: acryo.backend._api.AnyArray[acryo.backend._api._T], b: acryo.backend._api.AnyArray[acryo.backend._api._T], axes: int | tuple[int, ...] = 2) acryo.backend._api.AnyArray[acryo.backend._api._T] [source]
Return tensor dot product of two arrays.
- unravel_index(indices, shape: tuple[int, ...]) acryo.backend._api.AnyArray[numpy.int64] [source]
Converts a flat index into a tuple of coordinate arrays.
- zeros(shape: int | tuple[int, ...], dtype: type[_T] | numpy.dtype[acryo.backend._api._T] | None = None) acryo.backend._api.AnyArray[acryo.backend._api._T] [source]
Return a new array of given shape and type, filled with zeros.