Commit 1e6d213f authored by Julia Garriga Ferrer's avatar Julia Garriga Ferrer
Browse files

[gui][rsm] Change axes to 2teta and eta

parent b5ed5d08
......@@ -26,12 +26,16 @@
__authors__ = ["J. Garriga"]
__license__ = "MIT"
__date__ = "28/05/2021"
__date__ = "31/05/2021"
import numpy
from silx.gui import qt
from silx.gui.plot import Plot2D
from .operationThread import OperationThread
from darfix.core.dimension import POSITIONER_METADATA
class RSMWidget(qt.QMainWindow):
......@@ -75,7 +79,17 @@ class RSMWidget(qt.QMainWindow):
self._thread.finished.disconnect(self._updateData)
if self._thread.data is not None:
self._moments = self._thread.data
self._plotWidget.addImage(self._moments[0][0])
ffz = self.dataset.get_metadata_values(POSITIONER_METADATA, "ffz")
mainx = self.dataset.get_metadata_values(POSITIONER_METADATA, "mainx")
d = 0.051
s, h, w = self.dataset.get_data().shape
X = numpy.arange(-int(h / 2), int(h / 2), dtype=numpy.float64) * d
Y = numpy.arange(-(w / 2), w / 2, dtype=numpy.float64) * d
teta = numpy.arctan2(ffz + X, mainx)
az = numpy.arctan2(Y, mainx)
xscale = (teta[-1] - teta[0]) / h
yscale = (az[-1] - az[0]) / w
self._plotWidget.addImage(self._moments[0][0], origin=(az[0], teta[0]), scale=(yscale, xscale))
else:
print("\nComputation aborted")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment