forked from NSLS-II/lsdc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config_params.py
124 lines (100 loc) · 3.66 KB
/
config_params.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
import grp
import os
from enum import Enum
# BlConfig parameter variable names
# rastering parameters
RASTER_TUNE_LOW_RES = "rasterTuneLowRes"
RASTER_TUNE_HIGH_RES = "rasterTuneHighRes"
RASTER_TUNE_ICE_RING_FLAG = "rasterTuneIceRingFlag"
RASTER_TUNE_RESO_FLAG = "rasterTuneResoFlag"
RASTER_TUNE_ICE_RING_WIDTH = "rasterTuneIceRingWidth"
RASTER_DOZOR_SPOT_LEVEL = "rasterDozorSpotLevel"
RASTER_NUM_CELLS_DELAY_THRESHOLD = "rasterNumCellsThresholdDelay"
# timing delays
ISPYB_RESULT_ENTRY_DELAY = "ispybResultEntryDelay"
RASTER_LONG_SNAPSHOT_DELAY = "rasterLongSnapshotDelay"
RASTER_SHORT_SNAPSHOT_DELAY = "rasterShortSnapshotDelay"
RASTER_POST_SNAPSHOT_DELAY = "rasterPostSnapshotDelay"
RASTER_GUI_XREC_FILL_DELAY = "rasterGuiXrecFillDelay"
# governor transition gain/exposure times
LOW_MAG_GAIN_DA = "lowMagGainDA"
LOW_MAG_GAIN = "lowMagGain"
LOW_MAG_EXP_TIME_DA = "lowMagExptimeDA"
LOW_MAG_EXP_TIME = "lowMagExptime"
# top view
TOP_VIEW_CHECK = "topViewCheck"
CRYOSTREAM_ONLINE = (
"cryostream_online" # consistent naming with hardware, such as robot_online
)
# constant values below
# GUI default configuration
BEAM_CHECK = "beamCheck"
UNMOUNT_COLD_CHECK = "unmountColdCheck"
# raster request status updates
class RasterStatus(Enum):
"""The lsdc server can keep GUI clients updated on the status of
of raster macros by updating raster request objects in the request
database. The GUI can process raster data, e.g. filling heat maps,
in parallel to the server moving motors and adjusting low mag cam.
"""
NEW = 0
DRAWN = 1
READY_FOR_FILL = 2
READY_FOR_SNAPSHOT = 3
READY_FOR_REPROCESS = 4
HUTCH_TIMER_DELAY = 500
SAMPLE_TIMER_DELAY = 0
SERVER_CHECK_DELAY = 2000
ROBOT_MIN_DISTANCE = 200.0
ROBOT_DISTANCE_TOLERANCE = 0.050
FAST_DP_MIN_NODES = 4
SPOT_MIN_NODES = 8
MOUNT_SUCCESSFUL = 1
MOUNT_FAILURE = 0
MOUNT_UNRECOVERABLE_ERROR = 2
MOUNT_STEP_SUCCESSFUL = 3
UNMOUNT_FAILURE = 0
UNMOUNT_SUCCESSFUL = 1
UNMOUNT_STEP_SUCCESSFUL = 2
PINS_PER_PUCK = 16
DETECTOR_OBJECT_TYPE_LSDC = "lsdc" # using det_lib
DETECTOR_OBJECT_TYPE_OPHYD = "ophyd" # instantiated in start_bs, using Bluesky scans
DETECTOR_OBJECT_TYPE = "detectorObjectType"
DETECTOR_SAFE_DISTANCE = {"fmx": 200.0, "amx": 180.0, "nyx": 200.0}
GOVERNOR_TIMEOUT = 120 # seconds for a governor move
DEWAR_SECTORS = {"amx": 8, "fmx": 8, "nyx": 5}
PUCKS_PER_DEWAR_SECTOR = {"amx": 3, "fmx": 3, "nyx": 3}
cryostreamTempPV = {"amx": "XF:17IDB-ES:AMX{CS:1}SAMPLE_TEMP_RBV", "fmx": "FMX:cs700:gasT-I"}
VALID_EXP_TIMES = {
"amx": {"min": 0.005, "max": 1, "digits": 3},
"fmx": {"min": 0.01, "max": 10, "digits": 3},
"nyx": {"min": 0.002, "max": 10, "digits": 4},
}
VALID_DET_DIST = {
"amx": {"min": 100, "max": 500, "digits": 3},
"fmx": {"min": 137, "max": 2000, "digits": 2},
"nyx": {"min": 100, "max": 500, "digits": 3},
}
VALID_TOTAL_EXP_TIMES = {
"amx": {"min": 0.005, "max": 300, "digits": 3},
"fmx": {"min": 0.01, "max": 300, "digits": 3},
"nyx": {"min": 0.01, "max": 1000, "digits": 3},
}
VALID_PREFIX_LENGTH = 25 # TODO centralize with spreadsheet validation?
VALID_PREFIX_NAME = "[0-9a-zA-Z-_]{0,%s}" % VALID_PREFIX_LENGTH
VALID_TRANSMISSION = {
"amx": {"min": 0.001, "max": 1.0, "digits": 3},
"fmx": {"min": 0.001, "max": 1.0, "digits": 3},
"nyx": {"min": 0.001, "max": 0.999, "digits": 3},
}
MINIMUM_RASTER_SIZE = {"amx": 6, "fmx": 6, "nyx": 2}
LSDC_SERVICE_USERS = ("lsdc-amx", "lsdc-fmx", "lsdc-nyx")
IS_STAFF = (
True
if os.environ.get("STAFF_GROUP") is not None and os.environ["STAFF_GROUP"] in [grp.getgrgid(g).gr_name for g in os.getgroups()]
else False
)
EMBL_SERVER_PV_BASE = {
"amx": "XF:17IDB-ES:AMX{EMBL}",
"fmx": "XF:17IDC-ES:FMX{EMBL}"
}