def __init__(self, fitter, color=None, cal=None): self.regionMarkers = MarkerCollection("X", paired=True, maxnum=1, color=hdtv.color.region, cal=cal) self.peakMarkers = MarkerCollection("X", paired=False, maxnum=None, color=hdtv.color.peak, cal=cal) self.bgMarkers = MarkerCollection("X", paired=True, maxnum=None, color=hdtv.color.bg, cal=cal) self.fitter = fitter self.peaks = [] self.residuals = None self.chi = None self.bgChi = None self.bgParams = [] self._showDecomp = Fit.showDecomp self._showResiduals = Fit.showResiduals self.dispPeakFunc = None self.dispBgFunc = None Drawable.__init__(self, color, cal) self._spec = None self.active = False self.integral = None
def __setattr__(self, name, value): if name == "cal": value = hdtv.cal.MakeCalibration(value) if hasattr(self, "axis"): self.regionMarkers.__setattr__(name, value) self.bgMarkers.__setattr__(name, value) Drawable.__setattr__(self, name, value)
def __init__(self, hist, color=hdtv.color.default, cal=None): Drawable.__init__(self, color, cal) self._hist = hist self._norm = 1.0 self._ID = None self.effCal = None self.typeStr = "spectrum"
def __init__(self, hist, color=hdtv.color.default, cal=None): Drawable.__init__(self, color, cal) self._norm = 1.0 self._ID = None self.effCal = None self.typeStr = "spectrum" self.cal = cal self.SetHistWithPrimitiveBinning(hist)
def __init__(self, color=None, cal=None): self.regionMarkers = hdtv.marker.MarkerCollection( "X", paired=True, maxnum=1, color=hdtv.color.cut) self.bgMarkers = hdtv.marker.MarkerCollection( "X", paired=True, color=hdtv.color.cut, connecttop=False) Drawable.__init__(self, color, cal) self.spec = None self.axis = None # <- keep this last (needed for __setattr__)
def _set_cal(self, cal): self.p1.cal = cal if self.p2 is not None: self.p2.cal = cal Drawable._set_cal(self, cal) if self.displayObj: # call Refresh to carry the possible change # of p1.pos_uncal und p2.pos_uncal to the displayObj self.Refresh()
def __init__(self, xytype, p1, color=hdtv.color.zoom, cal=None, connecttop=False): self._activeColor = color self._cal = cal self._dashed = False self.fixedInCal = True self.xytype = xytype self.connecttop = connecttop self.p1 = p1 self.p2 = None Drawable.__init__(self, color=color, cal=cal)