Commit 30bfd3d5 authored by Chris Pankow's avatar Chris Pankow

rapidpe: track rate API changes

Original: 2b043e1748eb2297c3b87fc3db92ddb27d3d9c20
parent f6af7b40
......@@ -523,7 +523,7 @@ class MCSampler(object):
for pt, w in zip(points, weights):
self._hist[p][pt,] += w
self._hist[p].array += self._hist[p].array.mean()
rate.to_moving_mean_density(self._hist[p], rate.tophat_window(3))
rate.filter_array(self._hist[p].array, rate.tophat_window(3))
norm = numpy.sum(self._hist[p].array * self._hist[p].bins.volumes())
self._hist[p].array /= norm
# FIXME: Stupid pet trick while numpy version is lacking
......@@ -16,7 +16,7 @@
import math
import numpy
from pylal.rate import BinnedArray, NDBins, IrregularBins, LinearBins
from lal.rate import BinnedDensity, NDBins, IrregularBins, LinearBins
__author__ = "Chris Pankow <>"
......@@ -75,7 +75,7 @@ def neff_frac(weights, ntotal):
def get_adaptive_binning(samples, edges, nbins=100, bintype='linear'):
if bintype == "linear":
return BinnedArray(NDBins((LinearBins(edges[0], edges[-1], nbins),)))
return BinnedDensity(NDBins((LinearBins(edges[0], edges[-1], nbins),)))
ordering = numpy.argsort(samples)
stride = len(samples) / nbins
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