mxcubecore.model.queue_model_objects#
This module contain objects that combined make up the data model. Any object that inherhits from TaskNode can be added to and handled by the QueueModel.
Functions
|
Add Xray centring to queue. |
|
Creates subwedges for interleved collection. |
|
Creates subwedges for inverse beam, and interleves the result. |
|
Creates n subwedges where n = total_num_images / subwedge_size. |
|
return [{'comment': '', 'helical': 0, 'motors': {}, 'take_video': False, 'take_snapshots': False, 'fileinfo': {'directory': '/data/id14eh4/inhouse/opid144/' + '20120808/RAW_DATA', 'prefix': 'opid144', 'run_number': 1, 'process_directory': '/data/id14eh4/inhouse/' + 'opid144/20120808/PROCESSED_DATA'}, 'in_queue': 0, 'detector_binning_mode': 2, 'shutterless': 0, 'sessionId': 32368, 'do_inducedraddam': False, 'sample_reference': {}, 'processing': 'False', 'residues': '', 'dark': True, 'scan4d': 0, 'input_files': 1, 'oscillation_sequence': [{'exposure_time': 1.0, 'kappaStart': 0.0, 'phiStart': 0.0, 'start_image_number': 1, 'number_of_images': 1, 'overlap': 0.0, 'start': 0.0, 'range': 1.0, 'number_of_passes': 1}], 'nb_sum_images': 0, 'EDNA_files_dir': '', 'anomalous': 'False', 'file_exists': 0, 'experiment_type': 'SAD', 'skip_images': 0}] |
|
Classes
|
|
|
|
|
Class represents a basket in the tree. |
|
Class that represents a centred position. |
|
|
|
|
|
|
|
|
|
Dummy task, for mock testing only |
|
|
|
|
|
Optical automatic centering with lucid |
|
|
|
|
|
|
|
|
|
Manual 3 click centering |
|
Objects that inherit TaskNode can be added to and handled by the QueueModel object. |
|
|
|
Class represents XRF spectrum task |
|
|
|
|
|
X-ray centring (2022 version) |
|
|
|
- class mxcubecore.model.queue_model_objects.Basket[source]#
Bases:
TaskNode
Class represents a basket in the tree. It has not task assigned. It represents a parent for samples with the same basket id.
- class mxcubecore.model.queue_model_objects.CentredPosition(motor_dict=None)[source]#
Bases:
object
Class that represents a centred position. Can also be initialized with a mxcube motor dict which simply is a dictonary with the motornames and their corresponding values.
- class mxcubecore.model.queue_model_objects.Characterisation(ref_data_collection=None, characterisation_parameters=None, name='')[source]#
Bases:
TaskNode
- class mxcubecore.model.queue_model_objects.DataCollection(acquisition_list=None, crystal=None, processing_parameters=None, name='', task_data=None)[source]#
Bases:
TaskNode
- get_display_name()[source]#
Descript. : Returns display name depending from collection type Args. : Return : display_name (string)
- get_helical_point_index()[source]#
Descript. : Return indexes of points associated to the helical line Args. : Return : index (integer), index (integer)
- class mxcubecore.model.queue_model_objects.DelayTask(delay=10)[source]#
Bases:
TaskNode
Dummy task, for mock testing only
- class mxcubecore.model.queue_model_objects.EnergyScan(sample=None, path_template=None, cpos=None)[source]#
Bases:
TaskNode
- class mxcubecore.model.queue_model_objects.GphlWorkflow[source]#
Bases:
TaskNode
- calc_maximum_dose(energy=None, exposure_time=None, image_width=None)[source]#
Dose at transmission=100 for given energy, exposure time and image width
The strategy length is taken from self.strategy_length
- Parameters:
Optional[float] (image_width) – Energy in keV; defaults to self.energy
Optional[float] – Value in s; defaults to self.exposure_time
Optional[float] – VAlue in deg; defaults to self.image_width
- Returns:
Maximum dose in MGy
- Return type:
- init_from_task_data(sample_model, params)[source]#
sample_model is required as this may be called before the object is enqueued params is a dictionary with structure determined by mxcubeweb usage
- recommended_dose_budget(resolution=None)[source]#
Get resolution-dependent dose budget using current configuration
- Parameters:
(float) (resolution) – Target resolution (in A), defauls to current setting
- Returns:
- set_pre_acquisition_params(exposure_time=None, image_width=None, wedge_width=None, transmission=None, repetition_count=None, snapshot_count=None, recentring_mode=None, energies=(), skip_collection=False, **unused)[source]#
- Parameters:
exposure_time –
image_width –
wedge_width –
transmission –
repetition_count –
snapshot_count –
recentring_mode –
energies –
skip_collection –
**unused –
Returns:
- set_pre_strategy_params(space_group='', crystal_classes=(), cell_parameters=(), resolution=None, energies=(), strategy='', strategy_options=None, init_spot_dir=None, relative_rad_sensitivity=None, use_cell_for_processing=None, crystal_thickness=None, **unused)[source]#
- Parameters:
(str) (init_spot_dir) –
(tuple(str)) (crystal_classes) –
tuple(float) (energies) –
(Optional[float]) (resolution) –
tuple(float) –
(str) –
(dict) (unused) –
(str) –
(float) (crystal_thickness) –
(bool) (use_cell_for_processing) –
(float) –
(dict) –
- Return (None):
- property strategy_name#
“Strategy full name, e.g. “Two-wavelength MAD”
- property strategy_type#
(“native”, “phasing”, “diffractcal”, “transcal”
- Type:
“Workflow type
- property total_strategy_length#
Total strategy length for a single repetition (but counting all wavelengths)
- property wfname#
“Workflow full name, e.g. “GΦL Diffractometer calibration”
- property wftype#
(“acquisition”, “diffractcal”, “transcal”
- Type:
“Workflow type
- class mxcubecore.model.queue_model_objects.OpticalCentring(user_confirms=False)[source]#
Bases:
TaskNode
Optical automatic centering with lucid
- class mxcubecore.model.queue_model_objects.SampleCentring(name=None, kappa=None, kappa_phi=None, motor_positions=None)[source]#
Bases:
TaskNode
Manual 3 click centering
kappa and kappa_phi settings are applied first, and assume that the beamline does have axes with exactly these names
Other motor_positions are applied afterwards, but in random order. motor_positions override kappa and kappa_phi if both are set
Since setting one motor can change the position of another (on ESRF ID30B setting kappa and kappa_phi changes the translation motors)
the order is important.
- class mxcubecore.model.queue_model_objects.TaskNode(task_data=None)[source]#
Bases:
object
Objects that inherit TaskNode can be added to and handled by the QueueModel object.
- set_enabled(state)[source]#
Sets the enabled state, True represents enabled (executable) and false disabled (not executable).
- Parameters:
state (bool) – The state, True or False
- class mxcubecore.model.queue_model_objects.XRFSpectrum(sample=None, path_template=None, cpos=None)[source]#
Bases:
TaskNode
Class represents XRF spectrum task
- class mxcubecore.model.queue_model_objects.XrayCentering(ref_data_collection=None, crystal=None)[source]#
Bases:
TaskNode
- class mxcubecore.model.queue_model_objects.XrayCentring2(name=None, motor_positions=None, grid_size=None, workflow_parameters=None)[source]#
Bases:
TaskNode
X-ray centring (2022 version)
Contains all parameters necessary for X-ray centring This object is passed to the QueueEntry and HardwareObject Parameters not defined here must be set as defaults, somehow (transmission, grid step, …)
- class mxcubecore.model.queue_model_objects.XrayImaging(xray_imaging_params, acquisition=None, crystal=None, name='')[source]#
Bases:
TaskNode
- mxcubecore.model.queue_model_objects.addXrayCentring(parent_node, **centring_parameters)[source]#
Add Xray centring to queue.
- mxcubecore.model.queue_model_objects.create_interleave_sw(interleave_list, num_images, sw_size)[source]#
Creates subwedges for interleved collection. Wedges W1, W2, Wm (where m is num_collections) are created: (W1_1, W2_1, …, W1_m), … (W1_n-1, W2_n-1, …, Wm_n-1), (W1_n, W2_n, …, Wm_n)
- Parameters:
first collection certain number of subwedges will be created. If first collection contains more images than others then in the end the rest of images from first collections are created as last subwedge :type num_images: int
- Parameters:
sw_size (int) – Number of images in each subwedge
- Returns:
A list of tuples containing the swb wedges. The tuples are in the form: (collection_index, subwedge_index, subwedge_firt_image,
subwedge_start_osc)
- Return type:
List [(…), (…)]
- mxcubecore.model.queue_model_objects.create_inverse_beam_sw(num_images, sw_size, osc_range, osc_start, run_number)[source]#
Creates subwedges for inverse beam, and interleves the result. Wedges W1 and W2 are created 180 degres apart, the result is interleaved and given on the form: (W1_1, W2_1), … (W1_n-1, W2_n-1), (W1_n, W2_n)
- Parameters:
num_images (int) – The total number of images
sw_size (int) – Number of images in each subwedge
osc_range (double) – Oscillation range for each image
osc_start (double) – The start angle/offset of the oscillation
run_number – Run number for the first wedge (W1), the run number of the second wedge will be run_number + 1.
- Returns:
A list of tuples containing the swb wedges. The tuples are on the form: (start_image, num_images, osc_start, run_number)
- Return type:
List [(…), (…)]
- mxcubecore.model.queue_model_objects.create_subwedges(total_num_images, sw_size, osc_range, osc_start)[source]#
Creates n subwedges where n = total_num_images / subwedge_size.
- Parameters:
total_num_images (int) – The total number of images
osc_range (double) – Oscillation range for each image
osc_start (double) – The start angle/offset of the oscillation
- Returns:
List of tuples with the format: (start image number, number of images, oscilation start)
- mxcubecore.model.queue_model_objects.to_collect_dict(data_collection, sample, centred_pos=None)[source]#
return [{‘comment’: ‘’, ‘helical’: 0, ‘motors’: {}, ‘take_video’: False, ‘take_snapshots’: False, ‘fileinfo’: {‘directory’: ‘/data/id14eh4/inhouse/opid144/’ + ‘20120808/RAW_DATA’,
‘prefix’: ‘opid144’, ‘run_number’: 1, ‘process_directory’: ‘/data/id14eh4/inhouse/’ + ‘opid144/20120808/PROCESSED_DATA’},
‘in_queue’: 0, ‘detector_binning_mode’: 2, ‘shutterless’: 0, ‘sessionId’: 32368, ‘do_inducedraddam’: False, ‘sample_reference’: {}, ‘processing’: ‘False’, ‘residues’: ‘’, ‘dark’: True, ‘scan4d’: 0, ‘input_files’: 1, ‘oscillation_sequence’: [{‘exposure_time’: 1.0,
‘kappaStart’: 0.0, ‘phiStart’: 0.0, ‘start_image_number’: 1, ‘number_of_images’: 1, ‘overlap’: 0.0, ‘start’: 0.0, ‘range’: 1.0, ‘number_of_passes’: 1}],
‘nb_sum_images’: 0, ‘EDNA_files_dir’: ‘’, ‘anomalous’: ‘False’, ‘file_exists’: 0, ‘experiment_type’: ‘SAD’, ‘skip_images’: 0}]