mxcubecore.HardwareObjects.abstract.AbstractDiffractometer#

Abstract Diffractometer class. Initialises the username property and all the motors and nstate (discrete positions) equipment, which are part of the diffractometer. Certain number of roles are fixed and define a corresponding motor or nstate actuator object. This allows to use them in a standard way by the MXCuBE application (web or Qt). There is also a convention of the direction of the motors:

  • x axis is parallel to the beam. Positive direction is from right to left.

  • y axis is perpendicular to the beam, parallel to the ground. Positive

    direction is from left to right when facing the beam.

  • z axis is perpendicular to the floor. Positive direction is top down.

Here follows the list of the fixed roles and the description of the corresponding objects, accessible via beamline.diffractometer hardware object.

  1. Motor objects (roles) and their functionality:

omega - the rotation axis, independent of the orientation (up, down or side).

Pisitive direction is clockwise.

sampx - centring table x axis sampy - centring table y axis focus - alignment table x axis phiy - alignment table y axis phiz - alignment table z axis sample_horizontal - x axis, combination of sampx and sampy. Equivalent to

sampx at omega=0 and sampy for omega=90.

samle_vertical - y axis, combination of sampx and sampy. Equivalent to

sampy at omega=0 and sampx for omega=90.

backlight - adjust the intensity of the back light frontlight - adjust the intensity of the front light kappa - the minikappa kappa axis kappa_phi - the minikappa phi axis

2. Discrete (N) state equipment and its functionality: zoom - zoom levels fshutter - fast (ms) shutter - allow beam on the sample beamstop - put in front of a detector to avoid the direct beam. capillary - if present, a tube to reduce the scattering background. backlightswitch - move the backlight on the level of the on-axis viewer frontlightswitch - switch on/off the front light fluo_detector - if present, actuator to move a fluorescence detector close to the sample

Classes

AbstractDiffractometer(name)

Abstract Diffractometer.

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

Chip calibration model.

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

Chip layout model.

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

Enumeration of chip holder shape.

DiffractometerConstraint(value[, names, ...])

Enumeration diffractometer constraint types.

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

Enumeration diffractometer head types.

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

Enumeration diffractometer phases.

GonioHeadConfiguration(*[, current])

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

Enumeration of chip holder geometry.

SampleHolderSectionModel(*[, ...])

Generic sample holder.

class mxcubecore.HardwareObjects.abstract.AbstractDiffractometer.AbstractDiffractometer(name)[source]#

Bases: HardwareObject

Abstract Diffractometer.

motors_hwobj_dict#

Motor hardware objects.

Type:

dict

nstate_equipment_hwobj_dict#

N state hardware objects.

Type:

dict

username#

User name

Type:

str

head_type#

Current head type

Type:

DiffractometerHead Enum

current_phase#

Current phase

Type:

DiffractometerPhase Enum

current_constraint#

Current constraint.

Type:

DiffractometerConstraint Enum

timeout#

Default action timeout [s]

Type:

float

Emits:
  • valueChanged – (“valueChanged”, (value,))

  • phaseChanged – (“phaseChanged”, (state))

States:

HardwareObjectStates: READY, BUSY, FAULT

do_characterisation_scan(*args, **kwargs)[source]#

Do characterisation.

do_line_scan(*args, **kwargs)[source]#

Do a line (helical) scan.

do_mesh_scan(*args, **kwargs)[source]#

Do a mesh scan.

do_oscillation_scan(*args, **kwargs)[source]#

Do an oscillation scan.

do_still_scan(*args, **kwargs)[source]#

Do a zero oscillation acquisition.

get_chip_configuration() GonioHeadConfiguration | None[source]#

Get the chip configuration.

Return type:

GonioHeadConfiguration | None

get_constraint()[source]#

Get the current constraint :returns: DiffractometerConstraint member. :rtype: (Enum)

property get_constraint_enum#

Get the constraints Enum. Used when no import wished.

property get_head_enum#

Get the diffractometer head Enum. Used when no import wished.

property get_head_type: DiffractometerHead#

Get the head type :returns: DiffractometerHead member.

get_motors() dict[source]#

Get the dictionary of all configured motors or the ones to use.

Returns:

hardware_object}

Return type:

Dictionary {role

get_nstate_equipment() dict[source]#

Get the dictionary of all the nstate (discrete positions) equipment.

Returns:

hardware_object}

Return type:

Dictionary {role

get_phase() DiffractometerPhase[source]#

Get the current phase.

Return type:

DiffractometerPhase

property get_phase_enum#

Get the phase Enum. Used when no import wished.

get_phase_list() list[source]#

Return a list of all the defined phases.

Return type:

list

get_state_motors(motors_list: list | None = None) dict[source]#
Get the state of diffractometer motors. If the motors_list is

empty, return the state of all the available motors.

Parameters:
  • roles. (List of motor) –

  • motors_list (list | None) –

Returns:

state}

Return type:

Dictionary {motor_role

get_value_motors(motors_list: list | None = None) dict[source]#
Get the positions of diffractometer motors. If the motors_list is

empty, return the positions of all the available motors.

Parameters:
  • roles. (List of motor) –

  • motors_list (list | None) –

Returns:

position}

Return type:

Dictionary {motor_role

property in_chip_mode: bool#

Check if there is chip configuration of the head.

property in_injector_mode: bool#

Check if there is injector on the head.

property in_kappa_mode: bool#

Check if the head is MiniKappa.

property in_plate_mode: bool#

Check if the head is a plate.

init()[source]#

Initialise username property. Initialise the equipment, defined in the configuration file

set_chip_layout(layout_name: str) bool[source]#

Choose the chip configuration layout. :param The layout name.:

Parameters:

layout_name (str) –

Return type:

bool

set_constraint(value: DiffractometerConstraint, timeout: float | None = None)[source]#

Sets diffractometer to selected constraint.

Parameters:
  • value (DiffractometerConstraint) – DiffractometerConstraint member.

  • timeout (float | None) – optional - timeout [s], if timeout = 0: return at once and do not wait, if timeout is None: wait forever (default).

set_head_configuration(str_data: str) None[source]#

Write the chip configuration in the chip configuration json file. :param String containing the configuration.:

Parameters:

str_data (str) –

Return type:

None

set_phase(value: DiffractometerPhase | str, timeout: float | None = None)[source]#

Sets diffractometer to selected phase.

Parameters:
  • value (DiffractometerPhase | str) – DiffractometerPhase or string value

  • timeout (float | None) – timeout [s], If timeout = 0: return at once and do not wait; if timeout is None: wait forever (default).

set_value_motors(motors_positions_dict: dict, simultaneous: bool = True, timeout: float | None = None)[source]#

Move specified motors to the requested positions

Parameters:
  • motors_positions_dict (dict) – Dictionary {motor_role: target_value}.

  • simultaneous (bool) – Move the motors simultaneousl (True - default) or not.

  • timeout (float | None) – timeout [s], if timeout = 0: return at once and do not wait, if timeout is None: wait forever (default).

Raises:
update_phase(value: DiffractometerPhase | None = None)[source]#

Update the phase value, Emit phaseChanged signal.

Parameters:

value (DiffractometerPhase | None) – DiffractometerPhase member. Optional.

value_to_enum(value, which_enum)[source]#

Tranform a value to Enum

Parameters:
Returns:

Enum member, corresponding to the value or UNKNOWN.

Return type:

(Enum)

class mxcubecore.HardwareObjects.abstract.AbstractDiffractometer.CalibrationData(*, top_left: Tuple[float, float, float] = [0, 0, 0], top_right: Tuple[float, float, float] = [0, 0, 0], bottom_left: Tuple[float, float, float] = [0, 0, 0])[source]#

Bases: BaseModel

Chip calibration model.

Parameters:
class mxcubecore.HardwareObjects.abstract.AbstractDiffractometer.ChipLayout(*, head_type: DiffractometerHead = DiffractometerHead.SSX, holder_type: HolderTypeEnum = HolderTypeEnum.KNOWN_GEOMETRY, holder_brand: str = '', holder_size: Tuple[float, float] = [0, 0], sections: List[SampleHolderSectionModel], calibration_data: CalibrationData)[source]#

Bases: BaseModel

Chip layout model.

Parameters:
class mxcubecore.HardwareObjects.abstract.AbstractDiffractometer.ChipShapeEnum(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

Enumeration of chip holder shape.

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

Bases: Enum

Enumeration diffractometer constraint types.

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

Bases: Enum

Enumeration diffractometer head types.

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

Bases: Enum

Enumeration diffractometer phases.

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

Bases: Enum

Enumeration of chip holder geometry.

class mxcubecore.HardwareObjects.abstract.AbstractDiffractometer.SampleHolderSectionModel(*, calibration_data: CalibrationData | None = None, section_offset: Tuple[int, int] = [0, 0], block_size: Tuple[float, float] = [15, 15], block_spacing: Tuple[float, float] = [15, 15], block_shape: ChipShapeEnum = ChipShapeEnum.RECTANGULAR, number_of_rows: int = 6, number_of_collumns: int = 6, row_labels: List[str] = [], column_lables: List[str] = [], targets_per_block: Tuple[int, int] = [20, 20])[source]#

Bases: BaseModel

Generic sample holder.

Parameters: