prysm.fttools

Supplimental tools for computing fourier transforms.

prysm.fttools.pad2d(array, Q=2, value=0, mode='constant')

Symmetrically pads a 2D array with a value.

Parameters
  • array (numpy.ndarray) – source array

  • Q (float, optional) – oversampling factor; ratio of input to output array widths

  • value (float, optioanl) – value with which to pad the array

  • mode (str, optional) – mode, passed directly to np.pad

Returns

padded array

Return type

numpy.ndarray

Notes

padding will be symmetric.

prysm.fttools.forward_ft_unit(sample_spacing, samples, shift=True)

Compute the units resulting from a fourier transform.

Parameters
  • sample_spacing (float) – center-to-center spacing of samples in an array

  • samples (int) – number of samples in the data

  • shift (bool, optional) – whether to shift the output. If True, first element is a negative freq if False, first element is 0 freq.

Returns

array of sample frequencies in the output of an fft

Return type

numpy.ndarray