mxcubecore.HardwareObjects.abstract.AbstractBeam#

Abstract beam hardware object.

Classes

AbstractBeam(name)

Abstract beam hardware object.

BeamShape(value)

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 aperure, 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:

tuple

_beam_info_dict#

dictionary containing size_x, size_y, shape, label

Type:

dict

property aperture#

Aperture hardware object.

property definer#

Beam definer device, equipment like focusing optics, CRLs, and etc.

evaluate_beam_info() dict[source]#

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

Evaluates which of the beam size defining devices determins 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.

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

Get the beam position.

Returns:

X and Y coordinates of the beam position in pixels.

Return type:

tuple

get_beam_shape() BeamShape[source]#

Get beam shape.

Returns:

Beam shape.

Return type:

BeamShape

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

Get 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

init() None[source]#

Initialise default values and objects.

Return type:

None

re_emit_values()[source]#

Reemit beamSizeChanged and beamInfoChanged signals.

set_beam_position_on_screen(beam_x_y: tuple) None[source]#

Set the beam position.

Parameters:

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

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 heigth in micrometers or

aperture or definer name as string.

Parameters:

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

Return type:

None

property slits#

Slits hardware object.

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

Bases: Enum

Beam shape definitions