qem.zoom

Functions

fourier_interp2d(data, outinds[, nthreads, ...])

Use the fourier scaling theorem to interpolate (or extrapolate, without raising any exceptions) data.

zoom_nd(input_array[, offsets, ...])

Zoom in on the center of a 1D or 2D array using Fourier upsampling.

zoom_on_pixel(input_array, coordinates[, ...])

Zoom in on a 1D or 2D array using Fourier upsampling.

qem.zoom.zoom_on_pixel(input_array, coordinates, upsample_factor=1, output_shape=None, num_threads=1, use_numpy_fft=False, return_real=True, return_coordinates=False)[source]

Zoom in on a 1D or 2D array using Fourier upsampling.

Parameters:
  • (np.ndarray) (input_array)

  • floats) (coordinates (tuple of)

  • (int (num_threads)

  • optional) (If True, return the zoomed coordinates along with the zoomed array. Defaults to False.)

  • ints (output_shape (tuple of)

  • optional)

  • (int

  • optional)

  • (bool (return_coordinates)

  • optional)

  • (bool

  • optional)

  • (bool

  • optional)

Returns:

  • zoomed_array (np.ndarray) (The zoomed array upsampled by `upsampling_factor with size output_shape.`)

  • coordinates (np.ndarray, optional) (The coordinates of the zoomed region, if `return_coordinates is True.`)

qem.zoom.zoom_nd(input_array, offsets=(), center_convention=<class 'float'>, **kwargs)[source]

Zoom in on the center of a 1D or 2D array using Fourier upsampling.

Parameters:
  • (np.ndarray) (input_array)

  • floats (offsets (tuple of)

  • optional) (Function to determine the "center" of the array. Defaults to float.)

  • (function (center_convention)

  • optional)

  • **kwargs (Additional arguments passed to zoom_on_pixel.)

Returns:

  • zoomed_array (np.ndarray) (The zoomed array upsampled by `upsampling_factor with size output_shape.`)

  • coordinates (np.ndarray, optional) (The coordinates of the zoomed region, if `return_coordinates is True.`)

qem.zoom.fourier_interp2d(data, outinds, nthreads=1, use_numpy_fft=False, return_real=True)[source]

Use the fourier scaling theorem to interpolate (or extrapolate, without raising any exceptions) data.

Parameters:
  • data (ndarray) – The data values of the array to interpolate

  • outinds (ndarray) – The coordinate axis values along which the data should be interpolated CAN BE: ndim x [n,m,…] like np.indices OR (less memory intensive, more processor intensive) ([n],[m],…)