microscopes module
- class PyLorentz.utils.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, scale=None, verbose=False)[source]
Bases:
objectClass 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.
- 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
- __init__(E=200000.0, Cs=1000000.0, Cc=5000000.0, theta_c=0.0006, Ca=0.0, phi_a=0, def_spr=120.0, scale=None, verbose=False)[source]
Constructs the Microscope object.
All arguments are optional. Set verbose=True to print microscope values.
- property scale: float
- get_optimum_defocus()[source]
Calculate the Optimum or Lichte defocus (for holography).
- Returns:
Optimum defocus (nm)
- Return type:
float
- get_transfer_function(scale=None, shape=None)[source]
Generate the full transfer function in reciprocal space
Args:
- Returns:
Transfer function. 2D array.
- Return type:
ndarray
- backpropagate_wave(ImgWave)[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.
- Returns:
Realspace object wave function. Complex 2D array same size as ObjWave.
- Return type:
ndarray
- compute_image(object_wave, padded_shape=None, pad_mode='reflect', symmetrize=False)[source]
Produce the image at the set defocus using the methods in this class.
- Parameters:
ObjWave (2D array) – Object wave function.
padded_shape (tuple | None, optional) – Shape for padding. Default is None.
pad_mode (str, optional) – mode passed to np.pad. Default is “edge”.
sym (bool, optional) – Whether or not to symmetrize the phase
- Returns:
Realspace image wave function. Real-valued 2D array same size as ObjWave.
- Return type:
ndarray