mxcubecore.HardwareObjects.DESY.P11Collect#

Classes

P11Collect(*args)

class mxcubecore.HardwareObjects.DESY.P11Collect.P11Collect(*args)[source]#

Bases: AbstractCollect

acquisition_cleanup()[source]#

Performs cleanup after data acquisition, including stopping the detector and resetting motor velocities.

add_h5_info_characterisation(imagepath, start_angles_collected, degreesperframe)[source]#

Adds metadata to the HDF5 file for characterization data collection.

Parameters:
  • imagepath (str) – Path to the HDF5 file.

  • start_angles_collected (list) – List of angles at which images were collected.

  • degreesperframe (float) – Number of degrees per frame collected.

add_h5_info_standard_data_collection(imagepath)[source]#

Adds metadata to the HDF5 file for a standard data collection.

Parameters:

imagepath (str) – Path to the HDF5 file.

adxv_notify(image_filename, image_num=1)[source]#

Sends a notification to an ADXV to load an image file and display a specific slab.

Parameters:
  • image_filename (str) – Filename of the image to be loaded.

  • image_num (int, optional) – Image number to load in ADXV. Defaults to 1.

autoproc_maxwell()[source]#

Starts AutoProc auto-processing on the Maxwell cluster.

base_dir(path, what)[source]#

Returns the base directory path that contains the specified “what” directory or file.

Parameters:
  • path (str) – The path to a file or directory.

  • what (str) – The directory or file name to search for.

Returns:

The base directory containing the “what”.

Return type:

str

check_path(path=None, force=False)[source]#

Checks if a path is valid and accessible, and creates directories if needed.

Parameters:
  • path (str, optional) – The path to check. Defaults to None.

  • force (bool, optional) – Whether to create the directories if they don’t exist. Defaults to False.

Returns:

The path if valid and accessible, or False if not.

Return type:

str or bool

collect_characterisation(start_angle, img_range, nimages, angle_inc, exp_time)[source]#

Collects a series of images at different angles for characterization.

Parameters:
  • start_angle (float) – Starting angle for the characterization acquisition.

  • img_range (float) – Range of angles over which a single image is collected.

  • nimages (int) – Number of images to be collected during the characterization process.

  • angle_inc (float) – Increment in angle between each image in the collection.

  • exp_time (float) – Exposure time for each image.

collect_std_collection(start_angle, stop_angle)[source]#

Performs the standard data collection by moving the omega motor from start to stop angle.

Parameters:
  • start_angle (float) – Starting angle for the collection.

  • stop_angle (float) – Stop angle for the collection.

create_characterisation_directories()[source]#

Creates directories for raw files and processing files for EDNA and MOSFLM.

create_directories(*args)[source]#

Creates directories for raw files and processing files.

create_file_directories()[source]#

Creates directories for raw files and processing files.

create_or_get_dataset(group, dataset_name, dataset_data)[source]#

Creates or retrieves a dataset within a group.

Parameters:
  • group (h5py.Group) – The group where the dataset will be created or retrieved.

  • dataset_name (str) – The name of the dataset.

  • dataset_data – The data to be stored in the dataset.

data_collection_hook()[source]#

Handles site-specific data collection processes.

diffractometer_prepare_collection()[source]#

Prepares the diffractometer for data collection.

Returns:

True if the diffractometer is in collect phase, False otherwise.

Return type:

bool

get_filter_thickness()[source]#

Calculates the total thickness of three filters.

Returns:

The total thickness of the filters in meters. If the filter server is not available, it returns -1.

Return type:

float

get_filter_thickness_in_mm()[source]#

Calculates the total thickness of three filters in millimeters.

Returns:

The total thickness of the filters in millimeters. If the filter server is not available, it returns -1.

Return type:

int

get_filter_transmission()[source]#

Gets the current transmission value from the filter server.

Returns:

The current transmission value. If the filter server is not available, it returns -1.

Return type:

float

get_or_create_group(parent_group, group_name)[source]#

Gets or creates a group within a parent group.

Parameters:
  • parent_group (h5py.Group) – The parent group where the new group will be created.

  • group_name (str) – The name of the group to get or create.

Returns:

The group object.

Return type:

h5py.Group

get_relative_path(path1, path2)[source]#

Returns the relative path from path1 to path2.

Parameters:
  • path1 (str) – First path.

  • path2 (str) – Second path.

Returns:

The relative path between path1 and path2.

Return type:

str

init()[source]#

Initializes beamline collection parameters like default speed and server names.

is_process_running(process_name)[source]#

Checks if a process is running by its name.

Parameters:

process_name (str) – Name of the process to check.

Returns:

True if the process is running, False otherwise.

Return type:

bool

mkdir_with_mode(directory, mode)[source]#

Creates a directory with the specified mode.

Parameters:
  • directory (str) – Path of the directory to create.

  • mode (int) – Mode (permissions) to set for the directory.

prepare_characterization()[source]#

Prepares for characterization data collection by setting the start angle and angle increment for the detector.

prepare_input_files()[source]#

Prepares directories for processing input files.

Returns:

Paths for XDS and AutoProc directories.

Return type:

tuple

prepare_std_collection(start_angle, img_range)[source]#

Prepares a standard collection by setting the start angle and angle increment in the detector’s header.

Parameters:
  • start_angle (float) – Starting angle for the standard collection sequence.

  • img_range (float) – Angle increment for each frame.

Returns:

True if successful, False otherwise.

Return type:

bool

progress_emitter(start_time, duration)[source]#

Emits progress steps during data collection.

Parameters:
  • start_time (float) – Start time of the data collection.

  • duration (float) – Estimated duration of the data collection.

set_energy(value)[source]#

Sets the energy value on the beamline.

Parameters:

value (float) – Energy value to set.

set_resolution(value)[source]#

Sets the resolution of the beamline.

Parameters:

value (float) – Resolution value to set.

set_transmission(value)[source]#

Sets the transmission value on the beamline.

Parameters:

value (float) – Transmission value to set.

start_process(command)[source]#

Starts a process with the specified command.

Parameters:

command (list) – List of command arguments to start the process.

take_crystal_snapshots()[source]#

Takes sample snapshots and saves them to disk.

trigger_auto_processing(process_event=None, frame_number=None)[source]#

Triggers auto processing based on the experiment type.

Parameters:
  • process_event – Optional event that triggered the auto processing.

  • frame_number (int, optional) – Number of frames to process.

write_info_txt(path, name, startangle, frames, degreesperframe, imageinterval, exposuretime, run_type)[source]#

Writes info about the data collection into a text file.

Parameters:
  • path (str) – Directory path where the info file will be saved.

  • name (str) – Name of the run.

  • startangle (float) – Starting angle of the collection.

  • frames (int) – Number of frames collected.

  • degreesperframe (float) – Degrees per frame.

  • imageinterval (float) – Interval between images.

  • exposuretime (float) – Exposure time in milliseconds.

  • run_type (str) – Type of run (e.g., ‘regular’ or ‘screening’).

xdsapp_maxwell()[source]#

Starts XDSAPP auto-processing on the Maxwell cluster.