de_twin.optics.realism.ColumnRealism#

class de_twin.optics.realism.ColumnRealism(seed=0, rotation_jitter_deg=2.0, image_rotation=True, pixel_scale_sigma=0.02, is_scale_sigma=0.05, is_skew_sigma=0.02, is_rotation_sigma_deg=3.0, mag_offset_fraction=0.02, backlash_um=0.3, bs_scale_sigma=0.05, bs_skew_sigma=0.02, bs_rotation_sigma_deg=5.0, crossover_intensity=0.35, crossover_sigma=0.02, is_coma_mrad_per_um=0.43, is_astig_nm_per_um=15.0, hd_scale_per_um=0.0002, hd_rotation_deg_per_um=0.01)[source]#

Bases: DefocusAndTruth

The imperfect geometry of a real column (see the module docstring).

Parameters:
  • seed (int)

  • rotation_jitter_deg (float)

  • image_rotation (bool)

  • pixel_scale_sigma (float)

  • is_scale_sigma (float)

  • is_skew_sigma (float)

  • is_rotation_sigma_deg (float)

  • mag_offset_fraction (float)

  • backlash_um (float)

  • bs_scale_sigma (float)

  • bs_skew_sigma (float)

  • bs_rotation_sigma_deg (float)

  • crossover_intensity (float)

  • crossover_sigma (float)

  • is_coma_mrad_per_um (float)

  • is_astig_nm_per_um (float)

  • hd_scale_per_um (float)

  • hd_rotation_deg_per_um (float)

__init__(seed=0, rotation_jitter_deg=2.0, image_rotation=True, pixel_scale_sigma=0.02, is_scale_sigma=0.05, is_skew_sigma=0.02, is_rotation_sigma_deg=3.0, mag_offset_fraction=0.02, backlash_um=0.3, bs_scale_sigma=0.05, bs_skew_sigma=0.02, bs_rotation_sigma_deg=5.0, crossover_intensity=0.35, crossover_sigma=0.02, is_coma_mrad_per_um=0.43, is_astig_nm_per_um=15.0, hd_scale_per_um=0.0002, hd_rotation_deg_per_um=0.01)#
Parameters:
  • seed (int)

  • rotation_jitter_deg (float)

  • image_rotation (bool)

  • pixel_scale_sigma (float)

  • is_scale_sigma (float)

  • is_skew_sigma (float)

  • is_rotation_sigma_deg (float)

  • mag_offset_fraction (float)

  • backlash_um (float)

  • bs_scale_sigma (float)

  • bs_skew_sigma (float)

  • bs_rotation_sigma_deg (float)

  • crossover_intensity (float)

  • crossover_sigma (float)

  • is_coma_mrad_per_um (float)

  • is_astig_nm_per_um (float)

  • hd_scale_per_um (float)

  • hd_rotation_deg_per_um (float)

Return type:

None

Methods

__init__([seed, rotation_jitter_deg, ...])

bs_matrix()

2x2: specimen micrometres (world frame) per beam-shift unit.

crossover(spot[, probe_mode])

The Intensity at the C2 crossover for this spot size and 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)

The axial astigmatism A1 (complex nm) an image shift of (x, y) um adds.

is_matrix(mag_mode, magnification)

2x2: specimen micrometres (world frame) per image-shift unit.

is_tilt_mrad(isx_um, isy_um)

The effective beam tilt (mrad) of an image shift of (x, y) specimen micrometres.

mag_offset_um(mag_mode, magnification)

Where this magnification puts the image centre, relative to the ideal, micrometres: mag_offset_fraction of a nominal field of 1e5 / mag um (5 um at 20 kx).

pixel_scale(mag_mode, magnification)

True pixel size / nominal pixel size.

rotation_rad(mag_mode, magnification)

How far the image is rotated on the camera, radians (world -> camera).

truth(mag_mode, magnification)

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

Attributes

backlash_um

The stage stops short by half of this against its approach direction, micrometres.

bs_rotation_sigma_deg

bs_scale_sigma

one for all magnifications): scale / skew / rotation spreads, as for image shift.

bs_skew_sigma

crossover_intensity

the Intensity at which the beam is smallest, and its spread over spot sizes and probe modes (SerialEM's Beam Crossover calibration).

crossover_sigma

hd_rotation_deg_per_um

hd_scale_per_um

the magnification changes by this fraction and the image rotates by this many degrees per micrometre of defocus (SerialEM's high-defocus magnification / image-shift calibrations; -200 um: ~4 %, ~2 deg).

image_rotation

The base angle of each imaging mode is drawn over the full circle.

is_astig_nm_per_um

is_coma_mrad_per_um

an effective beam tilt of this many mrad per micrometre of image shift (~1 / f_obj, f_obj ~ 2.3 mm), at a small seeded angle, and an axial astigmatism of this many nm per micrometre.

is_rotation_sigma_deg

is_scale_sigma

spread of each axis's scale, of the skew, and of its rotation (deg).

is_skew_sigma

mag_offset_fraction

Image-centre offset on a magnification change, as a fraction of that mag's field width.

pixel_scale_sigma

Spread of true / nominal pixel size, per magnification (fraction).

rotation_jitter_deg

Spread of the per-magnification image rotation around its mode's base angle, degrees.

seed

seed: int = 0#
rotation_jitter_deg: float = 2.0#

Spread of the per-magnification image rotation around its mode’s base angle, degrees.

image_rotation: bool = True#

The base angle of each imaging mode is drawn over the full circle.

pixel_scale_sigma: float = 0.02#

Spread of true / nominal pixel size, per magnification (fraction).

is_scale_sigma: float = 0.05#

spread of each axis’s scale, of the skew, and of its rotation (deg).

Type:

Image-shift matrix

is_skew_sigma: float = 0.02#
is_rotation_sigma_deg: float = 3.0#
mag_offset_fraction: float = 0.02#

Image-centre offset on a magnification change, as a fraction of that mag’s field width.

backlash_um: float = 0.3#

The stage stops short by half of this against its approach direction, micrometres.

bs_scale_sigma: float = 0.05#

one for all magnifications): scale / skew / rotation spreads, as for image shift.

Type:

Beam-shift matrix (illumination system

bs_skew_sigma: float = 0.02#
bs_rotation_sigma_deg: float = 5.0#
crossover_intensity: float = 0.35#

the Intensity at which the beam is smallest, and its spread over spot sizes and probe modes (SerialEM’s Beam Crossover calibration).

Type:

C2 crossover

crossover_sigma: float = 0.02#
is_coma_mrad_per_um: float = 0.43#

an effective beam tilt of this many mrad per micrometre of image shift (~1 / f_obj, f_obj ~ 2.3 mm), at a small seeded angle, and an axial astigmatism of this many nm per micrometre. What SerialEM’s coma-vs-image-shift calibration measures.

Type:

Image shift images the specimen off the objective’s coma-free axis

is_astig_nm_per_um: float = 15.0#
hd_scale_per_um: float = 0.0002#

the magnification changes by this fraction and the image rotates by this many degrees per micrometre of defocus (SerialEM’s high-defocus magnification / image-shift calibrations; -200 um: ~4 %, ~2 deg).

Type:

High defocus weakens the objective

hd_rotation_deg_per_um: float = 0.01#
rotation_rad(mag_mode, magnification)[source]#

How far the image is rotated on the camera, radians (world -> camera).

Parameters:

magnification (float)

Return type:

float

pixel_scale(mag_mode, magnification)[source]#

True pixel size / nominal pixel size.

Parameters:

magnification (float)

Return type:

float

is_matrix(mag_mode, magnification)[source]#

2x2: specimen micrometres (world frame) per image-shift unit.

Parameters:

magnification (float)

Return type:

ndarray

mag_offset_um(mag_mode, magnification)[source]#

Where this magnification puts the image centre, relative to the ideal, micrometres: mag_offset_fraction of a nominal field of 1e5 / mag um (5 um at 20 kx).

Parameters:

magnification (float)

Return type:

tuple[float, float]

bs_matrix()[source]#

2x2: specimen micrometres (world frame) per beam-shift unit.

Return type:

ndarray

crossover(spot, probe_mode=0)[source]#

The Intensity at the C2 crossover for this spot size and probe mode.

Parameters:
Return type:

float

is_tilt_mrad(isx_um, isy_um)[source]#

The effective beam tilt (mrad) of an image shift of (x, y) specimen micrometres.

Parameters:
Return type:

tuple[float, float]

is_astig_nm(isx_um, isy_um)[source]#

The axial astigmatism A1 (complex nm) an image shift of (x, y) um adds.

Parameters:
Return type:

complex