mxcubecore.HardwareObjects.GenericDiffractometer#

GenericDiffractometer

Classes

BlockShapeEnum(value[, names, module, ...])

CalibrationData(*[, top_left, top_right, ...])

ChipLayout(*[, head_type, holder_type, ...])

DiffractometerState()

Enumeration of diffractometer states

GenericDiffractometer(name)

Abstract base class for diffractometers

GonioHeadConfiguration(*[, current])

HeadTypeEnum(value[, names, module, ...])

HolderTypeEnum(value[, names, module, ...])

PhaseEnum(value[, names, module, qualname, ...])

PhaseModel(*[, value])

SampleHolderSectionModel(*[, ...])

class mxcubecore.HardwareObjects.GenericDiffractometer.BlockShapeEnum(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: str, Enum

class mxcubecore.HardwareObjects.GenericDiffractometer.DiffractometerState[source]#

Bases: object

Enumeration of diffractometer states

class mxcubecore.HardwareObjects.GenericDiffractometer.GenericDiffractometer(name)[source]#

Bases: HardwareObject

Abstract base class for diffractometers

accept_centring()[source]#

Descript. : Arg. “ fully_centred_point. True if 3 click centring

else False

property alignment_x#

alignment_x motor object (also used as graphics.focus)

Returns:

AbstractActuator

property alignment_y#

alignment_y motor object

Returns:

AbstractActuator

property alignment_z#

alignment_z motor object

Returns:

AbstractActuator

beam_position_changed(value)[source]#

Descript. :

centring_done(centring_procedure)[source]#

Descript. :

property centring_x#

centring_x motor object

Returns:

AbstractActuator

property centring_y#

centring_y motor object

Returns:

AbstractActuator

close_kappa()[source]#

Descript. :

current_phase_changed(current_phase)[source]#

Descript. :

emit_centring_failed()[source]#

Descript. :

emit_centring_moving()[source]#

Descript. :

emit_centring_started(method)[source]#

Descript. :

emit_centring_successful()[source]#

Descript. :

emit_progress_message(msg=None)[source]#

Descript. :

execute_server_task(method, timeout=30, *args)[source]#
Method is used to execute commands and wait till

diffractometer is in ready state

Parameters:
  • method (instance) – method to be executed

  • timeout (seconds) – timeout in seconds

force_emit_signals()[source]#

Emits all hardware object signals

The method is called from the gui via beamline object to ensure that bricks have values after the initialization. Problem arise when a hardware object is used by several bricks. If first brick connects to some signal emitted by a brick then other bricks connecting to the same signal will not receive the values on the startup. The easiest solution is to call force_emit_signals method directly after the initialization of the beamline object

get_available_centring_methods()[source]#

Descript. :

get_centring_status()[source]#

Descript. :

get_current_centring_method()[source]#

Descript. :

get_current_phase()[source]#

Descript. :

get_grid_direction()[source]#

Descript. :

get_head_type()[source]#

Returns head type

Returns:

string

get_motors()[source]#

Get motor_name:Motor dictionary

get_osc_limits()[source]#

Returns osc limits

get_phase_list()[source]#

Returns list of available phases

Returns:

list with str

get_pixels_per_mm()[source]#

Returns tuple with pixels_per_mm_x and pixels_per_mm_y

Returns:

list with two floats

get_point_between_two_points(point_one, point_two, frame_num, frame_total)[source]#

Method returns a centring point between two centring points It is used to get a position on a helical line based on frame number and total frame number

get_positions()[source]#

Descript. :

get_scan_limits(speed=None, num_images=None, exp_time=None)[source]#

Gets scan limits. Necessary for example in the plate mode where osc range is limited

get_snapshot()[source]#

Get snapshot from sample view

Returns:

A bytes object of the current camera image.

Return type:

bytes

head_type_changed(head_type)[source]#

Descript. :

image_clicked(x: float, y: float, xi: float | None = None, yi: float | None = None)[source]#

Handles a user click sent from the frontend during the manual centring.

This method is called by the backend when the user clicks on the sample image in the frontend.

The attribute self.waiting_for_click controls whether the click should be accepted or ignored:

  • None: click is accepted (legacy)

  • True: waiting for a click, accept it and mark it as received

  • False: already received a click, ignore further clicks

Parameters:
  • x (float) – X coordinate of the click.

  • y (float) – Y coordinate of the click.

  • xi (float | None) –

  • yi (float | None) –

Raises:

RuntimeError – If a click is received while a previous one is still being processed.

in_plate_mode()[source]#

Returns True if diffractometer in plate mod

Returns:

boolean

init()[source]#

‘public’ post-initialization method. Override as needed.

For ConfiguredObjects called after loading contained objects.

is_ready()[source]#

Detects if device is ready

motor_state_changed(state)[source]#

Descript. :

move_motors(motor_positions, timeout=15)[source]#

Moves diffractometer motors to the requested positions

Parameters:

motors_dict (dict) – dictionary with motor names or hwobj and target values.

move_motors_done(move_motors_procedure)[source]#

Descript. :

move_omega_relative(relative_angle)[source]#

Descript. :

move_to_beam(x, y, omega=None)[source]#
Descript.function to create a centring point based on all motors

positions.

property omega#

omega motor object

Returns:

AbstractActuator

reject_centring()[source]#

Descript. :

sample_is_loaded_changed(sample_is_loaded)[source]#

Descript. :

set_phase(phase, timeout=None)[source]#
Sets diffractometer to selected phase

By default available phase is Centring, BeamLocation, DataCollection, Transfer

Parameters:
  • phase (string) – phase

  • timeout (int) – timeout in sec

set_use_sc(flag)[source]#

Sets use_sc flag, that indicates if sample changer is used

Parameters:

flag (boolean) – use sample changer flag

start_move_to_beam(coord_x=None, coord_y=None, omega=None, wait_result=None)[source]#

Descript. :

transfer_mode_changed(transfer_mode)[source]#

Descript. :

use_sample_changer()[source]#

Returns True if sample changer is in use

Returns:

boolean

visual_align(point_1, point_2)[source]#

Descript. :

wait_device_ready(timeout=30)[source]#

Waits when diffractometer status is ready:

Parameters:

timeout (int) – timeout in second

wait_ready(timeout=30)#

Waits when diffractometer status is ready:

Parameters:

timeout (int) – timeout in second

class mxcubecore.HardwareObjects.GenericDiffractometer.HeadTypeEnum(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: str, Enum

class mxcubecore.HardwareObjects.GenericDiffractometer.HolderTypeEnum(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: str, Enum

class mxcubecore.HardwareObjects.GenericDiffractometer.PhaseEnum(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: str, Enum