disable axes not used in flyscan
This commit is contained in:
@@ -64,6 +64,7 @@ class HklFlyScan(AsyncFlyScanBase):
|
||||
self.positions.append(position[:-2])
|
||||
|
||||
def scan_core(self):
|
||||
all_motors = self.device_manager.devices[self.controller].axes.get()
|
||||
scan_motors = self.device_manager.devices[self.diffract].real_axes.get()
|
||||
hkls = numpy.linspace(self.start, self.stop, self.points).tolist()
|
||||
positions = yield from self.stubs.send_rpc_and_wait(self.diffract, 'angles_from_hkls', hkls)
|
||||
@@ -80,11 +81,15 @@ class HklFlyScan(AsyncFlyScanBase):
|
||||
yield from self.stubs.send_rpc_and_wait(self.controller, 'time_mode.put', 1)
|
||||
yield from self.stubs.send_rpc_and_wait(self.controller, 'times.put', [total_time, total_time])
|
||||
|
||||
for index, axis_name in enumerate(scan_motors):
|
||||
yield from self.stubs.send_rpc_and_wait(self.controller,
|
||||
f'{axis_name}.positions.put',
|
||||
(positions[0, index], positions[-1, index]))
|
||||
yield from self.stubs.send_rpc_and_wait(self.controller, f'{axis_name}.use_axis.put', 1)
|
||||
for axis_name in all_motors:
|
||||
if axis_name not in scan_motors:
|
||||
yield from self.stubs.send_rpc_and_wait(self.controller, f'{axis_name}.use_axis.put', 0)
|
||||
else:
|
||||
index = scan_motors.index(axis_name)
|
||||
yield from self.stubs.send_rpc_and_wait(self.controller,
|
||||
f'{axis_name}.positions.put',
|
||||
(positions[0, index], positions[-1, index]))
|
||||
yield from self.stubs.send_rpc_and_wait(self.controller, f'{axis_name}.use_axis.put', 1)
|
||||
|
||||
else:
|
||||
yield from self.stubs.send_rpc_and_wait(self.controller, 'num_points.put', num_points)
|
||||
@@ -94,11 +99,15 @@ class HklFlyScan(AsyncFlyScanBase):
|
||||
yield from self.stubs.send_rpc_and_wait(self.controller, 'time_mode.put', 0)
|
||||
yield from self.stubs.send_rpc_and_wait(self.controller, 'fixed_time.put', self.exp_time)
|
||||
|
||||
for index, axis_name in enumerate(scan_motors):
|
||||
yield from self.stubs.send_rpc_and_wait(self.controller,
|
||||
f'{axis_name}.positions.put',
|
||||
positions[:, index])
|
||||
yield from self.stubs.send_rpc_and_wait(self.controller, f'{axis_name}.use_axis.put', 1)
|
||||
for axis_name in all_motors:
|
||||
if axis_name not in scan_motors:
|
||||
yield from self.stubs.send_rpc_and_wait(self.controller, f'{axis_name}.use_axis.put', 0)
|
||||
else:
|
||||
index = scan_motors.index(axis_name)
|
||||
yield from self.stubs.send_rpc_and_wait(self.controller,
|
||||
f'{axis_name}.positions.put',
|
||||
(positions[0, index], positions[-1, index]))
|
||||
yield from self.stubs.send_rpc_and_wait(self.controller, f'{axis_name}.use_axis.put', 1)
|
||||
|
||||
yield from self.stubs.send_rpc_and_wait(self.controller, 'build_profile')
|
||||
build_status = yield from self.stubs.send_rpc_and_wait(self.controller, 'build_status.get')
|
||||
|
||||
Reference in New Issue
Block a user