Skip to content

io.py: fix bug in determining clean segs in ClassifierData.random_times() when segs are passed in

Patrick Godwin requested to merge clean_segs_bugfix into master

So, turns out when the segs kwarg is passed into ClassifierData.random_times(), this calls remove_segments rather than segments_intersection, which causes the clean segments produced to be empty rather than doing an intersection.

Not sure how this snuck by the testing I was doing, but this has the effect of causing the rate estimation to be wacky in the calibration maps, if using segments to calculate the clean and glitch rates for the p(glitch) priors online. This is because the full segments are passed in correctly, but the livetime associated with clean segments with an empty seglist is zero, so it'll just look like most of the time is glitchy (except during the initial training when the segment calculation is right since the batch version doesn't pass in segments).

This is critical enough that once this is in, I'd like this and the preferred logic fix you added in a new release and deployed.

Merge request reports