mxcubecore.HardwareObjects.SampleView#
Functions
|
Classes
|
|
|
|
|
|
|
SampleView class |
|
Base class for shapes. |
|
- class mxcubecore.HardwareObjects.SampleView.SampleView(name)[source]#
Bases:
AbstractSampleViewSampleView class
- add_shape(shape)[source]#
Add the shape <shape> to the dictionary of handled shapes.
- Parameters:
shape – Shape to add.
- add_shape_from_mpos(mpos_list: list[float], screen_coord: tuple[int, int], t: str, state: Literal['HIDDEN', 'SAVED', 'TMP'] = 'SAVED', user_state: Literal['HIDDEN', 'SAVED', 'TMP'] = 'SAVED')[source]#
Adds a shape of type <t>, with motor positions from mpos_list and screen position screen_coord.
- Parameters:
- Returns:
(Shape) Shape of type <t>
- add_shape_from_refs(refs, t, state: Literal['HIDDEN', 'SAVED', 'TMP'] = 'SAVED', user_state: Literal['HIDDEN', 'SAVED', 'TMP'] = 'SAVED')[source]#
Adds a shape of type <t>, taking motor positions and screen positions from reference points in refs.
- de_select_shape(sid)[source]#
De-select the shape with id <sid>.
- Parameters:
sid (str) – The id of the shape to de-select.
- get_centred_point_from_coord(x, y, return_by_names=None)[source]#
Get the motor positions form x,y pixel coordinates
- get_grid()[source]#
Get the first of the selected grids, (the one that was selected first in a sequence of select operations)
- Returns:
The first selected grid as a dictionary
- Return type:
(dict)
- get_grids() list[source]#
Get all Grids currently handled.
- Returns:
List[Grid] - All currently handled grids,
- Return type:
- get_lines() list[source]#
Get all Lines currently handled.
- Returns:
List[Line] - All currently handled lines.
- Return type:
- get_points() list[source]#
Get all Points currently handled.
- Returns:
List[Point] - All currently handled points.
- Return type:
- get_positions() dict[str, float][source]#
Get motor positions for the centring motors.
- Returns:
position}
- Return type:
Centring motor positions as {role
- get_selected_shapes()[source]#
Get all selected shapes.
- Returns:
(list[Shape]) List of selected Shapes
- get_shape(sid: str)[source]#
Get Shape with id <sid>.
- Parameters:
sid (str) – id of Shape to retrieve
- Returns:
(Shape) All the shapes
- get_snapshot(overlay: str | None = None, bw: bool = False, return_as_array: bool = False) BytesIO[source]#
Get snapshot(s)
- inc_used_for_collection(cpos)[source]#
Increase counter that keepts on collect made on this shape, shape with associated CenteredPosition cpos
- Parameters:
cpos (CenteredPosition) – CenteredPosition of shape
- init()[source]#
‘public’ post-initialization method. Override as needed.
For ConfiguredObjects called after loading contained objects.
- is_selected(sid)[source]#
Check if Shape with <sid> is selected.
- Returns:
(Boolean) True if Shape with <sid> is selected False otherwise
- motor_positions_to_screen(positions_dict: dict[str, float]) tuple[int, int][source]#
Get the x,y pixel value according to the calibration.
- move_to_beam(x: float, y: float)[source]#
Move the sample to the x,y coordinates. :param x: Pixels on x axis :param y: Pixels on y axis
- save_snapshot(filename: str, overlay: str | None = None, bw: bool = False)[source]#
Save a snapshot to file.
- select_shape(sid)[source]#
Select the shape <shape>.
- Parameters:
sid (str) – Id of the shape to select.
- select_shape_with_cpos(cpos)[source]#
Selects shape with the assocaitaed centred position <cpos>
- Parameters:
cpos (CenteredPosition) –
- set_grid_data(sid: str, result_data, data_file_path: str)[source]#
Sets grid rsult data for a shape with the specified id.
- Parameters:
sid (str) – The id of the shape to set grid data for.
result_data – The result data to set for the shape. Either a base64 encoded string for PNG/image or a dictionary for RGB (keys are cell number and value RGBa list). Data is only updated if result is RGB based
data_file_path (str) – The path to the data file associated with the result data.
- Raises:
AttributeError – If no shape with the specified id exists.
- set_rotation_axis_position(value: float)[source]#
Set the reference position for the rotation axis.
value: the position
- Parameters:
value (float) –
- start_manual_centring(nb_click: int = 3)[source]#
Do the manual centring procedure.
- Parameters:
nb_click (int) – Number of clicks.