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...