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:
__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:
Return type:

None

Methods

__init__([fallback_pixel_nm, ...])

realistic([seed])

A column as imperfect as a real one (de_twin.optics.realism), reproducibly.

Attributes

cc_mm

condenser_apertures_um

condenser_stig_nm_per_unit

condenser_stig_zero

cs_mm

default_camera_length_mm

defocus_offset_um

energy_spread_ev

eucentric_height_um

fallback_pixel_nm

fallback_recip_inv_nm

flip_x

flip_y

geometric_diffraction

illum_max_diameter_um

illum_min_diameter_um

illum_reference_alpha_mrad

illum_reference_diameter_um

illumination_semi_angle_mrad

intensity_zoom

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_zoom_reference_mag

lowmag_illumination_factor

max_raster_pixels

The largest raster a TEM image is rendered at (pixels); a bigger frame is upsampled from it (OpticsState.raster_downsample says by how much).

nanoprobe_illuminated_um

objective_aperture_mrad

objective_stig_zero

pixel_size_override_nm

post_magnification

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).

probe_d0_nm

realism

A real column's geometry (image rotation, true pixel size, image-shift matrices, magnification offsets, backlash): what SerialEM's calibrations measure.

reference_condenser_index

reference_current_pa

reference_spot

render_mode_override

sa_aperture_um

spot_exponent

stage_offset_um

stem_current_factor

stem_default_convergence_mrad

stem_source_size_nm

stig_nm_per_unit

tem_illuminated_area_um

probe_mode_current_factor

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#

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.

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#

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.

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#
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#

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”)

intensity_zoom_reference_mag: float = 20000.0#
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.

classmethod realistic(seed=0, **overrides)[source]#

A column as imperfect as a real one (de_twin.optics.realism), reproducibly.

Parameters:

seed (int)

Return type:

OpticsConfig

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#