diff options
author | com-sixs <com-sixs@synchrotron-soleil.fr> | 2018-01-16 16:19:06 +0100 |
---|---|---|
committer | com-sixs <com-sixs@synchrotron-soleil.fr> | 2018-01-16 16:19:31 +0100 |
commit | a8ad9e89ccb16bcc5b6bf10a49fdd5ea5426cd26 (patch) | |
tree | b1dfe47af6e1141e50682efd173f8e1fbc12a572 | |
parent | 12006288c5c7b253d48b1b87c729f5bf890b1f6a (diff) |
[sixs] add an omega_offset and mu_offset for the qxqyqz projection
-rw-r--r-- | binoculars/backends/sixs.py | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/binoculars/backends/sixs.py b/binoculars/backends/sixs.py index 9132bdf..6cdfaad 100644 --- a/binoculars/backends/sixs.py +++ b/binoculars/backends/sixs.py @@ -92,7 +92,6 @@ class HKLProjection(backend.ProjectionBase): def get_axis_labels(self): return 'H', 'K', 'L' - class HKProjection(HKLProjection): def project(self, index, pdataframe): h, k, l = super(HKProjection, self).project(index, pdataframe) @@ -114,6 +113,14 @@ class QxQyQzProjection(backend.ProjectionBase): [0, 0, 1], [0,-1, 0]]) + if self.config.mu_offset is not None: + UB = numpy.dot(UB, + M(self.config.mu_offset, [0, 1, 0])) + + if self.config.omega_offset is not None: + UB = numpy.dot(UB, + M(self.config.omega_offset, [0, 0, -1])) + # UB = numpy.array([[1, 0, 0], # [0, 1, 0], # [0, 0, 1]]) @@ -133,6 +140,22 @@ class QxQyQzProjection(backend.ProjectionBase): def get_axis_labels(self): return "Qx", "Qy", "Qz" + def parse_config(self, config): + super(QxQyQzProjection, self).parse_config(config) + + # omega offset for the sample in degree then convert into radian + omega_offset = config.pop('omega_offset', None) + if omega_offset is not None: + self.config.omega_offset = math.radians(float(omega_offset)) + else: + self.config.omega_offset = None + + # omega offset for the sample in degree then convert into radian + mu_offset = config.pop('mu_offset', None) + if mu_offset is not None: + self.config.mu_offset = math.radians(float(mu_offset)) + else: + self.config.mu_offset = None class QparQperProjection(QxQyQzProjection): def project(self, index, pdataframe): |