de_twin.optics.OpticsConfig#
- class de_twin.optics.OpticsConfig(fallback_pixel_nm: 'float' = 1.0, fallback_recip_inv_nm: 'float' = 0.04, pixel_size_override_nm: 'float' = 0.0, post_magnification: 'float' = 1.0, geometric_diffraction: 'bool' = True, default_camera_length_mm: 'float' = 250.0, stage_offset_um: 'tuple[float, float, float]'=(0.0, 0.0, 0.0), defocus_offset_um: 'float' = 0.0, eucentric_height_um: 'float' = 0.0, flip_x: 'bool' = False, flip_y: 'bool' = False, render_mode_override: 'RenderMode | None' = None, max_raster_pixels: 'int' = 1048576, illumination_semi_angle_mrad: 'float' = 0.0, sa_aperture_um: 'float' = 10.0, tem_illuminated_area_um: 'float' = 0.0, stem_default_convergence_mrad: 'float' = 10.0, probe_d0_nm: 'float' = 0.0, reference_current_pa: 'float' = 600.0, reference_spot: 'int' = 3, spot_exponent: 'float' = 2.0, probe_mode_current_factor: 'dict' = <factory>, stem_current_factor: 'float' = 0.05, condenser_apertures_um: 'tuple[float, ...]'=(150.0, 70.0, 50.0, 10.0), reference_condenser_index: 'int' = 1, illum_min_diameter_um: 'float' = 0.1, illum_max_diameter_um: 'float' = 100.0, illum_reference_alpha_mrad: 'float' = 0.1, illum_reference_diameter_um: 'float' = 3.1623, nanoprobe_illuminated_um: 'float' = 0.2, lowmag_illumination_factor: 'float' = 30.0, intensity_zoom: 'bool' = False, intensity_zoom_reference_mag: 'float' = 20000.0, realism: 'ColumnRealism | None' = None, cs_mm: 'float' = 1.2, cc_mm: 'float' = 1.4, energy_spread_ev: 'float' = 0.7, objective_aperture_mrad: 'float' = 0.0, stig_nm_per_unit: 'float' = 1000.0, objective_stig_zero: 'tuple[float, float]'=(0.0, 0.0), condenser_stig_nm_per_unit: 'float' = 1000.0, condenser_stig_zero: 'tuple[float, float]'=(0.0, 0.0), stem_source_size_nm: 'float' = 0.04)[source]#
Bases:
object- Parameters:
fallback_pixel_nm (float)
fallback_recip_inv_nm (float)
pixel_size_override_nm (float)
post_magnification (float)
geometric_diffraction (bool)
default_camera_length_mm (float)
defocus_offset_um (float)
eucentric_height_um (float)
flip_x (bool)
flip_y (bool)
render_mode_override (RenderMode | None)
max_raster_pixels (int)
illumination_semi_angle_mrad (float)
sa_aperture_um (float)
tem_illuminated_area_um (float)
stem_default_convergence_mrad (float)
probe_d0_nm (float)
reference_current_pa (float)
reference_spot (int)
spot_exponent (float)
probe_mode_current_factor (dict)
stem_current_factor (float)
reference_condenser_index (int)
illum_min_diameter_um (float)
illum_max_diameter_um (float)
illum_reference_alpha_mrad (float)
illum_reference_diameter_um (float)
nanoprobe_illuminated_um (float)
lowmag_illumination_factor (float)
intensity_zoom (bool)
intensity_zoom_reference_mag (float)
realism (ColumnRealism | None)
cs_mm (float)
cc_mm (float)
energy_spread_ev (float)
objective_aperture_mrad (float)
stig_nm_per_unit (float)
condenser_stig_nm_per_unit (float)
stem_source_size_nm (float)
- __init__(fallback_pixel_nm=1.0, fallback_recip_inv_nm=0.04, pixel_size_override_nm=0.0, post_magnification=1.0, geometric_diffraction=True, default_camera_length_mm=250.0, stage_offset_um=(0.0, 0.0, 0.0), defocus_offset_um=0.0, eucentric_height_um=0.0, flip_x=False, flip_y=False, render_mode_override=None, max_raster_pixels=1048576, illumination_semi_angle_mrad=0.0, sa_aperture_um=10.0, tem_illuminated_area_um=0.0, stem_default_convergence_mrad=10.0, probe_d0_nm=0.0, reference_current_pa=600.0, reference_spot=3, spot_exponent=2.0, probe_mode_current_factor=<factory>, stem_current_factor=0.05, condenser_apertures_um=(150.0, 70.0, 50.0, 10.0), reference_condenser_index=1, illum_min_diameter_um=0.1, illum_max_diameter_um=100.0, illum_reference_alpha_mrad=0.1, illum_reference_diameter_um=3.1623, nanoprobe_illuminated_um=0.2, lowmag_illumination_factor=30.0, intensity_zoom=False, intensity_zoom_reference_mag=20000.0, realism=None, cs_mm=1.2, cc_mm=1.4, energy_spread_ev=0.7, objective_aperture_mrad=0.0, stig_nm_per_unit=1000.0, objective_stig_zero=(0.0, 0.0), condenser_stig_nm_per_unit=1000.0, condenser_stig_zero=(0.0, 0.0), stem_source_size_nm=0.04)#
- Parameters:
fallback_pixel_nm (float)
fallback_recip_inv_nm (float)
pixel_size_override_nm (float)
post_magnification (float)
geometric_diffraction (bool)
default_camera_length_mm (float)
defocus_offset_um (float)
eucentric_height_um (float)
flip_x (bool)
flip_y (bool)
render_mode_override (RenderMode | None)
max_raster_pixels (int)
illumination_semi_angle_mrad (float)
sa_aperture_um (float)
tem_illuminated_area_um (float)
stem_default_convergence_mrad (float)
probe_d0_nm (float)
reference_current_pa (float)
reference_spot (int)
spot_exponent (float)
probe_mode_current_factor (dict)
stem_current_factor (float)
reference_condenser_index (int)
illum_min_diameter_um (float)
illum_max_diameter_um (float)
illum_reference_alpha_mrad (float)
illum_reference_diameter_um (float)
nanoprobe_illuminated_um (float)
lowmag_illumination_factor (float)
intensity_zoom (bool)
intensity_zoom_reference_mag (float)
realism (ColumnRealism | None)
cs_mm (float)
cc_mm (float)
energy_spread_ev (float)
objective_aperture_mrad (float)
stig_nm_per_unit (float)
condenser_stig_nm_per_unit (float)
stem_source_size_nm (float)
- Return type:
None
Methods
__init__([fallback_pixel_nm, ...])realistic([seed])A column as imperfect as a real one (
de_twin.optics.realism), reproducibly.Attributes
in TEM imaging the condenser follows the magnification, so the illuminated area keeps its size relative to the field of view and the dose per detector pixel stays put as the operator zooms.
The largest raster a TEM image is rendered at (pixels); a bigger frame is upsampled from it (OpticsState.raster_downsample says by how much).
The post-column magnification the camera sits behind (the DE camera as a second camera is about 1.25 to 1.5x; behind an energy filter it is larger).
A real column's geometry (image rotation, true pixel size, image-shift matrices, magnification offsets, backlash): what SerialEM's calibrations measure.
- post_magnification: float = 1.0#
The post-column magnification the camera sits behind (the DE camera as a second camera is about 1.25 to 1.5x; behind an energy filter it is larger). The rendered TEM pixel is the calibrated one divided by this at every magnification, while the calibration (and so the served Specimen Pixel Size) still reports the nominal value: the column does not know. Ignored when pixel_size_override_nm is set. 1.0 changes nothing.
- render_mode_override: RenderMode | None = None#
- max_raster_pixels: int = 1048576#
The largest raster a TEM image is rendered at (pixels); a bigger frame is upsampled from it (OpticsState.raster_downsample says by how much). 0 renders at the frame’s own sampling: what a CTF or MTF measurement needs, since an upsampled frame carries its contrast transfer only up to the raster’s Nyquist. The default keeps a re-render (every stage move and focus step) well under a second on a 4096² camera.
- intensity_zoom: bool = False#
in TEM imaging the condenser follows the magnification, so the illuminated area keeps its size relative to the field of view and the dose per detector pixel stays put as the operator zooms. Intensity then sets the beam at intensity_zoom_reference_mag (and so at every mag). Off: the dose per pixel goes as 1/mag^2 and zooming out saturates the camera.
- Type:
Intensity zoom (TFS “Intensity Zoom”)
- realism: ColumnRealism | None = None#
A real column’s geometry (image rotation, true pixel size, image-shift matrices, magnification offsets, backlash): what SerialEM’s calibrations measure. None: ideal.