From 1d236503355138825391774f45a769e25b1d0c84 Mon Sep 17 00:00:00 2001 From: gac-furka Date: Wed, 27 Apr 2022 17:53:28 +0200 Subject: [PATCH] add hardware ranges --- qspace.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/qspace.py b/qspace.py index 0ad6862..75533f1 100644 --- a/qspace.py +++ b/qspace.py @@ -87,6 +87,29 @@ class QSpace3D(Device): for name, value in kwargs.items(): setattr(self.dc.cons, name, value) + def hard_constraints(x): + if x["betain"]<0: + return False + if x["betaout"]<0: + return False + if x["nu"]<0: + return False + if x["nu"]>180: + return False + if x["mu"]<0: + return False + if x["mu"]>90: + return False + if x["chi"]<-30: + return False + if x["chi"]>30: + return False + if x["phi"]<-60: + return False + if x["phi"]>60: + return False + return True + # if I understand the examples/code correctly, then some more method calls are mandatory? # those should probably all get shortcuts...