de_twin.column.MirrorColumn#

class de_twin.column.MirrorColumn(host='127.0.0.1', port=5002, *, clock=None, period_s=0.5, client=None, timeout=5.0, start=True, strict=False, poll_intensity=True, camera_length_unit='cm', corrector_every=4)[source]#

Bases: Column

A Column that follows a DE-TEM-Channel over SOAP.

Parameters:
  • host (str) – The channel (a real one, the Dummy instrument, or another twin’s TemChannelServer).

  • port (int) – The channel (a real one, the Dummy instrument, or another twin’s TemChannelServer).

  • period_s (float) – Poll period. The first poll happens in the constructor (errors are logged, not raised, unless strict=True).

  • client (SoapTemChannelClient | None) – An existing SoapTemChannelClient (overrides host/port).

  • poll_intensity (bool) – Also read getProperty("Intensity") each cycle (not in the batch).

  • corrector_every (int) – Read the channel’s aberration corrector every N polls (0 = never): getCorrectorPresent, getCorrectorInfo (mode STEM -> probe side, TEM -> image side) and getAberrations (the corrector’s last measurement, metres). The measured C1 / A1 include the operator’s focus and stigmator, so those are subtracted (the optics adds them back) before the set lands in state.probe_aberrations / image_aberrations; until a measurement exists the side’s set is left as it was. A channel without the corrector operations is asked once.

  • timeout (float)

  • start (bool)

  • strict (bool)

  • camera_length_unit (str)

__init__(host='127.0.0.1', port=5002, *, clock=None, period_s=0.5, client=None, timeout=5.0, start=True, strict=False, poll_intensity=True, camera_length_unit='cm', corrector_every=4)[source]#
Parameters:

Methods

__init__([host, port, clock, period_s, ...])

cl_ladder()

Camera lengths in mm of the active optics mode (empty in TEM imaging).

close()

Nothing to release for a simulated column.

convergence_mrad()

get(name)

Read a property by its DE-TEM-Channel name (see the module docstring).

mag_ladder()

Magnifications a Magnification write can reach from here (empty in TEM diffraction).

move_stage([x, y, z, alpha, beta, wait, timeout])

now()

on_change(callback)

Call callback(name, value) after every accepted write (outside the lock).

op_state()

DE-TEM-Channel OperationState: 1 running while the stage moves, else the last set's.

poll()

One synchronous refresh from the channel.

poll_corrector()

Read the channel's corrector: (side, [(name, (x_m, y_m)), ...]), ("none", []) when it has none, None when the channel lacks the operations.

property_names()

set(name, value)

Forward a write to the channel, then refresh.

set_alpha_selector(alpha)

set_beam_blank(blanked)

set_beam_shift_um(x, y)

set_beam_tilt_mrad(x, y)

set_camera_length_cm(cm)

set_camera_length_mm(mm)

set_column_valves(open_)

set_condenser_aperture(index)

set_condenser_stig(x, y)

set_convergence_mrad(mrad)

set_defocus_um(um)

set_diffraction_shift_mrad(x, y)

set_function_mode(mode)

Raw vendor function mode, or a JEOL name ("MAG1", "LowMAG", "DIFF", ...).

set_ht_kv(kv)

set_image_shift_um(x, y)

set_instrument_type(vendor)

set_intensity(value)

set_magnification(magnification)

set_magnification_index(index)

set_objective_stig(x, y)

set_probe_mode(mode)

set_projection(mode)

set_screen(down)

set_spot_size(spot)

set_stage([x, y, z, alpha, beta])

Start a stage move (non-blocking; see wait_idle()).

set_tem_stem(mode)

stage_position()

stage_target()

start()

state()

Snapshot, with the stage interpolated to now.

stop()

Freeze the stage wherever its trajectory has reached (stopStage).

time_to_idle()

Clock seconds until the stage has arrived (0 when idle).

values()

Every readable property.

wait_idle([timeout])

Poll until the channel's OP_Status is no longer Running (wall-clock timeout).

Attributes

busy

function_mode

Raw JEOL function mode 0..4 (MAG1, MAG2, LowMAG, SAMAG, DIFF).

instrument_type

real

property real: bool#
poll()[source]#

One synchronous refresh from the channel. Returns the new state.

Return type:

MicroscopeState

poll_corrector()[source]#

Read the channel’s corrector: (side, [(name, (x_m, y_m)), ...]), ("none", []) when it has none, None when the channel lacks the operations.

Return type:

tuple[str, list] | None

state()[source]#

Snapshot, with the stage interpolated to now.

Return type:

MicroscopeState

op_state()[source]#

DE-TEM-Channel OperationState: 1 running while the stage moves, else the last set’s.

Return type:

int

start()[source]#
Return type:

MirrorColumn

close()[source]#

Nothing to release for a simulated column.

Return type:

None

set(name, value)[source]#

Forward a write to the channel, then refresh. Raises ColumnRefused on success=0.

Parameters:
Return type:

None

stop()[source]#

Freeze the stage wherever its trajectory has reached (stopStage).

Return type:

None

wait_idle(timeout=30.0)[source]#

Poll until the channel’s OP_Status is no longer Running (wall-clock timeout).

Parameters:

timeout (float | None)

Return type:

bool