prysm.convolution#

Recipes for numerical convolution.

prysm.convolution.conv(obj, psf)#

Convolve an object and psf.

Parameters:
  • obj (numpy.ndarray) – array representing the object, of shape (M, N)

  • psf (numpy.ndarray) – array representing the psf, of shape (M, N)

Returns:

ndarray after undergoing convolution

Return type:

numpy.ndarray

prysm.convolution.apply_transfer_functions(obj, dx, tfs, fx=None, fy=None, ft=None, fr=None, shift=False)#

Blur an object by N transfer functions.

Parameters:
  • obj (numpy.ndarray) – array representing the object, of shape (M, N)

  • dx (float) – sample spacing of the object. Ignored if fx, etc are defined.

  • tfs (sequence of callables, or arrays) – transfer functions. If a callable, should be functions which take arguments of any of fx, fy, ft, fr. Use functools partial or class methods to curry other parameters

  • fx (numpy.ndarray) – cartesian X frequency, shape (M, N)

  • fy (numpy.ndarray) – cartesian X frequency, shape (M, N)

  • fr (numpy.ndarray) – cartesian radial frequency, shape (M, N)

  • ft (numpy.ndarray) – cartesian azimuthal frequency, shape (M, N)

  • shift (bool, optional) – if True, fx, fy, ft, fr are assumed to have the origin in the center of the array, and tfs are expected to be consistent with that. If False, the origin is assumed to be the [0,0]th sample of fr, fx, fy.

Returns:

image after being blurred by each transfer function

Return type:

numpy.ndarray