icecube / FIRESONG

FIRst Extragalactic Simulation Of Neutrino and Gamma-ray
Other
18 stars 8 forks source link

InverseCDF Evaluates at redshift bin centers #19

Closed mjlarson closed 3 years ago

mjlarson commented 3 years ago

The current InverseCDF function looks like this:

        cdf = np.cumsum(pdf)/np.sum(pdf)
        mask = np.diff(cdf) > 0
        self.invCDF = UnivariateSpline(cdf[1:][mask], x[1:][mask] + (x[1]-x[0])/2., k=1, s=0)

Here, cdf is the value of the redshift evolution PDF evaluated at a redshift of x. The code, however, interprets cdf as the evolution PDF evaluated at the midpoint between given redshifts. For the default binning of 10000, this is likely to be a very small difference, but it can be a noticeable source of error if the binning is reduced. Since FIRESONG isn't doing anything binned at the moment, we should fix these lines.