Mods for July beamtime
This commit is contained in:
15
qspace.py
15
qspace.py
@ -11,6 +11,7 @@ from slic.devices.device import Device
|
||||
from slic.devices.simpledevice import SimpleDevice
|
||||
from slic.utils.printing import printable_table
|
||||
|
||||
from constraints import ExtraConstraint
|
||||
|
||||
INDICES = {
|
||||
"h": 0,
|
||||
@ -87,6 +88,13 @@ class QSpace3D(Device):
|
||||
for name, value in kwargs.items():
|
||||
setattr(self.dc.cons, name, value)
|
||||
|
||||
def get_position(self, *args, extra_cons=None):
|
||||
wl = self.wavelength.get_current_value()
|
||||
res = self.dc.hkl.get_position(*args, wl)
|
||||
if extra_cons:
|
||||
res = [r for r in res if extra_cons(_flatten_get_position_result(r))]
|
||||
return res
|
||||
|
||||
def hard_constraints(x):
|
||||
if x["betain"]<0:
|
||||
return False
|
||||
@ -115,6 +123,13 @@ class QSpace3D(Device):
|
||||
|
||||
|
||||
|
||||
def _flatten_get_position_result(x):
|
||||
d0, d1 = x
|
||||
d0 = d0.asdict
|
||||
return dict(**d0, **d1)
|
||||
|
||||
|
||||
|
||||
class QSpace1D(Adjustable):
|
||||
|
||||
def __init__(self, ID, index, dc, motors, wavelength):
|
||||
|
Reference in New Issue
Block a user