Skip to content
Snippets Groups Projects

Online new extinction

Merged Prathamesh Joshi requested to merge o4b-online-new-extinction into o4b-online
10 unresolved threads
Files
4
@@ -207,7 +207,7 @@ def main():
svd_bin = reg[:4]
if os.path.isfile(pdfs[svd_bin].files[0]):
# load the old ranking stat pdf for this bin:
old_pdf = far.parse_likelihood_control_doc(ligolw_utils.load_url(pdfs[svd_bin].files[0], verbose = options.verbose, contenthandler = far.RankingStat.LIGOLWContentHandler))
_, old_pdf = far.parse_likelihood_control_doc(ligolw_utils.load_url(pdfs[svd_bin].files[0], verbose = options.verbose, contenthandler = far.RankingStat.LIGOLWContentHandler))
else:
logging.warning(f"Couldn't find {pdfs[svd_bin].files[0]}, starting from scratch")
old_pdf = None
@@ -245,14 +245,23 @@ def main():
# get the zerolag pdf for this bin and use it to perform bin-specific extinction
zerolag_counts_url = url_from_registry(reg, zerolag_counts_path)
pdf += far.RankingStatPDF.from_xml(ligolw_utils.load_url(zerolag_counts_url, verbose = options.verbose, contenthandler = far.RankingStat.LIGOLWContentHandler), u"gstlal_inspiral_likelihood")
if len(numpy.nonzero(pdf.zero_lag_lr_lnpdf.array)[0]) > 0:
if pdf.ready_for_extinction():
# LR calculation has started and we are ready to perform first-round extinction
if data:
data += pdf.new_with_extinction()
else:
data = pdf.new_with_extinction()
else:
logging.warning(f'Skipping first-round extinction for {pdfs[svd_bin].files[0]}')
# add a zeroed-out PDF instead, so that the template ids get added to data
logging.warning(f'Skipping first-round extinction for {pdfs[svd_bin].files[0]}, using an empty PDF instead')
pdf.noise_lr_lnpdf.array[:] = 0.
pdf.signal_lr_lnpdf.array[:] = 0.
pdf.zero_lag_lr_lnpdf.array[:] = 0.
if data:
data += pdf
else:
data = pdf
# while looping through registries
# send heartbeat messages
@@ -284,7+293,7 @@
# the zero-lag counts have the density estimation transform
# applied.
zerolag_counts_url = url_from_registry("gstlal_ll_inspiral_trigger_counter_registry.txt", zerolag_counts_path)
# add zerolag counts url to marginalized data
if data:
Loading