mxcubecore.HardwareObjects.ESRF.ESRFBeam#

BeamDefiner ESRF implementation class - methods to define the size and shape of the beam. Example yml configuration:

class: ESRF.ESRFBeam.ESRFBeam
configuration:
  beam_divergence_horizontal: 104
  beam_divergence_vertical: 6.5
  definer_type: definer   # could be also aperture or slits
objects:
  aperture: udiff_aperture.yml
  definer: beam_definer.yml

Classes

ESRFBeam(name)

Beam ESRF implementation

class mxcubecore.HardwareObjects.ESRF.ESRFBeam.ESRFBeam(name)[source]#

Bases: AbstractBeam

Beam ESRF implementation

get_available_size() dict[source]#

Get the available predefined beam definer configuration. :returns: {"type": ["aperture"], "values": [labels]} or

{"type": ["definer"], "values": [labels]} or ``{“type”: [“width”, “height”], “values”:

[low_lim_w, high_lim_w, low_lim_h, high_lim_h]}``

Return type:

dict

get_beam_position_on_screen() list[int, int][source]#

Get the beam position.

Returns:

X and Y coordinates of the beam position in pixels.

Return type:

list[int, int]

get_beam_size() tuple[float, float][source]#

Get the beam size.

Returns:

width and height.

Return type:

Two-item tuple

get_defined_beam_size() dict[source]#

Get the predefined beam labels and size.

Returns:

Dictionary with list of available beam size labels and the corresponding size (width,height) tuples. {"label": [str, str, ...], "size": [(w,h), (w,h), ...]}

Return type:

dict

get_value_xml() tuple[float, float, str, str][source]#

XMLRPC does not handle Enum, the shape is transformed to string.

Returns:

width, height, shape, name

Return type:

Four-item tuple

init() None[source]#

Initialize hardware

Return type:

None

set_value(size: list[float] | str | None = None)[source]#

Set the beam size.

Parameters:
  • list (Two-items) – width and height for slits or

  • name. (aperture or definer) –

  • size (list[float] | str | None) –

Raises:

RuntimeError – Beam definer not configured Size out of the limits.

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

Wait until beam present.

Parameters:
  • seconds (Optional - timeout in) –

  • timeout (float | None) –

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

Raises:

RuntileError if no beam after the specified timeout.

Parameters:

timeout (float | None) –