get_recip_points#

diffsims.utils.fourier_transform.get_recip_points(ndim, n=None, dX=inf, rX=0, dY=inf, rY=1e-16)[source]#

Returns a minimal pair of real and Fourier grids which satisfy each given requirement.

Parameters:
  • ndim (int) – Dimension of domain

  • n (int, list of length ndim, or None , optional) – Sugested number of pixels (per dimension). default=`None` infers this from other parameters. If enough other constraints are given to define a discretisation then this will be shrunk if possible.

  • dX (float > 0 or list of float of length ndim, optional) – Maximum grid spacing (per dimension). default=`numpy.inf` infers this from other parameters

  • rX (float > 0 or list of float of length ndim, optional) – Minimum grid range (per dimension). default=`None` infers this from other parameters. In this case, range is maximal span, i.e. diameter.

  • dY (float > 0 or list of float of length ndim) – Maximum grid spacing (per dimension) in Fourier domain. default=`None` infers this from other parameters

  • rY (float > 0 or list of float of length ndim) – Minimum grid range (per dimension) in Fourier domain. default=`None` infers this from other parameters. In this case, range is maximal span, i.e. diameter.

Returns:

  • x (list [numpy.ndarray [float]], of shape [(nx,), (ny,), …]) – Real mesh of points, centred at 0 with at least n pixels, resolution higher than dX, and range greater than rX.

  • y (list [numpy.ndarray [float]], of shape [(nx,), (ny,), …]) – Fourier mesh of points, centred at 0 with at least n pixels, resolution higher than dY, and range greater than rY.