de_twin.optics.Calibration#
- class de_twin.optics.Calibration(projects, *, reference_pixel_um=None, ht_scale=None, tolerance=0.005, stem_scan_span_v=1.0, stem_fov_nm_at_1x=128000000.0, name='custom')[source]#
Bases:
objectMagnification -> nm/px and camera length -> 1/nm/px, per mag mode.
- Parameters:
- __init__(projects, *, reference_pixel_um=None, ht_scale=None, tolerance=0.005, stem_scan_span_v=1.0, stem_fov_nm_at_1x=128000000.0, name='custom')[source]#
Methods
__init__(projects, *[, reference_pixel_um, ...])cl_ladder([tem_stem])Camera lengths in mm (the twin's unit; mag.yaml stores cm).
default()Built-in JEOL-like ladders, computed geometrically.
from_mag_yaml(path, *[, reference_pixel_um, ...])Load a DE-Server
mag.yaml(tabs tolerated) and optionally anht_table_*.yaml.geometric_recip_inv_nm(state, camera[, ...])mag_ladder([mode, tem_stem])mag_modes([tem_stem])project_for(state[, want_cl])recip_pixel_inv_nm(state, camera)1/nm per unbinned detector pixel in diffraction; 0.0 = not calibrated.
snap_cl(cl_mm[, tem_stem])snap_mag(mode, magnification[, tem_stem])specimen_pixel_nm(state, camera)nm of specimen per unbinned detector pixel (TEM imaging); 0.0 = not calibrated.
stem_step_nm(state, scan_size)nm per scan point for a (nx, ny) scan; 0.0 = not calibrated.
- classmethod from_mag_yaml(path, *, reference_pixel_um=None, ht_table=None, tolerance=0.005)[source]#
Load a DE-Server
mag.yaml(tabs tolerated) and optionally anht_table_*.yaml.- Parameters:
- Return type:
- classmethod default()[source]#
Built-in JEOL-like ladders, computed geometrically.
Tables are nm per 1-um pixel (
1000 / mag) and are scaled by the camera’s pixel pitch, so 20 kx on a 6.5 um pixel is 0.325 nm/px. Camera lengths are geometric (Noneentries). A camera behind a post-column magnification isOpticsConfig.post_magnification: the calibration is what the column believes.- Return type:
- project_for(state, want_cl=False)[source]#
- Parameters:
state (MicroscopeState)
want_cl (bool)
- Return type:
MagProject | None
- specimen_pixel_nm(state, camera)[source]#
nm of specimen per unbinned detector pixel (TEM imaging); 0.0 = not calibrated.
- Parameters:
state (MicroscopeState)
- Return type:
- recip_pixel_inv_nm(state, camera)[source]#
1/nm per unbinned detector pixel in diffraction; 0.0 = not calibrated.
Geometric entries use
mrad/px = pixel_um / CL_mmand1/nm = mrad / (1000 lambda).- Parameters:
state (MicroscopeState)
- Return type:
- static geometric_recip_inv_nm(state, camera, camera_length_mm=0.0)[source]#
- Parameters:
state (MicroscopeState)
camera_length_mm (float)
- Return type:
- stem_step_nm(state, scan_size)[source]#
nm per scan point for a (nx, ny) scan; 0.0 = not calibrated.
- Parameters:
state (MicroscopeState)
- Return type:
- cl_ladder(tem_stem=0)[source]#
Camera lengths in mm (the twin’s unit; mag.yaml stores cm).
- Parameters:
tem_stem (int)
- Return type:
Ladder