pynfft.util - Utility functions

Functions used for initialization of pynfft.NFFT attributes in test scripts. For instance:

>>> from pynfft.util import vrand_unit_complex, vrand_shifted_unit_double
>>> x = np.empty(20, dtype=np.float64)
>>> vrand_shifted_unit_double(x)
>>> f_hat = np.empty(16, dtype=np.complex128)
>>> vrand_unit_complex(f_hat)
pynfft.util.vrand_unit_complex(x)

Utilitary function for initializing a vector of knots to random values within the range [-0.5, 0.5).

Used for testing pynfft.NFFT.x.

Parameters:x (ndarray <complex128>) – pre-allocated array
pynfft.util.vrand_shifted_unit_double(x)

Utilitary function for initializing a vector of data to random complex values within the range [0, 1).

Used for testing pynfft.NFFT.f and pynfft.NFFT.f_hat.

Parameters:x (ndarray <float64>) – pre-allocated array

Functions used for computing the density compensation weights necessary for the iterative solver and adjoint NFFT.

pynfft.util.voronoi_weights_1d(w, x)

Utilitary function for computing density compensation weights from 1D knots.

Parameters:
  • w (ndarray <float64>) – pre-allocated array
  • x (ndarray <float64>) – ordered 1D knots
pynfft.util.voronoi_weights_S2(w, xi)

Utilitary function for computing density compensation weights from knots located on the surface of a sphere.

Useful for reconstruction of 3D radial data.

Parameters:
  • w (ndarray <float64>) – pre-allocated array
  • xi (ndarray <float64>) – angular locations (2D) on the unit sphere

Previous topic

pynfft.solver - iterative solver for inverse NFFT

This Page