Commit 39bed653 authored by Chad Hanna's avatar Chad Hanna
Browse files

inspiral_extrinsics.py, inspiral_lr.py: snr / chisq numerator tuning

parent 6d59542f
Pipeline #75475 passed with stages
in 24 minutes and 12 seconds
...@@ -943,13 +943,15 @@ class NumeratorSNRCHIPDF(rate.BinnedLnPDF): ...@@ -943,13 +943,15 @@ class NumeratorSNRCHIPDF(rate.BinnedLnPDF):
rcoss, drcoss = lnpdf.bins[1].centres()[rcossindices], lnpdf.bins[1].upper()[rcossindices] - lnpdf.bins[1].lower()[rcossindices] rcoss, drcoss = lnpdf.bins[1].centres()[rcossindices], lnpdf.bins[1].upper()[rcossindices] - lnpdf.bins[1].lower()[rcossindices]
snr2 = snr**2. snr2 = snr**2.
snrchi2 = numpy.outer(snr2, rcoss) * df ncparam_per_pf = snr2
# takes into account the mean depending on noncentrality parameter
snrchi2 = numpy.outer(snr2 * df * (1.0 + numpy.mean(pfs)), rcoss)
arr = numpy.zeros_like(lnpdf.array) arr = numpy.zeros_like(lnpdf.array)
for pf in pfs: for pf in pfs:
if progressbar is not None: if progressbar is not None:
progressbar.increment() progressbar.increment()
arr[snrindices, rcossindices] += gstlalstats.ncx2pdf(snrchi2, df, numpy.array([pf * snr2]).T) arr[snrindices, rcossindices] += gstlalstats.ncx2pdf(snrchi2, df, numpy.array([pf * ncparam_per_pf]).T)
# convert to counts by multiplying by bin volume, and also # convert to counts by multiplying by bin volume, and also
# multiply by an SNR powr law # multiply by an SNR powr law
......
...@@ -423,7 +423,7 @@ class LnSignalDensity(LnLRDensity): ...@@ -423,7 +423,7 @@ class LnSignalDensity(LnLRDensity):
vtdict = self.horizon_history.functional_integral_dict(window.shift(float(gps)), lambda D: D**3.) vtdict = self.horizon_history.functional_integral_dict(window.shift(float(gps)), lambda D: D**3.)
return dict((instrument, (vt / t)**(1./3.)) for instrument, vt in vtdict.items()) return dict((instrument, (vt / t)**(1./3.)) for instrument, vt in vtdict.items())
def add_signal_model(self, prefactors_range = (0.001, 0.30), df = 200, inv_snr_pow = 4.): def add_signal_model(self, prefactors_range = (0.001, 0.30), df = 150, inv_snr_pow = 4.):
# normalize to 10 *mi*llion signals. this count makes the # normalize to 10 *mi*llion signals. this count makes the
# density estimation code choose a suitable kernel size # density estimation code choose a suitable kernel size
inspiral_extrinsics.NumeratorSNRCHIPDF.add_signal_model(self.densities["snr_chi"], 1e12, prefactors_range, df, inv_snr_pow = inv_snr_pow, snr_min = self.snr_min) inspiral_extrinsics.NumeratorSNRCHIPDF.add_signal_model(self.densities["snr_chi"], 1e12, prefactors_range, df, inv_snr_pow = inv_snr_pow, snr_min = self.snr_min)
......
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