Skip to content
Snippets Groups Projects
Commit bfa07d1a authored by Chad Hanna's avatar Chad Hanna
Browse files

gstlal_inspiral, inspiral.py: make process start time the same for each output...

gstlal_inspiral, inspiral.py: make process start time the same for each output file for accuracy and to reduce process metadata bloat


(cherry picked from commit 5f2954e1)
parent fd4525e8
No related branches found
No related tags found
No related merge requests found
Pipeline #76680 passed with warnings
......@@ -147,6 +147,7 @@ import socket
import StringIO
import sys
import tempfile
import time
import uuid
import warnings
......@@ -158,6 +159,7 @@ Gst.init(None)
import lal
from lal import LIGOTimeGPS
from lal import UTCToGPS
from lal.utils import CacheEntry
from ligo.gracedb.rest import DEFAULT_SERVICE_URL as gracedb_default_service_url
......@@ -181,6 +183,8 @@ from gstlal import servicediscovery
from gstlal import simulation
from gstlal import svd_bank
GSTLAL_PROCESS_START_TIME = UTCToGPS(time.gmtime())
@lsctables.use_in
class LIGOLWContentHandler(ligolw.LIGOLWContentHandler):
pass
......@@ -812,6 +816,7 @@ for output_file_number, (svd_bank_url_dict, output_url, ranking_stat_output_url,
coincs_document = inspiral.CoincsDocument(
url = output_url or "%s-%s_LLOID-%d-%d.xml.gz" % (lsctables.instrumentsproperty.set(detectors.channel_dict.keys()).replace(",", ""), options.job_tag, int(detectors.seg[0]), int(abs(detectors.seg))),
process_params = process_params,
process_start_time = GSTLAL_PROCESS_START_TIME,
comment = options.comment,
instruments = rankingstat.instruments,
seg = detectors.seg,
......
......@@ -313,12 +313,12 @@ def chisq_distribution(df, non_centralities, size):
class CoincsDocument(object):
sngl_inspiral_columns = ("process:process_id", "ifo", "end_time", "end_time_ns", "eff_distance", "coa_phase", "mass1", "mass2", "snr", "chisq", "chisq_dof", "bank_chisq", "bank_chisq_dof", "sigmasq", "spin1x", "spin1y", "spin1z", "spin2x", "spin2y", "spin2z", "template_duration", "event_id", "Gamma0", "Gamma1")
def __init__(self, url, process_params, comment, instruments, seg, offsetvectors, injection_filename = None, tmp_path = None, replace_file = None, verbose = False):
def __init__(self, url, process_params, process_start_time, comment, instruments, seg, offsetvectors, injection_filename = None, tmp_path = None, replace_file = None, verbose = False):
#
# how to make another like us
#
self.get_another = lambda: CoincsDocument(url = url, process_params = process_params, comment = comment, instruments = instruments, seg = seg, offsetvectors = offsetvectors, injection_filename = injection_filename, tmp_path = tmp_path, replace_file = replace_file, verbose = verbose)
self.get_another = lambda: CoincsDocument(url = url, process_params = process_params, process_start_time = process_start_time, comment = comment, instruments = instruments, seg = seg, offsetvectors = offsetvectors, injection_filename = injection_filename, tmp_path = tmp_path, replace_file = replace_file, verbose = verbose)
#
# url
......@@ -332,7 +332,16 @@ class CoincsDocument(object):
self.xmldoc = ligolw.Document()
self.xmldoc.appendChild(ligolw.LIGO_LW())
# NOTE FIXME override the process start time. Since gstlal
# inspiral can produce several output files from the same
# process, this can plot the process metadata by a factor of 50
# even though the same process generated the files. It is a
# major contributor to the size of merged databases and xml
# files. A patch to ligolw_process.register_to_xmldoc would be
# welcomed
self.process = ligolw_process.register_to_xmldoc(self.xmldoc, u"gstlal_inspiral", process_params, comment = comment, ifos = instruments)
if process_start_time is not None:
self.process.start_time = process_start_time
self.xmldoc.childNodes[-1].appendChild(lsctables.New(lsctables.SnglInspiralTable, columns = self.sngl_inspiral_columns))
self.xmldoc.childNodes[-1].appendChild(lsctables.New(lsctables.CoincDefTable))
self.xmldoc.childNodes[-1].appendChild(lsctables.New(lsctables.CoincTable))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment