Skip to content
Snippets Groups Projects

[AGIPD][DARK] Avoid failed jobs for creating constants and injecting them

Merged Karim Ahmed requested to merge feat/agipd_single_module into master
1 unresolved thread
+ 19
15
@@ -231,44 +231,48 @@ def create_constant_overview(constant, name, cells, vmin=None, vmax=None,
ax.set_ylim(vmin, vmax)
def show_processed_modules(dinstance: str, constants: Optional[Dict[str, Any]],
mnames: str, mode: str):
def show_processed_modules(
detector: str,
constants: Optional[Dict[str, Any]],
mnames: str,
mode: str
):
"""
Show the status of the processed modules.
Green: Processed. Gray: Not Processed. Red: No data available.
:param dinstance: The detector instance (e.g. AGIPD1M1 or LPD1M1)
:param constants: A dict of the plotted constants data.
{"const_name":constant_data}. Can be None in case of position mode.
:param mnames: A list of available module names.
:param mode: String selecting on of the two modes of operation.
"position": To just show the position of the processed modules.
"processed": To show the modules successfully processed.
:return
Args:
detector: The detector name (karabo_id) (e.g. MID_DET_AGIPD1M-1 or FXE_DET_LPD1M-1)
constants: A dict of the plotted constants data.
{"const_name":constant_data}. Can be None in case of position mode.
mnames: A list of available module names.
mode: String selecting on of the two modes of operation.
"position": To just show the position of the processed modules.
"processed": To show the modules successfully processed.
"""
# Create the geometry figure for each detector
if dinstance in ('AGIPD1M1', 'AGIPD1M2'):
if "AGIPD1M" in detector:
quadrants = 4
modules = 4
tiles = 8
quad_pos = [(-525, 625), (-550, -10), (520, -160), (542.5, 475)]
geom = AGIPD_1MGeometry.from_quad_positions(quad_pos)
elif dinstance == 'AGIPD500K':
elif "AGIPD500K" in detector:
quadrants = 2
modules = 4
tiles = 8
geom = AGIPD_500K2GGeometry.from_origin()
elif 'LPD' in dinstance:
elif 'LPD' in detector:
quadrants = 4
modules = 4
tiles = 16
quad_pos = [(11.4, 299), (-11.5, 8), (254.5, -16), (278.5, 275)]
geom = LPD_1MGeometry.from_quad_positions(quad_pos)
elif 'DSSC' in dinstance:
elif 'DSSC' in detector:
quadrants = 4
modules = 4
tiles = 2
@@ -279,7 +283,7 @@ def show_processed_modules(dinstance: str, constants: Optional[Dict[str, Any]],
quad_pos)
else:
raise ValueError(f'{dinstance} is not a real detector')
raise ValueError(f'{detector} detector is not available for plotting.')
# Create a dict that contains the range of tiles, in the figure,
# that belong to a module.
Loading