Propagator Class

The Propagator class is used to store (but not generate) a propagator for wavefront propagation in holography. An instance of this class is returned by the pyholoscope.propagator(). function.

class pyholoscope.Propagator(propagator, wavelength=None, pixel_size=None, magnified_pixel_size=None, depth=None, magnified_depth=None, propagation_method=None, correct_pixel_size=None, source_distance=None)

Represents a propagator for wavefront propagation in holography.

Attributes:

propagator : 2D complex numpy array containing the propagator.

wavelength : The wavelength of the light used in the propagation (m).

pixel_size : The true physical size of the pixels in the hologram (m).

magnified_pixel_sizeThe effective pixel size used to generate the

propagator after any magnification correction (m).

depth : True propagation distance (m).

magnified_depthEffective propagation distance used to generate the

propagator after any magnification correction (m).

__init__(propagator, wavelength=None, pixel_size=None, magnified_pixel_size=None, depth=None, magnified_depth=None, propagation_method=None, correct_pixel_size=None, source_distance=None)

Initializes the Propagator instance by stoing the propagator and its attributes.

Parameters:

propagator: 2D complex numpy array containing the propagator.

Optional Keyword Arguments:
wavelength: float

The wavelength of the light (m).

pixel_size: float

The true size of the pixels in the hologram (m).

magnified_pixel_size: float

Effective pixel size used in propagator generation (m).

depth: float

True propagation distance (m).

magnified_depth: float

Effective propagation distance used in propagator generation (m).

propagation_method: str

Propagation model used to generate propagator (‘angular_spectrum’ or ‘fresnel’).

correct_pixel_size: bool

True if effective-magnification pixel-size correction was applied when generating this propagator.

source_distance: float or None

Source-to-camera distance used for pixel-size correction.

has_attributes(wavelength=None, pixel_size=None, magnified_pixel_size=None, depth=None, magnified_depth=None, propagation_method=None, correct_pixel_size=None, source_distance=None)

Checks if the propagator has the specified attributes.

Keyword arguments:
wavelengthfloat

The wavelength to check against (m).

pixel_sizefloat

The pixel size to check against (m).

depthfloat

The depth to check against (m).

Returns:
boolTrue if the propagator has all the specified attributes,

False otherwise.