Normed[Index] = roll(Normed[Index], (Shift + DataShift - argmax(Normed[Index]))) #Normed[Index] = Smooth(Normed[Index],100, 101) Normed[Index] = Normed[Index] / sum(Normed[Index]) Nonzero = AlignedRawNonzero[ Index] # Note this is using the AlignedRaw nonzeros due to normalization messing with the zeros NonzeroLength = len(Nonzero) Normed[Index][arange(len(Nonzero))] = Normed[Index][Nonzero] Normed[Index][NonzeroLength:] = 0.0 #print FitExp(Time, Normed[Index], GateIndex=argmax(Time > 0.1), LastIndex=argmax(Time > 9.0)) Normed = Normed.AddCol() Sum = "Channel_{Sum}" Normed.ChangeColName(Normed.keys()[-1], Sum) Normed[Sum] = (Normed['Channel_1'] + Normed['Channel_2'] ) / sum(Normed['Channel_1'] + Normed['Channel_2']) """ NormedResults = FitExp(Time, Normed[Sum], GateIndex=argmax(Time > 0.1), LastIndex=argmax(Time > 9.0), Print = True) from numpy import inf AvgIRF = (IRF['Channel_1']+IRF['Channel_2'])/2.0 def FitNormed(Time, Amp, LifeTime, Offset, ScatterAmp, Start=0, End=len(AvgIRF)): if LifeTime == 0.0: return inf IRF = AvgIRF[Start:End]
Convolved0 = RawConvolveFFT(Decay, AlignedIRF0, None) GConvolved = RawConvolveFFT(Decay, GIRF, None) TimeOffset = 0.0 IRFI = InterpolatedUnivariateSpline(LongTime, AlignedIRF) IRFIV = IRFI(LongTime - TimeOffset) IRFIV = IRFIV / sum(IRFIV) IRFIVConv = RawConvolveFFT(Decay, IRFIV, None) Plotting = ChannelizedArray(len(LongTime), 1, 'float64') Plotting.ChangeColName("Channel_1", "Convolved") Plotting['Convolved'] = roll(Convolved / max(Convolved), 4095) Plotting = Plotting.AddCol('Gauss') Plotting['Gauss'] = GIRF / max(GIRF) Plotting = Plotting.AddCol('GConv') Plotting['GConv'] = roll(GConvolved / max(GConvolved), 4095) #Plotting = Plotting.AddCol('Scatter') #Plotting['Scatter'] = AlignedIRF/max(AlignedIRF) Plotting = Plotting.AddCol('IRFIV') Plotting['IRFIV'] = IRFIV / max(IRFIV) Plotting = Plotting.AddCol('IRFIV Conv') Plotting['IRFIV Conv'] = roll(IRFIVConv / max(IRFIVConv), 4095) Plotting = Plotting.AddCol('IRF0')