mxcubecore.HardwareObjects.ESRF.ESRFBeamProxy

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
  beam_position: "250, 260"   # optional [pixels]
objects:
  aperture: udiff_aperture.yaml  # if definer_type aperture
  definer: beam_definer.yaml     # if definer_type definer
  monitor_beam: monitor_beam.yaml

Classes

ESRFBeamProxy(name)

Beam ESRF implementation

class mxcubecore.HardwareObjects.ESRF.ESRFBeamProxy.ESRFBeamProxy(name)[source]

Bases: AbstractBeam

Beam ESRF implementation

class HOConfig(*, beam_position: str | None = None, **extra_data: Any)[source]

Bases: HOConfig

Parameters:
  • beam_position (str | None)

  • extra_data (Any)

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'allow'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

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)