mxcubecore.HardwareObjects.abstract.AbstractBeam#

Abstract beam hardware object.

Classes

AbstractBeam(name)

Abstract beam hardware object.

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

Beam shape definitions

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

Bases: HardwareObject

Abstract beam hardware object.

Has methods to define the size and shape of the beam.

Emits:
  • beamSizeChanged (tuple[float, float]) – Two-item tuple of beam width and beam height in micrometers emitted when the beam size has changed.

  • beamInfoChanged (dict) – Dictionary containing beam info emitted when the beam info has changed.

_aperture#

reference to the aperture hardware object

_slits#

reference to the slits hardware object

_definer#

reference to the slits hardware object

_beam_size_dict#

dictionary containing min max of aperture, slits and definer.

Type:

dict

_beam_width#

beam size in horizontal direction

Type:

float

_beam_height#

beam size in vertical direction

Type:

float

_beam_shape#

beam shape (rectangular, ellipse, unknown)

Type:

str

_beam_divergence#

beam divergence in horizontal and vertical directions

Type:

tuple

_beam_position_on_screen#

beam position in pixel units

Type:

list

_beam_info_dict#

dictionary containing size_x, size_y, shape, label

Type:

dict

property aperture#

Aperture hardware object.

property definer#

Beam definer hardware object.

evaluate_beam_info() dict[source]#

Method called if aperture, slits or focusing has been changed.

Evaluates which of the beam size defining devices determines the size.

Returns:

Beam info dictionary dict, type of the definer str. {size_x: float, size_y: float, shape: BeamShape enum, label: str}.

Return type:

dict

get_available_size() dict[source]#

Get the available beam definers configuration.

Returns:

Dictionary {"type": (list), "values": (list)} where type is the definer type ("aperture", "slits","definer") and values is a list of available beam size definitions according to type.

Raises:

NotImplementedError

Return type:

dict

get_beam_divergence() tuple[source]#

Get the beam divergence.

Returns:

Beam divergence (horizontal, vertical) in micrometers.

Return type:

tuple

get_beam_info_dict() dict[source]#

Get beam info dictionary.

Returns:

Copy of beam info dictionary.

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_shape() BeamShape[source]#

Get the beam shape.

Returns:

Beam shape.

Return type:

BeamShape

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), ...]}.

Raises:

NotImplementedError

Return type:

dict

get_value() tuple[float, float, mxcubecore.HardwareObjects.abstract.AbstractBeam.BeamShape, str][source]#
Get the beam size (width and height), shape and label.

The size is in millimeters.

Returns:

width, height, shape, name

Return type:

Four-item tuple

init() None[source]#

Initialise default values and objects.

Return type:

None

property is_beam: bool#

Check if there is beam.

Returns:

True if beam present, False otherwise.

re_emit_values()[source]#

Reemit beamSizeChanged and beamInfoChanged signals.

set_beam_position_on_screen(beam_x_y: list) None[source]#

Set the beam position.

Parameters:

beam_x_y (list) – X and Y coordinates of the beam position in pixels.

Raises:

NotImplementedError

Return type:

None

set_beam_size_shape(beam_width: float, beam_height: float, beam_shape: BeamShape) None[source]#

Set beam size and shape.

Parameters:
  • beam_width (float) – Requested beam width in microns.

  • beam_height (float) – Requested beam height in microns.

  • beam_shape (BeamShape) – Requested beam shape.

Return type:

None

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

Set the beam size. :param size: List of width and height in micrometers or

aperture or definer name as string.

Raises:

NotImplementedError

Parameters:

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

Return type:

None

property slits#

Slits hardware object.

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) –

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

Bases: Enum

Beam shape definitions