Skip to content

snglcoinc: fix rate_factors for more than two detector cases

Koh Ueno requested to merge koh.ueno/lalsuite:master into master

The CoincRates class has now two different implementations to calculate rate_factors. The newer implementation requires scipy.spatial.HalfspaceIntersection, which is only available from SciPy 0.19.0. The class is written such that if there is not the attribute 'HalfspaceIntersection' available, then the older implementation calculates rate_factors instead. It should be noted that the required SciPy versions are not necessarily installed at CIT or other clusters for every Python version. For example, the rpm command on ldas-pcdev1 will tell you that for python36 you can use rh-python36-scipy-0.19.1-2.el7.x86_64 but for python2 only python2-scipy-0.18.1-2.2.el7.x86_64. So there is still always a possibility that people have to use the older implementation, which is based on a Monte Carlo sampling technique.

rate_factors always need to take into account the time window factors for more than single detector cases but the older implementation hadn't for more than two detector cases ever since the second last commit, which was made four months ago, and in some cases did produce negative rates. So the modification I made was adding two sentences, which is to multiply the time window factors properly.

You can reproduce the correct and wrong results I got by just executing the following lines with the new and current codes, respectively:

from lalburst import snglcoinc

coincrates = snglcoinc.CoincRates(("H1", "L1", "K1"), 0.005, 1)

print(coincrates.rate_factors)

You can refer to https://git.ligo.org/lscsoft/lalsuite/blob/fe4a149f9e713a7a0ff196ad31c144dcb379dec6/lalburst/python/lalburst/snglcoinc.py#L1178 for the correct rate value for the three detector coincidence.

This change only affects the output rate_factors values and does not warrant any other modifications. This change introduces no API changes.

Edited by LALSuite Bot

Merge request reports