Skip to content

Commit

Permalink
Merge pull request #1968 from kif/1967_tuple_unit_calib2
Browse files Browse the repository at this point in the history
Handle properly units after 2D integration
  • Loading branch information
vallsv authored Oct 5, 2023
2 parents d67df16 + 291300e commit e96d2f1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pyFAI/gui/tasks/IntegrationTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

__authors__ = ["V. Valls", "J. Kieffer"]
__license__ = "MIT"
__date__ = "05/09/2023"
__date__ = "05/10/2023"

import logging
import numpy
Expand Down Expand Up @@ -839,7 +839,12 @@ def compute_location(result):
scale=(scaleX, scaleY),
colormap=colormap,
resetzoom=False)
self.__plot2d.setGraphXLabel(result2d.unit.label)
unit = result2d.unit
if isinstance(unit, (tuple, list)) and len(unit) == 2:
self.__plot2d.setGraphXLabel(unit[0].label)
self.__plot2d.setGraphYLabel(unit[1].label)
else:
self.__plot2d.setGraphXLabel(unit.label)

self.__radialUnit = integrationProcess.radialUnit()
self.__wavelength = integrationProcess.wavelength()
Expand Down

0 comments on commit e96d2f1

Please sign in to comment.