Commit 2f43554b authored by Patrick Godwin's avatar Patrick Godwin
Browse files

cbc_template_fir.condition_psd(): fix off-by-one issue causing 'divide by zero...

cbc_template_fir.condition_psd(): fix off-by-one issue causing 'divide by zero encountered in true_divide' warnings, switch to numpy.inf
parent dc0ec84e
......@@ -389,12 +389,12 @@ def condition_psd(psd, newdeltaF, minfs = (35.0, 40.0), maxfs = (1800., 2048.),
psddata = psd.data.data
kmin = int(minfs[0] / newdeltaF)
kmax = int(minfs[1] / newdeltaF)
psddata[:kmin] = float('Inf')
psddata[:kmin+1] = numpy.inf
psddata[kmin:kmax] /= numpy.sin(numpy.arange(kmax-kmin) / (kmax-kmin-1.) * numpy.pi / 2.0)**4
kmin = int(maxfs[0] / newdeltaF)
kmax = int(maxfs[1] / newdeltaF)
psddata[kmax:] = float('Inf')
psddata[kmax:] = numpy.inf
psddata[kmin:kmax] /= numpy.cos(numpy.arange(kmax-kmin) / (kmax-kmin-1.) * numpy.pi / 2.0)**4
psd.data.data = psddata
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment