holospy.reconstruct#

holospy.reconstruct.aperture_function(r, apradius, rsmooth)#

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

Parameters:
rndarray

Array of input data (e.g. frequencies)

apradiusfloat

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

rsmoothfloat

Smoothness in halfwidth. rsmooth = 1 will cause a decay from 1 to 0 over 2 pixel.

Returns:
numpy.ndarray
holospy.reconstruct.estimate_sideband_position(data, sampling, central_band_mask_radius=None, sb='lower', high_cf=True)#

Finds the position of the sideband and returns its position.

Parameters:
datanumpy.ndarray

The data of the hologram.

samplingtuple

The sampling rate in both image directions.

central_band_mask_radiusfloat, optional

The aperture radius used to mask out the centerband.

sbstr, optional

Chooses which sideband is taken. ‘lower’, ‘upper’, ‘left’, or ‘right’.

high_cfbool, optional

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

Returns:
tuple

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

holospy.reconstruct.estimate_sideband_size(sb_position, shape, sb_size_ratio=0.5)#

Estimates the size of sideband filter

Parameters:
shapearray_like

Holographic data array

sb_positiontuple

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

sb_size_ratiofloat, optional

Size of sideband as a fraction of the distance to central band

Returns:
float

Size of sideband filter

holospy.reconstruct.freq_array(shape, sampling)#

Makes up a frequency array.

Parameters:
shapetuple

The shape of the array.

samplingtuple

The sampling rates of the array.

Returns:
numpy.ndarray

Frequencies

holospy.reconstruct.reconstruct(data, sampling, sb_size, sb_position, sb_smoothness, output_shape=None, plotting=False)#

Core function for holographic reconstruction.

Parameters:
dataarray_like

Holographic data array

samplingtuple

Sampling rate of the hologram in y and x direction.

sb_sizefloat

Size of the sideband filter in pixel.

sb_positiontuple

Sideband position in pixel.

sb_smoothnessfloat

Smoothness of the aperture in pixel.

output_shapetuple, optional

New output shape.

plottingbool

Plots the masked sideband used for reconstruction.

Returns:
numpy.ndarray

Reconstructed electron wave