de_twin.optics.serialem.ColumnDefinition#

class de_twin.optics.serialem.ColumnDefinition(lm_max_mag=None)[source]#

Bases: DefocusAndTruth

A column defined by tables (from calibrations) rather than drawn from a seed: the same interface as ColumnRealism, so it goes in OpticsConfig(realism=...).

Per magnification: the image rotation (rad), the true pixel size (nm, for the camera it was calibrated on) against the twin’s nominal one, the image-shift matrix (specimen um per unit) and the magnification’s image offset (um). One beam-shift matrix, crossovers per (spot, SerialEM probe), and the high-defocus scale / rotation per micrometre. What the tables do not give is ideal. A magnification between entries takes the nearest (in log magnification) of its own range (LM or not), where it has one. Compared and hashed by identity (it holds mutable tables).

Parameters:

lm_max_mag (float | None)

__init__(lm_max_mag=None)[source]#
Parameters:

lm_max_mag (float | None)

Methods

__init__([lm_max_mag])

bs_matrix()

crossover(spot[, probe_mode])

defocus_rotation_rad(defocus_um)

defocus_scale(defocus_um)

True pixel size factor at this defocus (the magnification drops as it grows).

is_astig_nm(isx_um, isy_um)

is_matrix(mag_mode, magnification)

is_tilt_mrad(isx_um, isy_um)

mag_offset_um(mag_mode, magnification)

pixel_scale(mag_mode, magnification)

rotation_rad(mag_mode, magnification)

truth(mag_mode, magnification)

Every value at one magnification, for tests that calibrate against the twin.

rotation_rad(mag_mode, magnification)[source]#
Parameters:

magnification (float)

Return type:

float

pixel_scale(mag_mode, magnification)[source]#
Parameters:

magnification (float)

Return type:

float

is_matrix(mag_mode, magnification)[source]#
Parameters:

magnification (float)

Return type:

ndarray

mag_offset_um(mag_mode, magnification)[source]#
Parameters:

magnification (float)

Return type:

tuple[float, float]

bs_matrix()[source]#
Return type:

ndarray

crossover(spot, probe_mode=0)[source]#
Parameters:
Return type:

float

is_tilt_mrad(isx_um, isy_um)[source]#
Parameters:
Return type:

tuple[float, float]

is_astig_nm(isx_um, isy_um)[source]#
Parameters:
Return type:

complex