diff options
Diffstat (limited to 'PyMca5/PyMcaPlugins/ROIStackPlugin.py')
-rw-r--r-- | PyMca5/PyMcaPlugins/ROIStackPlugin.py | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/PyMca5/PyMcaPlugins/ROIStackPlugin.py b/PyMca5/PyMcaPlugins/ROIStackPlugin.py index 0a73164..4b42fb7 100644 --- a/PyMca5/PyMcaPlugins/ROIStackPlugin.py +++ b/PyMca5/PyMcaPlugins/ROIStackPlugin.py @@ -1,5 +1,5 @@ #/*########################################################################## -# Copyright (C) 2004-2014 V.A. Sole, European Synchrotron Radiation Facility +# Copyright (C) 2004-2018 V.A. Sole, European Synchrotron Radiation Facility # # This file is part of the PyMca X-ray Fluorescence Toolkit developed at # the ESRF by the Software group. @@ -26,13 +26,16 @@ """ This plugin opens a stack ROI window providing alternative views: - - ICR Energy at Max. - - ICR Energy at Min. - - 3 energy slices - - ICR Background + - Usual sum of counts in the region + - Channel/Energy at data Max in the region. + - Channel/Energy at data Min in the region. + - Map of the counts at the first channel of the region + - Map of the counts at the middle cahnnel of the region + - Map of the counts at the last channel of the region + - Background counts This window also provides a median filter tool, with a configurable filter -width, to smooth the stack image. +width, to get rid of outlier pixel. The mask of this plot widget is synchronized with the master stack widget. @@ -42,15 +45,18 @@ __contact__ = "sole@esrf.fr" __license__ = "MIT" __copyright__ = "European Synchrotron Radiation Facility, Grenoble, France" +import logging from PyMca5 import StackPluginBase from PyMca5.PyMcaGui.pymca import StackROIWindow from PyMca5.PyMcaGui import PyMca_Icons as PyMca_Icons -DEBUG = 0 +_logger = logging.getLogger(__name__) + class ROIStackPlugin(StackPluginBase.StackPluginBase): def __init__(self, stackWindow, **kw): - StackPluginBase.DEBUG = DEBUG + if _logger.getEffectiveLevel() == logging.DEBUG: + StackPluginBase.pluginBaseLogger.setLevel(logging.DEBUG) StackPluginBase.StackPluginBase.__init__(self, stackWindow, **kw) self.methodDict = {'Show':[self._showWidget, "Show ROIs", @@ -59,8 +65,7 @@ class ROIStackPlugin(StackPluginBase.StackPluginBase): self.roiWindow = None def stackUpdated(self): - if DEBUG: - print("ROIStackPlugin.stackUpdated() called") + _logger.debug("ROIStackPlugin.stackUpdated() called") if self.roiWindow is None: return if self.roiWindow.isHidden(): @@ -86,8 +91,7 @@ class ROIStackPlugin(StackPluginBase.StackPluginBase): self.stackUpdated() def mySlot(self, ddict): - if DEBUG: - print("mySlot ", ddict['event'], ddict.keys()) + _logger.debug("mySlot %s %s", ddict['event'], ddict.keys()) if ddict['event'] == "selectionMaskChanged": self.setStackSelectionMask(ddict['current']) elif ddict['event'] == "addImageClicked": |