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) –

    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.

  • fy (numpy.ndarray) –

    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.

  • ft (numpy.ndarray) –

    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.

  • fr (numpy.ndarray) –

    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.

  • 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