mxcubecore 1.403.0__py3-none-any.whl → 1.405.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mxcubecore might be problematic. Click here for more details.
- mxcubecore/Command/Mockup.py +0 -0
- mxcubecore/Command/Pool.py +0 -0
- mxcubecore/Command/Tine.py +0 -0
- mxcubecore/HardwareObjects/GenericDiffractometer.py +0 -0
- mxcubecore/HardwareObjects/MAXIV/MAXIVAutoProcessing.py +0 -0
- mxcubecore/HardwareObjects/MAXIV/MachInfo.py +0 -0
- mxcubecore/HardwareObjects/QtAxisCamera.py +0 -0
- mxcubecore/HardwareObjects/SampleStage.py +0 -0
- mxcubecore/HardwareObjects/TangoLimaVideo.py +0 -0
- mxcubecore/HardwareObjects/autoprocessing.py +0 -0
- mxcubecore/HardwareObjects/mockup/MicrodiffInOutMockup.py +0 -0
- mxcubecore/HardwareObjects/mockup/QtVideoMockup.py +0 -0
- {mxcubecore-1.403.0.dist-info → mxcubecore-1.405.0.dist-info}/METADATA +1 -1
- {mxcubecore-1.403.0.dist-info → mxcubecore-1.405.0.dist-info}/RECORD +5 -21
- mxcubecore/HardwareObjects/LNLS/EPICSActuator.py +0 -78
- mxcubecore/HardwareObjects/LNLS/EPICSMotor.py +0 -104
- mxcubecore/HardwareObjects/LNLS/EPICSNState.py +0 -87
- mxcubecore/HardwareObjects/LNLS/LNLSAperture.py +0 -69
- mxcubecore/HardwareObjects/LNLS/LNLSBeam.py +0 -125
- mxcubecore/HardwareObjects/LNLS/LNLSCamera.py +0 -507
- mxcubecore/HardwareObjects/LNLS/LNLSCollect.py +0 -482
- mxcubecore/HardwareObjects/LNLS/LNLSDetDistMotor.py +0 -76
- mxcubecore/HardwareObjects/LNLS/LNLSDiffractometer.py +0 -538
- mxcubecore/HardwareObjects/LNLS/LNLSEnergy.py +0 -81
- mxcubecore/HardwareObjects/LNLS/LNLSPilatusDet.py +0 -478
- mxcubecore/HardwareObjects/LNLS/LNLSSlits.py +0 -48
- mxcubecore/HardwareObjects/LNLS/LNLSTransmission.py +0 -82
- mxcubecore/HardwareObjects/LNLS/LNLSZoom.py +0 -93
- mxcubecore/HardwareObjects/LNLS/read_transmission_mnc.py +0 -149
- mxcubecore/HardwareObjects/LNLS/set_transmission_mnc.py +0 -306
- {mxcubecore-1.403.0.dist-info → mxcubecore-1.405.0.dist-info}/COPYING +0 -0
- {mxcubecore-1.403.0.dist-info → mxcubecore-1.405.0.dist-info}/COPYING.LESSER +0 -0
- {mxcubecore-1.403.0.dist-info → mxcubecore-1.405.0.dist-info}/WHEEL +0 -0
|
@@ -1,482 +0,0 @@
|
|
|
1
|
-
import logging
|
|
2
|
-
import os
|
|
3
|
-
|
|
4
|
-
import gevent
|
|
5
|
-
|
|
6
|
-
from mxcubecore import HardwareRepository as HWR
|
|
7
|
-
from mxcubecore.BaseHardwareObjects import HardwareObject
|
|
8
|
-
from mxcubecore.HardwareObjects.abstract.AbstractMultiCollect import (
|
|
9
|
-
AbstractMultiCollect,
|
|
10
|
-
)
|
|
11
|
-
from mxcubecore.TaskUtils import task
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class LNLSCollect(AbstractMultiCollect, HardwareObject):
|
|
15
|
-
def __init__(self, name):
|
|
16
|
-
AbstractMultiCollect.__init__(self)
|
|
17
|
-
HardwareObject.__init__(self, name)
|
|
18
|
-
self._centring_status = None
|
|
19
|
-
self.ready_event = None
|
|
20
|
-
self.actual_frame_num = 0
|
|
21
|
-
|
|
22
|
-
def execute_command(self, command_name, *args, **kwargs):
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
def init(self):
|
|
26
|
-
self.setControlObjects(
|
|
27
|
-
diffractometer=self.get_object_by_role("diffractometer"),
|
|
28
|
-
sample_changer=self.get_object_by_role("sample_changer"),
|
|
29
|
-
lims=self.get_object_by_role("dbserver"),
|
|
30
|
-
safety_shutter=self.get_object_by_role("safety_shutter"),
|
|
31
|
-
machine_current=self.get_object_by_role("machine_current"),
|
|
32
|
-
cryo_stream=self.get_object_by_role("cryo_stream"),
|
|
33
|
-
energy=HWR.beamline.energy,
|
|
34
|
-
resolution=self.get_object_by_role("resolution"),
|
|
35
|
-
detector_distance=self.get_object_by_role("detector_distance"),
|
|
36
|
-
transmission=self.get_object_by_role(
|
|
37
|
-
"transmission"
|
|
38
|
-
), # Returns attenuators.
|
|
39
|
-
undulators=self.get_object_by_role("undulators"),
|
|
40
|
-
flux=self.get_object_by_role("flux"),
|
|
41
|
-
detector=self.get_object_by_role("detector"),
|
|
42
|
-
beam_info=self.get_object_by_role("beam_info"),
|
|
43
|
-
)
|
|
44
|
-
# Adding this line to get transmission value:
|
|
45
|
-
self.filter_transmission = self.get_object_by_role("filter_transmission")
|
|
46
|
-
self.emit("collectConnected", (True,))
|
|
47
|
-
self.emit("collectReady", (True,))
|
|
48
|
-
|
|
49
|
-
@task
|
|
50
|
-
def loop(self, owner, data_collect_parameters_list):
|
|
51
|
-
print("\nCALL LOOP\n")
|
|
52
|
-
print("\nDC PARAM LIST:\n")
|
|
53
|
-
print(
|
|
54
|
-
"data_collect_parameters_list = {}\n".format(data_collect_parameters_list)
|
|
55
|
-
)
|
|
56
|
-
failed_msg = "Data collection failed!"
|
|
57
|
-
failed = True
|
|
58
|
-
collections_analyse_params = []
|
|
59
|
-
self.emit("collectReady", (False,))
|
|
60
|
-
self.emit("collectStarted", (owner, 1))
|
|
61
|
-
|
|
62
|
-
for data_collect_parameters in data_collect_parameters_list:
|
|
63
|
-
print("\nSUB LOOP SINGLE COLLECT?\n")
|
|
64
|
-
print("data_collect_parameters = {}\n".format(data_collect_parameters))
|
|
65
|
-
logging.debug("collect parameters = %r", data_collect_parameters)
|
|
66
|
-
failed = False
|
|
67
|
-
data_collect_parameters["status"] = "Data collection successful"
|
|
68
|
-
(
|
|
69
|
-
osc_id,
|
|
70
|
-
sample_id,
|
|
71
|
-
sample_code,
|
|
72
|
-
sample_location,
|
|
73
|
-
) = self.update_oscillations_history(data_collect_parameters)
|
|
74
|
-
|
|
75
|
-
self.emit(
|
|
76
|
-
"collectOscillationStarted",
|
|
77
|
-
(
|
|
78
|
-
owner,
|
|
79
|
-
sample_id,
|
|
80
|
-
sample_code,
|
|
81
|
-
sample_location,
|
|
82
|
-
data_collect_parameters,
|
|
83
|
-
osc_id,
|
|
84
|
-
),
|
|
85
|
-
)
|
|
86
|
-
|
|
87
|
-
# Translate parameters to scan-utils flyscan
|
|
88
|
-
config_yml = "pilatus"
|
|
89
|
-
message = "Flyscan called from mxcubeweb."
|
|
90
|
-
|
|
91
|
-
output_directory = data_collect_parameters["fileinfo"]["directory"]
|
|
92
|
-
# Create dir
|
|
93
|
-
path = output_directory
|
|
94
|
-
try:
|
|
95
|
-
if os.path.isdir(path):
|
|
96
|
-
self.log.info("Directory exists: %s " % path)
|
|
97
|
-
else:
|
|
98
|
-
os.makedirs(path)
|
|
99
|
-
self.log.info("Successfully created the directory %s " % path)
|
|
100
|
-
except OSError:
|
|
101
|
-
self.log.error("Creation of the directory %s failed." % path)
|
|
102
|
-
|
|
103
|
-
if not output_directory.endswith("/"):
|
|
104
|
-
output_directory = output_directory + "/"
|
|
105
|
-
output_prefix = data_collect_parameters["fileinfo"]["prefix"]
|
|
106
|
-
output_file = output_directory + output_prefix
|
|
107
|
-
|
|
108
|
-
motor_mnenomic = "gonio"
|
|
109
|
-
xlabel = motor_mnenomic
|
|
110
|
-
plot_type = "none"
|
|
111
|
-
mode = "--points-mode"
|
|
112
|
-
|
|
113
|
-
start_float = float(
|
|
114
|
-
data_collect_parameters["oscillation_sequence"][0]["start"]
|
|
115
|
-
) # omega start pos
|
|
116
|
-
start = str(start_float)
|
|
117
|
-
|
|
118
|
-
step_size = float(
|
|
119
|
-
data_collect_parameters["oscillation_sequence"][0]["range"]
|
|
120
|
-
)
|
|
121
|
-
num_of_points = int(
|
|
122
|
-
data_collect_parameters["oscillation_sequence"][0]["number_of_images"]
|
|
123
|
-
)
|
|
124
|
-
end_float = start_float + step_size * num_of_points
|
|
125
|
-
end = str(end_float)
|
|
126
|
-
|
|
127
|
-
step_or_points = str(num_of_points)
|
|
128
|
-
|
|
129
|
-
time_float = float(
|
|
130
|
-
data_collect_parameters["oscillation_sequence"][0]["exposure_time"]
|
|
131
|
-
)
|
|
132
|
-
time = str(time_float)
|
|
133
|
-
|
|
134
|
-
prescan = " "
|
|
135
|
-
postscan = " "
|
|
136
|
-
|
|
137
|
-
# flyscan-only params
|
|
138
|
-
start_offset = str(0)
|
|
139
|
-
end_offset = str(0)
|
|
140
|
-
aquire_period = str(time_float + 0.0023) # + pilatus readout time
|
|
141
|
-
|
|
142
|
-
command = 'flyscan -c {} -m "{}" -o {} -s --motor {} {} --start {} --end {} --step-or-points {} --time {} --prescan={} --postscan={} --start-offset {} --end-offset {} --aquire-period {}'.format(
|
|
143
|
-
config_yml,
|
|
144
|
-
message,
|
|
145
|
-
output_file,
|
|
146
|
-
motor_mnenomic,
|
|
147
|
-
mode,
|
|
148
|
-
start,
|
|
149
|
-
end,
|
|
150
|
-
step_or_points,
|
|
151
|
-
time,
|
|
152
|
-
prescan,
|
|
153
|
-
postscan,
|
|
154
|
-
start_offset,
|
|
155
|
-
end_offset,
|
|
156
|
-
aquire_period,
|
|
157
|
-
)
|
|
158
|
-
|
|
159
|
-
# command = 'scan -c {} -m "{}" -o {} --motor {} --xlabel {} --plot-type {} {} --start {} --end {} --step-or-points {} --time {} --prescan={} --postscan={}'.format(config_yml, message, output_file, motor_mnenomic, xlabel, plot_type, mode, start, end, step_or_points, time, prescan, postscan)
|
|
160
|
-
|
|
161
|
-
self.log.info("[SCAN-UTILS] Command: " + str(command))
|
|
162
|
-
print("\n[SCAN-UTILS] Command: " + str(command) + "\n")
|
|
163
|
-
|
|
164
|
-
# Store values for clean up
|
|
165
|
-
self.log.info("[Clean up] Configuring...")
|
|
166
|
-
omega = HWR.beamline.diffractometer.motor_hwobj_dict.get("phi")
|
|
167
|
-
if omega is None:
|
|
168
|
-
self.log.error("[Clean up] Could not get omega motor.")
|
|
169
|
-
else:
|
|
170
|
-
omega_original_velo = omega.get_velocity()
|
|
171
|
-
self.log.info("[Clean up] Omega velo: {}".format(omega_original_velo))
|
|
172
|
-
self.log.info("[Clean up] Configured.")
|
|
173
|
-
|
|
174
|
-
# Set detector cbf header
|
|
175
|
-
header_ok = self.set_pilatus_det_header(start_float, step_size)
|
|
176
|
-
if not header_ok:
|
|
177
|
-
self.log.error(
|
|
178
|
-
"[Collect] Pilatus header params could not be set! Collection aborted."
|
|
179
|
-
)
|
|
180
|
-
return
|
|
181
|
-
|
|
182
|
-
import subprocess
|
|
183
|
-
|
|
184
|
-
try:
|
|
185
|
-
process = subprocess.Popen(
|
|
186
|
-
command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True
|
|
187
|
-
)
|
|
188
|
-
|
|
189
|
-
self.log.info("[SCAN-UTILS] Executing scan...")
|
|
190
|
-
logging.getLogger("user_level_log").info("Executing scan...")
|
|
191
|
-
stdout, stderr = process.communicate()
|
|
192
|
-
# stdout
|
|
193
|
-
self.log.info("[SCAN-UTILS] output : " + stdout.decode("utf-8"))
|
|
194
|
-
print("[SCAN-UTILS] output : " + stdout.decode("utf-8"))
|
|
195
|
-
# stderr
|
|
196
|
-
self.log.error("[SCAN-UTILS] errors : " + stderr.decode("utf-8"))
|
|
197
|
-
print("[SCAN-UTILS] errors : " + stderr.decode("utf-8"))
|
|
198
|
-
|
|
199
|
-
except BaseException:
|
|
200
|
-
self.log.error("[SCAN-UTILS] Error in calling scan.")
|
|
201
|
-
# print("[SCAN-UTILS] Error in calling scan.")
|
|
202
|
-
raise
|
|
203
|
-
else:
|
|
204
|
-
self.log.info("[SCAN-UTILS] Finished scan!")
|
|
205
|
-
logging.getLogger("user_level_log").info("Finished scan!")
|
|
206
|
-
# print("[SCAN-UTILS] Finished scan!")
|
|
207
|
-
finally:
|
|
208
|
-
# Clean up
|
|
209
|
-
self.log.info("[Clean up] Applying...")
|
|
210
|
-
import time as timee
|
|
211
|
-
|
|
212
|
-
timee.sleep(10)
|
|
213
|
-
if omega is not None:
|
|
214
|
-
# Restore omega default velocity
|
|
215
|
-
omega.set_velocity(omega_original_velo)
|
|
216
|
-
self.log.info(
|
|
217
|
-
"[Clean up] Omega velo reset to: {}".format(omega_original_velo)
|
|
218
|
-
)
|
|
219
|
-
self.log.info("[Clean up] Done!")
|
|
220
|
-
|
|
221
|
-
data_collect_parameters["status"] = "Running"
|
|
222
|
-
data_collect_parameters["status"] = "Data collection successful"
|
|
223
|
-
self.emit(
|
|
224
|
-
"collectOscillationFinished",
|
|
225
|
-
(
|
|
226
|
-
owner,
|
|
227
|
-
True,
|
|
228
|
-
data_collect_parameters["status"],
|
|
229
|
-
"12345",
|
|
230
|
-
osc_id,
|
|
231
|
-
data_collect_parameters,
|
|
232
|
-
),
|
|
233
|
-
)
|
|
234
|
-
|
|
235
|
-
self.emit(
|
|
236
|
-
"collectEnded",
|
|
237
|
-
owner,
|
|
238
|
-
not failed,
|
|
239
|
-
failed_msg if failed else "Data collection successful",
|
|
240
|
-
)
|
|
241
|
-
self.log.info("data collection successful in loop")
|
|
242
|
-
self.emit("collectReady", (True,))
|
|
243
|
-
|
|
244
|
-
def set_pilatus_det_header(self, start_angle, step_size):
|
|
245
|
-
# Read current params
|
|
246
|
-
self.log.info("Setting Pilatus CBF header...")
|
|
247
|
-
wl = self.bl_control.energy.get_wavelength()
|
|
248
|
-
dd = self.bl_control.detector_distance.get_value()
|
|
249
|
-
te = self.bl_control.energy.get_value()
|
|
250
|
-
ft = self.filter_transmission.get_value()
|
|
251
|
-
try:
|
|
252
|
-
ft = ft / 100 # [0, 1]
|
|
253
|
-
except Exception as e:
|
|
254
|
-
print("Error on setting Pilatus transmission: {}".format(str(e)))
|
|
255
|
-
|
|
256
|
-
self.log.exception("")
|
|
257
|
-
return False
|
|
258
|
-
|
|
259
|
-
# Write to det (values will be on the cbf header)
|
|
260
|
-
wl_ok = self.bl_control.detector.set_wavelength(wl)
|
|
261
|
-
dd_ok = self.bl_control.detector.set_detector_distance(dd)
|
|
262
|
-
bx_ok = self.bl_control.detector.set_beam_x(from_user=True)
|
|
263
|
-
by_ok = self.bl_control.detector.set_beam_y(from_user=True)
|
|
264
|
-
te_ok = self.bl_control.detector.set_threshold_energy(te)
|
|
265
|
-
ft_ok = self.bl_control.detector.set_transmission(ft)
|
|
266
|
-
sa_ok = self.bl_control.detector.set_start_angle(start_angle)
|
|
267
|
-
ss_ok = self.bl_control.detector.set_angle_incr(step_size)
|
|
268
|
-
|
|
269
|
-
return (
|
|
270
|
-
wl_ok and dd_ok and bx_ok and by_ok and te_ok and ft_ok and sa_ok and ss_ok
|
|
271
|
-
)
|
|
272
|
-
|
|
273
|
-
@task
|
|
274
|
-
def data_collection_hook(self, data_collect_parameters):
|
|
275
|
-
return
|
|
276
|
-
|
|
277
|
-
def do_prepare_oscillation(self, start, end, exptime, npass):
|
|
278
|
-
self.actual_frame_num = 0
|
|
279
|
-
|
|
280
|
-
@task
|
|
281
|
-
def oscil(self, start, end, exptime, npass):
|
|
282
|
-
return
|
|
283
|
-
|
|
284
|
-
@task
|
|
285
|
-
def data_collection_cleanup(self):
|
|
286
|
-
return
|
|
287
|
-
|
|
288
|
-
@task
|
|
289
|
-
def close_fast_shutter(self):
|
|
290
|
-
return
|
|
291
|
-
|
|
292
|
-
@task
|
|
293
|
-
def open_fast_shutter(self):
|
|
294
|
-
return
|
|
295
|
-
|
|
296
|
-
@task
|
|
297
|
-
def move_motors(self, motor_position_dict):
|
|
298
|
-
return
|
|
299
|
-
|
|
300
|
-
@task
|
|
301
|
-
def open_safety_shutter(self):
|
|
302
|
-
return
|
|
303
|
-
|
|
304
|
-
def safety_shutter_opened(self):
|
|
305
|
-
return
|
|
306
|
-
|
|
307
|
-
@task
|
|
308
|
-
def close_safety_shutter(self):
|
|
309
|
-
return
|
|
310
|
-
|
|
311
|
-
@task
|
|
312
|
-
def prepare_intensity_monitors(self):
|
|
313
|
-
return
|
|
314
|
-
|
|
315
|
-
def prepare_acquisition(
|
|
316
|
-
self, take_dark, start, osc_range, exptime, npass, number_of_images, comment=""
|
|
317
|
-
):
|
|
318
|
-
return
|
|
319
|
-
|
|
320
|
-
def set_detector_filenames(
|
|
321
|
-
self, frame_number, start, filename, jpeg_full_path, jpeg_thumbnail_full_path
|
|
322
|
-
):
|
|
323
|
-
return
|
|
324
|
-
|
|
325
|
-
def prepare_oscillation(
|
|
326
|
-
self, start, osc_range, exptime, number_of_images, shutterless, first_frame
|
|
327
|
-
):
|
|
328
|
-
return (start, start + osc_range)
|
|
329
|
-
|
|
330
|
-
def do_oscillation(
|
|
331
|
-
self, start, end, exptime, number_of_images, shutterless, first_frame
|
|
332
|
-
):
|
|
333
|
-
gevent.sleep(exptime)
|
|
334
|
-
|
|
335
|
-
def start_acquisition(self, exptime, npass, first_frame):
|
|
336
|
-
return
|
|
337
|
-
|
|
338
|
-
def write_image(self, last_frame):
|
|
339
|
-
self.actual_frame_num += 1
|
|
340
|
-
return
|
|
341
|
-
|
|
342
|
-
def last_image_saved(self):
|
|
343
|
-
return self.actual_frame_num
|
|
344
|
-
|
|
345
|
-
def stop_acquisition(self):
|
|
346
|
-
return
|
|
347
|
-
|
|
348
|
-
def reset_detector(self):
|
|
349
|
-
return
|
|
350
|
-
|
|
351
|
-
def prepare_input_files(
|
|
352
|
-
self, files_directory, prefix, run_number, process_directory
|
|
353
|
-
):
|
|
354
|
-
self.actual_frame_num = 0
|
|
355
|
-
i = 1
|
|
356
|
-
while True:
|
|
357
|
-
xds_input_file_dirname = "xds_%s_run%s_%d" % (prefix, run_number, i)
|
|
358
|
-
xds_directory = os.path.join(process_directory, xds_input_file_dirname)
|
|
359
|
-
|
|
360
|
-
if not os.path.exists(xds_directory):
|
|
361
|
-
break
|
|
362
|
-
|
|
363
|
-
i += 1
|
|
364
|
-
|
|
365
|
-
mosflm_input_file_dirname = "mosflm_%s_run%s_%d" % (prefix, run_number, i)
|
|
366
|
-
mosflm_directory = os.path.join(process_directory, mosflm_input_file_dirname)
|
|
367
|
-
|
|
368
|
-
hkl2000_dirname = "hkl2000_%s_run%s_%d" % (prefix, run_number, i)
|
|
369
|
-
hkl2000_directory = os.path.join(process_directory, hkl2000_dirname)
|
|
370
|
-
|
|
371
|
-
self.raw_data_input_file_dir = os.path.join(
|
|
372
|
-
files_directory, "process", xds_input_file_dirname
|
|
373
|
-
)
|
|
374
|
-
self.mosflm_raw_data_input_file_dir = os.path.join(
|
|
375
|
-
files_directory, "process", mosflm_input_file_dirname
|
|
376
|
-
)
|
|
377
|
-
self.raw_hkl2000_dir = os.path.join(files_directory, "process", hkl2000_dirname)
|
|
378
|
-
|
|
379
|
-
return xds_directory, mosflm_directory, hkl2000_directory
|
|
380
|
-
|
|
381
|
-
@task
|
|
382
|
-
def write_input_files(self, collection_id):
|
|
383
|
-
return
|
|
384
|
-
|
|
385
|
-
def get_wavelength(self):
|
|
386
|
-
return
|
|
387
|
-
|
|
388
|
-
def get_undulators_gaps(self):
|
|
389
|
-
return []
|
|
390
|
-
|
|
391
|
-
def get_resolution_at_corner(self):
|
|
392
|
-
return
|
|
393
|
-
|
|
394
|
-
def get_beam_size(self):
|
|
395
|
-
return None, None
|
|
396
|
-
|
|
397
|
-
def get_slit_gaps(self):
|
|
398
|
-
return None, None
|
|
399
|
-
|
|
400
|
-
def get_beam_shape(self):
|
|
401
|
-
return
|
|
402
|
-
|
|
403
|
-
def get_machine_current(self):
|
|
404
|
-
if self.bl_control.machine_current is not None:
|
|
405
|
-
return self.bl_control.machine_current.getCurrent()
|
|
406
|
-
else:
|
|
407
|
-
return 0
|
|
408
|
-
|
|
409
|
-
def get_machine_message(self):
|
|
410
|
-
if self.bl_control.machine_current is not None:
|
|
411
|
-
return self.bl_control.machine_current.getMessage()
|
|
412
|
-
else:
|
|
413
|
-
return ""
|
|
414
|
-
|
|
415
|
-
def get_machine_fill_mode(self):
|
|
416
|
-
if self.bl_control.machine_current is not None:
|
|
417
|
-
return self.bl_control.machine_current.getFillMode()
|
|
418
|
-
else:
|
|
419
|
-
""""""
|
|
420
|
-
|
|
421
|
-
def get_cryo_temperature(self):
|
|
422
|
-
if self.bl_control.cryo_stream is not None:
|
|
423
|
-
return self.bl_control.cryo_stream.getTemperature()
|
|
424
|
-
|
|
425
|
-
def get_current_energy(self):
|
|
426
|
-
return
|
|
427
|
-
|
|
428
|
-
def get_beam_centre(self):
|
|
429
|
-
return None, None
|
|
430
|
-
|
|
431
|
-
def getBeamlineConfiguration(self, *args):
|
|
432
|
-
return self.bl_config._asdict()
|
|
433
|
-
|
|
434
|
-
def isConnected(self):
|
|
435
|
-
return True
|
|
436
|
-
|
|
437
|
-
def is_ready(self):
|
|
438
|
-
return True
|
|
439
|
-
|
|
440
|
-
def sampleChangerHO(self):
|
|
441
|
-
return self.bl_control.sample_changer
|
|
442
|
-
|
|
443
|
-
def diffractometer(self):
|
|
444
|
-
return self.bl_control.diffractometer
|
|
445
|
-
|
|
446
|
-
def sanityCheck(self, collect_params):
|
|
447
|
-
return
|
|
448
|
-
|
|
449
|
-
def setBrick(self, brick):
|
|
450
|
-
return
|
|
451
|
-
|
|
452
|
-
def directoryPrefix(self):
|
|
453
|
-
return self.bl_config.directory_prefix
|
|
454
|
-
|
|
455
|
-
def store_image_in_lims(self, frame, first_frame, last_frame):
|
|
456
|
-
return True
|
|
457
|
-
|
|
458
|
-
def getOscillation(self, oscillation_id):
|
|
459
|
-
return self.oscillations_history[oscillation_id - 1]
|
|
460
|
-
|
|
461
|
-
def sampleAcceptCentring(self, accepted, centring_status):
|
|
462
|
-
self.sample_centring_done(accepted, centring_status)
|
|
463
|
-
|
|
464
|
-
def setCentringStatus(self, centring_status):
|
|
465
|
-
self._centring_status = centring_status
|
|
466
|
-
|
|
467
|
-
def getOscillations(self, session_id):
|
|
468
|
-
return []
|
|
469
|
-
|
|
470
|
-
def set_helical(self, helical_on):
|
|
471
|
-
return
|
|
472
|
-
|
|
473
|
-
def set_helical_pos(self, helical_oscil_pos):
|
|
474
|
-
return
|
|
475
|
-
|
|
476
|
-
def get_archive_directory(self, directory):
|
|
477
|
-
archive_dir = os.path.join(directory, "archive")
|
|
478
|
-
return archive_dir
|
|
479
|
-
|
|
480
|
-
@task
|
|
481
|
-
def generate_image_jpeg(self, filename, jpeg_path, jpeg_thumbnail_path):
|
|
482
|
-
pass
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import logging
|
|
2
|
-
import time
|
|
3
|
-
|
|
4
|
-
from mxcubecore.HardwareObjects.LNLS.LNLSMotor import LNLSMotor
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class LNLSDetDistMotor(LNLSMotor):
|
|
8
|
-
PMAC_SENDCMD = "pmac_sendcmd"
|
|
9
|
-
|
|
10
|
-
def __init__(self, name):
|
|
11
|
-
LNLSMotor.__init__(self, name)
|
|
12
|
-
|
|
13
|
-
def _move(self, value):
|
|
14
|
-
"""Override super class method."""
|
|
15
|
-
if not self.validate_value(value):
|
|
16
|
-
raise ValueError(
|
|
17
|
-
"Invalid value %s; limits are %s" % (value, self.get_limits())
|
|
18
|
-
)
|
|
19
|
-
self.update_specific_state(self.SPECIFIC_STATES.MOVING)
|
|
20
|
-
|
|
21
|
-
for i in range(2):
|
|
22
|
-
logging.getLogger("user_level_log").info("Setting detector distance...")
|
|
23
|
-
|
|
24
|
-
# Enable air
|
|
25
|
-
self.log.info("%s: Enabling air" % self.motor_name)
|
|
26
|
-
command = "#5,7,8j/"
|
|
27
|
-
self.set_channel_value(self.PMAC_SENDCMD, command)
|
|
28
|
-
time.sleep(2)
|
|
29
|
-
|
|
30
|
-
# Wait for stability
|
|
31
|
-
self.log.info("%s: Wait for air stability" % self.motor_name)
|
|
32
|
-
while self.get_channel_value(self.MOTOR_DMOV) == 0:
|
|
33
|
-
time.sleep(0.2)
|
|
34
|
-
current_value = self.get_value()
|
|
35
|
-
self.update_value(current_value)
|
|
36
|
-
|
|
37
|
-
# Move det dist motor
|
|
38
|
-
self.log.info("%s: Set motor to %s" % (self.motor_name, value))
|
|
39
|
-
self.set_channel_value(self.ACTUATOR_VAL, value)
|
|
40
|
-
|
|
41
|
-
# Wait for movement
|
|
42
|
-
self.log.info("%s: Wait for movement to finish" % self.motor_name)
|
|
43
|
-
while (
|
|
44
|
-
self.get_channel_value(self.MOTOR_DMOV) == 0
|
|
45
|
-
or abs(current_value - value) > 0.0005
|
|
46
|
-
):
|
|
47
|
-
time.sleep(0.2)
|
|
48
|
-
current_value = self.get_value()
|
|
49
|
-
self.update_value(current_value)
|
|
50
|
-
|
|
51
|
-
# Disable air
|
|
52
|
-
time.sleep(1)
|
|
53
|
-
self.log.info("%s: Disabling air" % self.motor_name)
|
|
54
|
-
command = "#5,7,8dkill"
|
|
55
|
-
self.set_channel_value(self.PMAC_SENDCMD, command)
|
|
56
|
-
time.sleep(0.5)
|
|
57
|
-
|
|
58
|
-
# Wait for stability
|
|
59
|
-
self.log.info("%s: Wait for air stability again" % self.motor_name)
|
|
60
|
-
while self.get_channel_value(self.MOTOR_DMOV) == 0:
|
|
61
|
-
time.sleep(0.2)
|
|
62
|
-
current_value = self.get_value()
|
|
63
|
-
self.update_value(current_value)
|
|
64
|
-
|
|
65
|
-
# Wait for stability
|
|
66
|
-
self.log.info("%s: Movement done!" % self.motor_name)
|
|
67
|
-
self.update_state(self.STATES.READY)
|
|
68
|
-
for i in range(2):
|
|
69
|
-
logging.getLogger("user_level_log").info("Detector distance is set.")
|
|
70
|
-
return value
|
|
71
|
-
|
|
72
|
-
def _set_value(self, value):
|
|
73
|
-
"""Override method."""
|
|
74
|
-
# As this motor moves in a special way, we delegate its movement
|
|
75
|
-
# sequence to _move.
|
|
76
|
-
pass
|