hyperspy.misc.holography.reconstruct module

hyperspy.misc.holography.reconstruct.aperture_function(r, apradius, rsmooth)

A smooth aperture function that decays from apradius-rsmooth to apradius+rsmooth.

Parameters
  • r (ndarray) – Array of input data (e.g. frequencies)

  • apradius (float) – Radius (center) of the smooth aperture. Decay starts at apradius - rsmooth.

  • rsmooth (float) – Smoothness in halfwidth. rsmooth = 1 will cause a decay from 1 to 0 over 2 pixel.

hyperspy.misc.holography.reconstruct.estimate_sideband_position(holo_data, holo_sampling, central_band_mask_radius=None, sb='lower', high_cf=True)

Finds the position of the sideband and returns its position.

Parameters
  • holo_data (ndarray) – The data of the hologram.

  • holo_sampling (tuple) – The sampling rate in both image directions.

  • central_band_mask_radius (float, optional) – The aperture radius used to mask out the centerband.

  • sb (str, optional) – Chooses which sideband is taken. ‘lower’, ‘upper’, ‘left’, or ‘right’.

  • high_cf (bool, optional) – If False, the highest carrier frequency allowed for the sideband location is equal to half of the Nyquist frequency (Default: True).

Returns

Return type

Tuple of the sideband position (y, x), referred to the unshifted FFT.

hyperspy.misc.holography.reconstruct.estimate_sideband_size(sb_position, holo_shape, sb_size_ratio=0.5)

Estimates the size of sideband filter

Parameters
  • holo_shape (array_like) – Holographic data array

  • sb_position (tuple) – The sideband position (y, x), referred to the non-shifted FFT.

  • sb_size_ratio (float, optional) – Size of sideband as a fraction of the distance to central band

Returns

sb_size – Size of sideband filter

Return type

float

hyperspy.misc.holography.reconstruct.freq_array(shape, sampling)

Makes up a frequency array.

Parameters
  • shape (tuple) – The shape of the array.

  • sampling (tuple) – The sampling rates of the array.

Returns

Return type

Array of the frequencies.

hyperspy.misc.holography.reconstruct.reconstruct(holo_data, holo_sampling, sb_size, sb_position, sb_smoothness, output_shape=None, plotting=False)

Core function for holographic reconstruction.

Parameters
  • holo_data (array_like) – Holographic data array

  • holo_sampling (tuple) – Sampling rate of the hologram in y and x direction.

  • sb_size (float) – Size of the sideband filter in pixel.

  • sb_position (tuple) – Sideband position in pixel.

  • sb_smoothness (float) – Smoothness of the aperture in pixel.

  • output_shape (tuple, optional) – New output shape.

  • plotting (boolean) – Plots the masked sideband used for reconstruction.

Returns

wav – Reconstructed electron wave

Return type

nparray