Bugfix in plotcomparison: pdf was provided as method instead of data. Enabled plot_pdf to deal with method as well as with pdf-data.

This commit is contained in:
Ludger Küperkoch 2017-02-22 12:31:20 +01:00
parent 5d35fb419d
commit fab785d164

View File

@ -10,7 +10,6 @@ import copy
import datetime import datetime
import numpy as np import numpy as np
from PyQt4.QtCore import pyqtRemoveInputHook
from matplotlib.figure import Figure from matplotlib.figure import Figure
from pylot.core.util.utils import find_horizontals from pylot.core.util.utils import find_horizontals
@ -51,7 +50,12 @@ def getDataType(parent):
def plot_pdf(_axes, x, y, annotation, bbox_props, xlabel=None, ylabel=None, def plot_pdf(_axes, x, y, annotation, bbox_props, xlabel=None, ylabel=None,
title=None): title=None):
_axes.plot(x, y()) # try method or data
try:
_axes.plot(x, y()) # y provided as method
except:
_axes.plot(x, y) # y provided as data
if title: if title:
_axes.set_title(title) _axes.set_title(title)
if xlabel: if xlabel:
@ -248,12 +252,13 @@ class ComparisonDialog(QDialog):
pdf_a = copy.deepcopy(self.data.get('auto')[station][phase]) pdf_a = copy.deepcopy(self.data.get('auto')[station][phase])
pdf_m = copy.deepcopy(self.data.get('manu')[station][phase]) pdf_m = copy.deepcopy(self.data.get('manu')[station][phase])
xauto, yauto, stdauto, expauto, alim = pdf_a.axis, pdf_a.data, \ xauto, yauto, stdauto, expauto, alim = pdf_a.axis, pdf_a.data(), \
pdf_a.standard_deviation(), \ pdf_a.standard_deviation(), \
pdf_a.expectation(), \ pdf_a.expectation(), \
pdf_a.limits() pdf_a.limits()
xmanu, ymanu, stdmanu, expmanu, mlim = pdf_m.axis, pdf_m.data, \ xmanu, ymanu, stdmanu, expmanu, mlim = pdf_m.axis, pdf_m.data(), \
pdf_m.standard_deviation(), \ pdf_m.standard_deviation(), \
pdf_m.expectation(), \ pdf_m.expectation(), \
pdf_m.limits() pdf_m.limits()