mxcubecore.HardwareObjects.GenericDiffractometer#
GenericDiffractometer
Classes
|
|
|
|
|
|
Enumeration of diffractometer states |
|
|
Abstract base class for diffractometers |
|
|
|
|
|
|
|
|
|
|
|
- class mxcubecore.HardwareObjects.GenericDiffractometer.BlockShapeEnum(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
- class mxcubecore.HardwareObjects.GenericDiffractometer.CalibrationData(*, top_left: Tuple[float, float, float] = [0, 0, 0], top_right: Tuple[float, float, float] = [0, 0, 0], bottom_left: Tuple[float, float, float] = [0, 0, 0])[source]#
Bases:
BaseModel- Parameters:
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'bottom_left': FieldInfo(annotation=Tuple[float, float, float], required=False, default=[0, 0, 0], description='Bottom left corner motor position'), 'top_left': FieldInfo(annotation=Tuple[float, float, float], required=False, default=[0, 0, 0], description='Top left corner motor position'), 'top_right': FieldInfo(annotation=Tuple[float, float, float], required=False, default=[0, 0, 0], description='Top right corner motor position')}#
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class mxcubecore.HardwareObjects.GenericDiffractometer.ChipLayout(*, head_type: HeadTypeEnum = HeadTypeEnum.chip, holder_type: HolderTypeEnum = HolderTypeEnum.known_geometry, holder_brand: str = '', holder_size: Tuple[float, float] = [0, 0], sections: List[SampleHolderSectionModel] = [], calibration_data: CalibrationData | None = None)[source]#
Bases:
BaseModel- Parameters:
head_type (HeadTypeEnum) –
holder_type (HolderTypeEnum) –
holder_brand (str) –
sections (List[SampleHolderSectionModel]) –
calibration_data (CalibrationData | None) –
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'calibration_data': FieldInfo(annotation=Union[CalibrationData, NoneType], required=False, default=None), 'head_type': FieldInfo(annotation=HeadTypeEnum, required=False, default=<HeadTypeEnum.chip: 'CHIP'>), 'holder_brand': FieldInfo(annotation=str, required=False, default='', description='Brand/make of sample holder'), 'holder_size': FieldInfo(annotation=Tuple[float, float], required=False, default=[0, 0], description='Size of sample holder in mm horizontal and vertical'), 'holder_type': FieldInfo(annotation=HolderTypeEnum, required=False, default=<HolderTypeEnum.known_geometry: 'KNOWN_GEOMETRY'>), 'sections': FieldInfo(annotation=List[SampleHolderSectionModel], required=False, default=[])}#
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class mxcubecore.HardwareObjects.GenericDiffractometer.DiffractometerState[source]#
Bases:
objectEnumeration of diffractometer states
- class mxcubecore.HardwareObjects.GenericDiffractometer.GenericDiffractometer(name)[source]#
Bases:
HardwareObjectAbstract base class for diffractometers
- accept_centring()[source]#
Descript. : Arg. “ fully_centred_point. True if 3 click centring
else False
- property alignment_x#
alignment_x motor object (also used as graphics.focus)
- Returns:
AbstractActuator
- property alignment_y#
alignment_y motor object
- Returns:
AbstractActuator
- property alignment_z#
alignment_z motor object
- Returns:
AbstractActuator
- property centring_x#
centring_x motor object
- Returns:
AbstractActuator
- property centring_y#
centring_y motor object
- Returns:
AbstractActuator
- execute_server_task(method, timeout=30, *args)[source]#
- Method is used to execute commands and wait till
diffractometer is in ready state
- Parameters:
method (instance) – method to be executed
timeout (seconds) – timeout in seconds
- force_emit_signals()[source]#
Emits all hardware object signals
The method is called from the gui via beamline object to ensure that bricks have values after the initialization. Problem arise when a hardware object is used by several bricks. If first brick connects to some signal emitted by a brick then other bricks connecting to the same signal will not receive the values on the startup. The easiest solution is to call force_emit_signals method directly after the initialization of the beamline object
- get_pixels_per_mm()[source]#
Returns tuple with pixels_per_mm_x and pixels_per_mm_y
- Returns:
list with two floats
- get_point_between_two_points(point_one, point_two, frame_num, frame_total)[source]#
Method returns a centring point between two centring points It is used to get a position on a helical line based on frame number and total frame number
- get_scan_limits(speed=None, num_images=None, exp_time=None)[source]#
Gets scan limits. Necessary for example in the plate mode where osc range is limited
- get_snapshot()[source]#
Get snapshot from sample view
- Returns:
A bytes object of the current camera image.
- Return type:
- image_clicked(x: float, y: float, xi: float | None = None, yi: float | None = None)[source]#
Handles a user click sent from the frontend during the manual centring.
This method is called by the backend when the user clicks on the sample image in the frontend.
The attribute self.waiting_for_click controls whether the click should be accepted or ignored:
None: click is accepted (legacy)
True: waiting for a click, accept it and mark it as received
False: already received a click, ignore further clicks
- Parameters:
- Raises:
RuntimeError – If a click is received while a previous one is still being processed.
- init()[source]#
‘public’ post-initialization method. Override as needed.
For ConfiguredObjects called after loading contained objects.
- property kappa#
kappa motor object
- Returns:
AbstractActuator
- property kappa_phi#
kappa motor object
- Returns:
AbstractActuator
- move_motors(motor_positions, timeout=15)[source]#
Moves diffractometer motors to the requested positions
- Parameters:
motors_dict (dict) – dictionary with motor names or hwobj and target values.
- move_to_beam(x, y, omega=None)[source]#
- Descript.function to create a centring point based on all motors
positions.
- property omega#
omega motor object
- Returns:
AbstractActuator
- set_phase(phase, timeout=None)[source]#
- Sets diffractometer to selected phase
By default available phase is Centring, BeamLocation, DataCollection, Transfer
- Parameters:
phase (string) – phase
timeout (int) – timeout in sec
- set_use_sc(flag)[source]#
Sets use_sc flag, that indicates if sample changer is used
- Parameters:
flag (boolean) – use sample changer flag
- wait_device_ready(timeout=30)[source]#
Waits when diffractometer status is ready:
- Parameters:
timeout (int) – timeout in second
- wait_ready(timeout=30)#
Waits when diffractometer status is ready:
- Parameters:
timeout (int) – timeout in second
- property zoom#
zoom motor object
NBNB TBD This is supposedly now living in AbstractSampleView, And the property was removed in an earlier PR (20251021, 15:24 Elmir Jagudin) BUT 1) there does not seem to be any mechanism to set it from config there 2) it is configured on the diffractometer according to available config files 3) accessing diffractometer.zoom is all through the code This needs global refactoring, but meanwhile this property should remain
- Returns:
AbstractActuator
- class mxcubecore.HardwareObjects.GenericDiffractometer.GonioHeadConfiguration(*, current: str = '', available: Dict[str, ChipLayout] = {})[source]#
Bases:
BaseModel- Parameters:
current (str) –
available (Dict[str, ChipLayout]) –
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'available': FieldInfo(annotation=Dict[str, ChipLayout], required=False, default={}, description='Available chip layouts'), 'current': FieldInfo(annotation=str, required=False, default='', description='Selected chip layout')}#
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class mxcubecore.HardwareObjects.GenericDiffractometer.HeadTypeEnum(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
- class mxcubecore.HardwareObjects.GenericDiffractometer.HolderTypeEnum(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
- class mxcubecore.HardwareObjects.GenericDiffractometer.PhaseEnum(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
- class mxcubecore.HardwareObjects.GenericDiffractometer.PhaseModel(*, value: PhaseEnum = PhaseEnum.unknown)[source]#
Bases:
BaseModel- Parameters:
value (PhaseEnum) –
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'value': FieldInfo(annotation=PhaseEnum, required=False, default=<PhaseEnum.unknown: 'Unknown'>)}#
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class mxcubecore.HardwareObjects.GenericDiffractometer.SampleHolderSectionModel(*, calibration_data: CalibrationData | None = None, section_offset: Tuple[int, int] = [0, 0], block_size: Tuple[float, float] = [15, 15], block_spacing: Tuple[float, float] = [15, 15], block_shape: BlockShapeEnum = BlockShapeEnum.rectangular, number_of_rows: int = 6, number_of_collumns: int = 6, row_labels: List[str] = [], column_lables: List[str] = [], targets_per_block: Tuple[int, int] = [20, 20])[source]#
Bases:
BaseModel- Parameters:
calibration_data (CalibrationData | None) –
block_shape (BlockShapeEnum) –
number_of_rows (int) –
number_of_collumns (int) –
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'block_shape': FieldInfo(annotation=BlockShapeEnum, required=False, default=<BlockShapeEnum.rectangular: 'RECTANGULAR'>), 'block_size': FieldInfo(annotation=Tuple[float, float], required=False, default=[15, 15], description='Block size horizontal, vertical in mm'), 'block_spacing': FieldInfo(annotation=Tuple[float, float], required=False, default=[15, 15], description='Spacing between blocks horizontal, vertical in mm'), 'calibration_data': FieldInfo(annotation=Union[CalibrationData, NoneType], required=False, default=None), 'column_lables': FieldInfo(annotation=List[str], required=False, default=[], description='Collumn lables'), 'number_of_collumns': FieldInfo(annotation=int, required=False, default=6, description='Numer of collumns'), 'number_of_rows': FieldInfo(annotation=int, required=False, default=6, description='Numer of rows'), 'row_labels': FieldInfo(annotation=List[str], required=False, default=[], description='Row lables'), 'section_offset': FieldInfo(annotation=Tuple[int, int], required=False, default=[0, 0], description='Block offset in grid layout system coordinates x, y'), 'targets_per_block': FieldInfo(annotation=Tuple[int, int], required=False, default=[20, 20], description='Targets per block dim1 and dim2')}#
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.