upsampled_dft

sofia_redux.toolkit.image.adjust.upsampled_dft(data, upsampled_region_size, upsample_factor=1, axis_offsets=None)[source]

Upsampled DFT by matrix multiplication.

This code is intended to provide the same result as if the following operations were performed:

  • Embed the array “data” in an array that is upsample_factor times larger in each dimension. ifftshift to bring the center of the image to (1,1).

  • Take the FFT of the larger array.

  • Extract an [upsampled_region_size] region of the result, starting with the [axis_offsets+1] element.

It achieves this result by computing the DFT in the output array without the need to zeropad. Much faster and memory efficient than the zero-padded FFT approach if upsampled_region_size is much smaller than data.size * upsample_factor.

Parameters:
dataarray

The input data array (DFT of original data) to upsample.

upsampled_region_sizeinteger or tuple of integers, optional

The size of the region to be sampled. If one integer is provided, it is duplicated up to the dimensionality of data.

upsample_factorinteger, optional

The upsampling factor. Defaults to 1.

axis_offsetstuple of integers, optional

The offsets of the region to be sampled. Defaults to None (uses image center)

Returns:
outputndarray

The upsampled DFT of the specified region.