mxcubecore.HardwareObjects.MicroDiffractometer#

Micro Diffractometer implementation of the AbstractDiffractometer class.

Classes

MicroDiffractometer(name)

Microdiff with Exporter implementation of AbstractDiffractometer

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

Bases: AbstractDiffractometer

Microdiff with Exporter implementation of AbstractDiffractometer

abort()[source]#

Immediately terminate action.

check_scan_limits(start: float, end: float, exptime: float) bool[source]#

Check if the scan parameters are within the limits

Parameters:
  • start (float) – scan start position.

  • end (float) – scan end position.

  • exptime (float) – scan exposure time (total) [s].

Returns:

True (parameters within the limits), False otherwise.

Return type:

bool

do_characterisation_scan(start: float, scan_range: float, nb_frames: int, exptime: float, nb_scans: int, angle: float, timeout: float | None = None)[source]#

Do fast characterisation. :param start: Position of omega for the first scan [deg]. :param scan_range: range for each scan [deg]. :param nb_frames: Frame numbers for each scan. :param exptime: Total exposure time for each scan [s]. :param nb_scans: How many times a scan to be repeated. :param angle: The angle between each scan [deg]. This number,

added to the last position of each scan and will be the start position of the following scan.

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

  • start (float) –

  • scan_range (float) –

  • nb_frames (int) –

  • exptime (float) –

  • nb_scans (int) –

  • angle (float) –

Raises:

RuntimeError – Timeout waiting for status ready.

do_line_scan(start: float, end: float, exptime: float, number_of_images: int, motors_pos: dict[str, dict], timeout: float | None = None)[source]#

Do helical (line) scan on omega. :param start: scan start position. :param end: scan end position. :param exptime: scan exposure time (total). :param number_of_images: Used only if more tahn one frame needed. :param timeout: optional - timeout [s],

if timeout = 0: return at once and do not wait, if timeout is None: wait forever (default).

Parameters:
  • motors_pos (dict[str, dict]) – {“1”: [centred position], “2”: [centred position]}

  • start (float) –

  • end (float) –

  • exptime (float) –

  • number_of_images (int) –

  • timeout (float | None) –

Raises:
  • RuntimeError – Timeout waiting for status ready.

  • ValueError – Scan parameters not within limits (if relevant).

do_mesh_scan(start: float, end: float, exptime: float, dead_time: float, nb_lines: int, nb_frames_total: int, grid_centre: list[tuple[str, float]], mesh_range: dict, timeout: float | None = None)[source]#

Do a mesh scan.

Parameters:
  • start (float) – scan start position.

  • end (float) – scan end position.

  • exptime (float) – scan exposure time (total).

  • dead_time (float) – Dead time between the pulses. Detector dependant.

  • nb_lines (int) – Total number of lines.

  • nb_frames_total (int) – Total number of frames.

  • grid_centre (list[tuple[str, float]]) – List of tuples (motor_role, position). representing the centre of the mesh grid.

  • mesh_range (dict) – Horizontal and vertical range.

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

Raises:

RuntimeError – Timeout waiting for status ready.

do_oscillation_scan(start: float, end: float, exptime: float, number_of_images: int = 1, timeout: float | None = None)[source]#

Do an oscillation scan on omega.

Parameters:
  • start (float) – omega start position.

  • end (float) – omega end position.

  • exptime (float) – scan exposure time (total).

  • number_of_images (int) – Used if need to set number of frames.

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

Raises:
  • RuntimeError – Timeout waiting for status ready.

  • ValueError – Scan parameters not within limits (if relevant).

do_still_scan(pulse_duration: float, pulse_period: float, nb_pulse: int, timeout: [None | float] = None)[source]#

Do a zero oscillation acquisition.

Parameters:
  • pulse_duration (float) – Duration of the pulse sent to the detector.

  • pulse_period (float) – The period of the pulse sent to the detector.

  • nb_pulse (int) – Number of pulses to be sent.

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

Raises:

RuntimeError – Timeout waiting for status ready.

get_beam_position() tuple[source]#

Get the beam position defined in MD

Return type:

tuple

get_constraint() DiffractometerConstraint[source]#

Get the diffrractometer constraint type.

Return type:

DiffractometerConstraint

get_motors()[source]#

Get the dictionary of all the motors which can be used.

Returns:

hardware_object}.

Return type:

Ddctionary {role

get_phase() DiffractometerPhase[source]#

Get the current phase.

Return type:

DiffractometerPhase

get_pixels_per_mm() tuple[int, int][source]#

Get the pixel/mm values.

Returns:

(x ,y) [pixel/mm]

Return type:

tuple[int, int]

get_state()[source]#

Get the diffractometer general state.

Returns:

state

Return type:

(enum ‘HardwareObjectState’)

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

is empty, return the positions of all the availble motors.

Parameters:

motors_list ([list | None]) – List of motor roles.

Returns:

position}.

Return type:

Dictionary {role

init()[source]#

Initialise the device

run_custom_script(script_cmd: str, timeout: float | None = None)[source]#

Run custom script.

Parameters:
  • script_cmd (str) –

  • timeout (float | None) –

set_value_motors(motors_positions_dict: dict[str, float], 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 simultaneously (True - default) or not.

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

Raises:
wait_status_ready(timeout: float | None = None)[source]#

Wait timeout seconds until status is ready.

Parameters:
  • timeout. (Timeout [s]. None means infinite) –

  • timeout (float | None) –