microscopes module

A class for microscope objects.

Author: CD Phatak, ANL, 20.Feb.2015.

class microscopes.Microscope(E=200000.0, Cs=1000000.0, Cc=5000000.0, theta_c=0.0006, Ca=0.0, phi_a=0, def_spr=120.0, verbose=False)[source]

Bases: object

Class for Microscope objects.

A class that describes a microscope for image simulation and reconstruction purposes. Along with accelerating voltage, aberrations, and other parameters, this also contains methods for propagating the electron wave and simulating images.

Notes:

  • When initializing a Microscope you can set verbose=True to get a printout of the parameters.
  • Unlike in TIE_reconstruct, here the qq frequency spectrum is expected to be shifted, i.e. rather than four dark corners it’s a dark circle.
E

Accelerating voltage (V). Default 200kV.

Type:float
Cs

Spherical aberration (nm). Default 1mm.

Type:float
Cc

Chromatic aberration (nm). Default 5mm.

Type:float
theta_c

Beam coherence (rad). Default 0.6mrad.

Type:float
Ca

2-fold astigmatism (nm). Default 0.

Type:float
phi_a

2-fold astigmatism angle (rad). Default 0.

Type:float
def_spr

Defocus spread (nm). Default 120nm.

Type:float
defocus

Defocus of the microscope (nm). Default 0nm.

Type:float
lam

Electron wavelength (nm) calculated from E. Default 2.51pm.

Type:float
gamma

Relativistic factor (unitless) from E. Default 1.39.

Type:float
sigma

Interaction constant (1/(V*nm)) from E. Default 0.00729.

Type:float
BackPropagateWave(ImgWave, qq, del_px)[source]

Back-propagate an image wave to get the object wave.

This function will back-propagate the image wave function to the object wave plane by convolving with exp(+i*Chiq). The damping envelope is not used for back propagation. Returns ObjWave in real space.

Parameters:
  • ObjWave (2D array) – Object wave function.
  • qq (2D array) – Frequency array
  • del_px (float) – Scale (nm/pixel)
Returns:

Realspace object wave function. Complex 2D array same size as ObjWave.

Return type:

ndarray

PropagateWave(ObjWave, qq, del_px)[source]

Propagate object wave function to image plane.

This function will propagate the object wave function to the image plane by convolving with the transfer function of microscope, and returns the complex real-space ImgWave

Parameters:
  • ObjWave (2D array) – Object wave function.
  • qq (2D array) – Frequency array
  • del_px (float) – Scale (nm/pixel)
Returns:

Realspace image wave function. Complex 2D array same size as ObjWave.

Return type:

ndarray

getBFPImage(ObjWave, qq, del_px)[source]

Produce the image in the backfocal plane (diffraction)

Parameters:
  • ObjWave (2D array) – Object wave function.
  • qq (2D array) – Frequency array
  • del_px (float) – Scale (nm/pixel)
Returns:

Realspace image wave function. Real-valued 2D array same size as ObjWave.

Return type:

ndarray

getChiQ(qq, del_px)[source]

Calculate the phase transfer function.

Parameters:
  • qq (2D array) – Frequency array
  • del_px (float) – Scale (nm/pixel)
Returns:

2D array same size as qq.

Return type:

ndarray

getDampEnv(qq, del_px)[source]

Calculate the complete damping envelope: spatial + temporal

Parameters:
  • qq (2D array) – Frequency array
  • del_px (float) – Scale (nm/pixel)
Returns:

Damping envelope. 2D array same size as qq.

Return type:

ndarray

getImage(ObjWave, qq, del_px)[source]

Produce the image at the set defocus using the methods in this class.

Parameters:
  • ObjWave (2D array) – Object wave function.
  • qq (2D array) – Frequency array
  • del_px (float) – Scale (nm/pixel)
Returns:

Realspace image wave function. Real-valued 2D array same size as ObjWave.

Return type:

ndarray

getOptDef(qq, del_px)[source]

Calculate the Optimum or Lichte defocus (for holography).

Parameters:
  • qq (2D array) – Frequency array
  • del_px (float) – Scale (nm/pixel)
Returns:

Optimum defocus (nm)

Return type:

float

getSchDef()[source]

Calculate the Scherzer defocus

getTransferFunction(qq, del_px)[source]

Generate the full transfer function in reciprocal space

Parameters:
  • qq (2D array) – Frequency array
  • del_px (float) – Scale (nm/pixel)
Returns:

Transfer function. 2D array same size as qq.

Return type:

ndarray

setAperture(qq, del_px, sz)[source]

Set the objective aperture

Parameters:
  • qq (2D array) – Frequency array
  • del_px (float) – Scale (nm/pixel)
  • sz (float) – Aperture size (nm).
Returns:

Sets self.aperture.

Return type:

None