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)

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 `callable`s, or arrays) – transfer functions. If an array, should be fftshifted with the origin in the center of the array. 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

  • fy, ft, fr (fx,) –

    arrays defining the frequency domain, of shape (M, N)

    cartesian X frequency cartesian Y frequency azimuthal frequency radial frequency

    The latter two are simply the atan2 of the former two.

Returns

image after being blurred by each transfer function

Return type

numpy.ndarray