hyperspy._signals.hologram_image module

class hyperspy._signals.hologram_image.HologramImage(*args, **kw)

Bases: hyperspy._signals.signal2d.Signal2D

Image subclass for holograms acquired via off-axis electron holography.

estimate_sideband_position(ap_cb_radius=None, sb='lower', show_progressbar=False, parallel=None)

Estimates the position of the sideband and returns its position.

Parameters:
  • ap_cb_radius (float, None) – The aperture radius used to mask out the centerband.
  • sb (str, optional) – Chooses which sideband is taken. ‘lower’ or ‘upper’
  • show_progressbar (boolean) – Shows progressbar while iterating over different slices of the signal (passes the parameter to map method).
  • parallel (bool) – Estimate the positions in parallel
Returns:

Return type:

Signal1D instance of sideband positions (y, x), referred to the unshifted FFT.

Examples

>>> import hyperspy.api as hs
>>> s = hs.datasets.example_signals.object_hologram()
>>> sb_position = s.estimate_sideband_position()
>>> sb_position.data

array([124, 452])

estimate_sideband_size(sb_position, show_progressbar=False, parallel=None)

Estimates the size of the sideband and returns its size.

Parameters:
  • sb_position (:class:`~hyperspy.signals.BaseSignal) – The sideband position (y, x), referred to the non-shifted FFT.
  • show_progressbar (boolean) – Shows progressbar while iterating over different slices of the signal (passes the parameter to map method).
  • parallel (bool) – Estimate the sizes in parallel
Returns:

Return type:

Signal 1D instance with sideband size, referred to the unshifted FFT.

Examples

>>> import hyperspy.api as hs
>>> s = hs.datasets.example_signals.object_hologram()
>>> sb_position = s.estimate_sideband_position()
>>> sb_size = s.estimate_sideband_size(sb_position)
>>> sb_size.data

array([ 68.87670143])

reconstruct_phase(reference=None, sb_size=None, sb_smoothness=None, sb_unit=None, sb='lower', sb_position=None, output_shape=None, plotting=False, show_progressbar=False, store_parameters=True, parallel=None)

Reconstruct electron holograms. Operates on multidimensional hyperspy signals. There are several usage schemes:

  1. Reconstruct 1d or Nd hologram without reference
  2. Reconstruct 1d or Nd hologram using single reference hologram

3. Reconstruct Nd hologram using Nd reference hologram (applies each reference to each hologram in Nd stack)

The reconstruction parameters (sb_position, sb_size, sb_smoothness) have to be 1d or to have same dimensionality as the hologram.

Parameters:
  • reference (ndarray, :class:`~hyperspy.signals.Signal2D, None) – Vacuum reference hologram.
  • sb_size (float, ndarray, :class:`~hyperspy.signals.BaseSignal, None) – Sideband radius of the aperture in corresponding unit (see ‘sb_unit’). If None, the radius of the aperture is set to 1/3 of the distance between sideband and center band.
  • sb_smoothness (float, ndarray, :class:`~hyperspy.signals.BaseSignal, None) – Smoothness of the aperture in the same unit as sb_size.
  • sb_unit (str, None) – Unit of the two sideband parameters ‘sb_size’ and ‘sb_smoothness’. Default: None - Sideband size given in pixels ‘nm’: Size and smoothness of the aperture are given in 1/nm. ‘mrad’: Size and smoothness of the aperture are given in mrad.
  • sb (str, None) – Select which sideband is selected. ‘upper’ or ‘lower’.
  • sb_position (tuple, :class:`~hyperspy.signals.Signal1D, None) – The sideband position (y, x), referred to the non-shifted FFT. If None, sideband is determined automatically from FFT.
  • output_shape (tuple, None) – Choose a new output shape. Default is the shape of the input hologram. The output shape should not be larger than the input shape.
  • plotting (boolean) – Shows details of the reconstruction (i.e. SB selection).
  • show_progressbar (boolean) – Shows progressbar while iterating over different slices of the signal (passes the parameter to map method).
  • parallel (bool) – Run the reconstruction in parallel
  • store_parameters (boolean) – Store reconstruction parameters in metadata
Returns:

wave – Reconstructed electron wave. By default object wave is devided by reference wave

Return type:

:class:`~hyperspy.signals.WaveImage

Examples

>>> import hyperspy.api as hs
>>> s = hs.datasets.example_signals.object_hologram()
>>> sb_position = s.estimate_sideband_position()
>>> sb_size = s.estimate_sideband_size(sb_position)
>>> sb_size.data
>>> wave = s.reconstruct_phase(sb_position=sb_position, sb_size=sb_size)
set_microscope_parameters(beam_energy=None, biprism_voltage=None, tilt_stage=None)

Set the microscope parameters.

If no arguments are given, raises an interactive mode to fill the values.

Parameters:
  • beam_energy (float) – The energy of the electron beam in keV
  • biprism_voltage (float) – In volts
  • tilt_stage (float) – In degrees

Examples

>>> s.set_microscope_parameters(beam_energy=300.)
>>> print('Now set to %s keV' %
>>>       s.metadata.Acquisition_instrument.
>>>       TEM.beam_energy)

Now set to 300.0 keV

class hyperspy._signals.hologram_image.LazyHologramImage(*args, **kw)

Bases: hyperspy._signals.lazy.LazySignal, hyperspy._signals.hologram_image.HologramImage