Commit 6a8be954 authored by Thomas Vincent's avatar Thomas Vincent

update FitView to recent changes

parent 7734c79f
......@@ -36,8 +36,6 @@ import numpy as np
from silx.gui import qt as Qt
from ...io.FitH5 import FitH5QAxis
from ..widgets.Containers import GroupBox
from ..widgets.XsocsPlot2D import XsocsPlot2D
from ..model.TreeView import TreeView
......@@ -87,6 +85,8 @@ class FitView(Qt.QMainWindow):
with self.__fitH5:
# only one entry per file supposed right now
self.__entry = self.__fitH5.entries()[0]
self.__axis_names = self.__fitH5.get_qspace_dimension_names(
self.__entry)
treeDock = Qt.QDockWidget()
......@@ -117,7 +117,7 @@ class FitView(Qt.QMainWindow):
grpBox = GroupBox('Maps')
grpLayout = Qt.QVBoxLayout(grpBox)
for axis in FitH5QAxis.axis_names:
for _ in self.__axis_names:
plot = DropPlotWidget(grid=False,
curveStyle=False,
colormap=False,
......@@ -136,7 +136,7 @@ class FitView(Qt.QMainWindow):
grpBox = GroupBox('Fit')
grpLayout = Qt.QVBoxLayout(grpBox)
for axis in FitH5QAxis.axis_names:
for axis in self.__axis_names:
plot = XsocsPlot2D()
plot.setKeepDataAspectRatio(False)
grpLayout.addWidget(plot)
......@@ -244,9 +244,7 @@ class FitView(Qt.QMainWindow):
with self.__fitH5:
backgroundMode = self.__fitH5.get_background_mode(entry)
xFitQX = self.__fitH5.get_qx(entry)
xFitQY = self.__fitH5.get_qy(entry)
xFitQZ = self.__fitH5.get_qz(entry)
xFitQX, xFitQY, xFitQZ = self.__fitH5.get_qspace_dimension_values(entry)
qxPeakParams = OrderedDict()
qyPeakParams = OrderedDict()
......@@ -271,9 +269,7 @@ class FitView(Qt.QMainWindow):
with self.__qspaceH5:
cube = self.__qspaceH5.qspace_slice(xIdx)
histo = self.__qspaceH5.histo
xAcqQX = self.__qspaceH5.qx
xAcqQY = self.__qspaceH5.qy
xAcqQZ = self.__qspaceH5.qz
xAcqQX, xAcqQY, xAcqQZ = self.__qspaceH5.qspace_dimension_values
yAcqQX, yAcqQY, yAcqQZ = project(cube, histo)
......@@ -290,7 +286,7 @@ class FitView(Qt.QMainWindow):
# Update plot with gathered information
for plot, name, xAcq, yAcq, xFit, peakParams in zip(
self.__fitPlots,
FitH5QAxis.axis_names,
self.__axis_names,
(xAcqQX, xAcqQY, xAcqQZ),
(yAcqQX, yAcqQY, yAcqQZ),
(xFitQX, xFitQY, xFitQZ),
......@@ -330,11 +326,11 @@ def _initGaussian(plots, fitH5Name, entry, process):
# of any other way right now.
qApp = Qt.QApplication.instance()
for iax, axis in enumerate(FitH5QAxis.axis_values):
for index in range(3):
qApp.processEvents()
plots[iax].plotFitResult(
fitH5Name, entry, process, 'Center', axis)
plots[index].plotFitResult(
fitH5Name, entry, process, 'Center', index)
def _initCentroid(plots, fitH5Name, entry, process):
......@@ -349,7 +345,7 @@ def _initCentroid(plots, fitH5Name, entry, process):
# of any other way right now.
qApp = Qt.QApplication.instance()
for iax, axis in enumerate(FitH5QAxis.axis_values):
for index in range(3):
qApp.processEvents()
plots[iax].plotFitResult(
fitH5Name, entry, process, 'COM', axis)
plots[index].plotFitResult(
fitH5Name, entry, process, 'COM', index)
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