summaryrefslogtreecommitdiff
path: root/PyMca5/PyMcaMath/SimpleMath.py
diff options
context:
space:
mode:
authorPicca Frédéric-Emmanuel <picca@debian.org>2018-09-20 09:58:07 +0200
committerPicca Frédéric-Emmanuel <picca@debian.org>2018-09-20 09:58:07 +0200
commit184bbc8e7e31657479978aff481f9d96d344e376 (patch)
treecd7182afcc53e0cd730ecdd13f579b4abc29bdd8 /PyMca5/PyMcaMath/SimpleMath.py
parent0c737c7331790e9825a69d65b26d08075aded68a (diff)
New upstream version 5.4.0+dfsg
Diffstat (limited to 'PyMca5/PyMcaMath/SimpleMath.py')
-rw-r--r--PyMca5/PyMcaMath/SimpleMath.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/PyMca5/PyMcaMath/SimpleMath.py b/PyMca5/PyMcaMath/SimpleMath.py
index 880c56b..e2dde53 100644
--- a/PyMca5/PyMcaMath/SimpleMath.py
+++ b/PyMca5/PyMcaMath/SimpleMath.py
@@ -31,8 +31,13 @@ __contact__ = "sole@esrf.fr"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
import numpy
+import logging
from . import SGModule
+
+_logger = logging.getLogger(__name__)
+
+
class SimpleMath(object):
def derivate(self,xdata,ydata, xlimits=None):
x=numpy.array(xdata, copy=False, dtype=numpy.float)
@@ -87,9 +92,8 @@ class SimpleMath(object):
"""
if (len(xarr) != len(yarr)) or\
(len(xarr) == 0) or (len(yarr) == 0):
- if DEBUG:
- print('specAverage -- invalid input!')
- print('Array lengths do not match or are 0')
+ _logger.debug('specAverage -- invalid input!\n'
+ 'Array lengths do not match or are 0')
return None, None
same = True
@@ -139,9 +143,8 @@ class SimpleMath(object):
if xmax < xmax0:
xmax0 = xmax
if xmax <= xmin:
- if DEBUG:
- print('specAverage -- ')
- print('No overlap between spectra!')
+ _logger.debug('specAverage -- \n'
+ 'No overlap between spectra!')
return numpy.array([]), numpy.array([])
# make sure x0 is sorted