Skip to content

Commit 7a9622c

Browse files
author
Edgar
committed
display integrate2d fiber results
1 parent 6c06505 commit 7a9622c

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/pyFAI/gui/IntegrationDialog.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,33 @@ def computeLocation(result):
152152
scale=scale,
153153
colormap=DEFAULT_COLORMAP,
154154
resetzoom=False)
155+
elif isinstance(result, containers.Integrate2dFiberResult):
156+
157+
def computeLocation(result):
158+
# Assume that axes are linear
159+
if result.intensity.shape[1] > 1:
160+
scaleX = (result.inplane[-1] - result.inplane[0]) / (result.intensity.shape[1] - 1)
161+
else:
162+
scaleX = 1.0
163+
if result.intensity.shape[0] > 1:
164+
scaleY = (result.outofplane[-1] - result.outofplane[0]) / (result.intensity.shape[0] - 1)
165+
else:
166+
scaleY = 1.0
167+
halfPixel = 0.5 * scaleX, 0.5 * scaleY
168+
origin = (result.inplane[0] - halfPixel[0], result.outofplane[0] - halfPixel[1])
169+
return origin, (scaleX, scaleY)
170+
171+
self._plot.setGraphXLabel("In-plane")
172+
self._plot.setGraphYLabel("Out-of-plane")
173+
origin, scale = computeLocation(result)
174+
self._plot.addImage(
175+
legend="result2d",
176+
data=result.intensity,
177+
origin=origin,
178+
scale=scale,
179+
colormap=DEFAULT_COLORMAP,
180+
resetzoom=False)
181+
155182
else:
156183
logger.error("Unsupported result type %s", type(result))
157184
if resetZoom:

0 commit comments

Comments
 (0)