Commit e00bfb92 authored by Tito Dal Canton's avatar Tito Dal Canton Committed by Leo Pound Singer

ligo-skymap-stats: tolerate FITS files not in sqlite db

During injection campaigns, search pipelines can create coincs unrelated to
injections.  This adds an option to ligo-skymap-stats to ignore FITS files for
which the inspinj database does not provide a match to an injection.
parent ef785b58
......@@ -17,6 +17,9 @@ Changelog
``ligo-skymap-flatten`` to support flattening multi-resolution HEALPix
datasets to specified resolutions.
- ``ligo-skymap-stats`` now ignores skymaps with no corresponding entries in
the inspinjfind database, instead of failing.
0.1.6 (2019-03-26)
......@@ -173,9 +173,7 @@ def process(fitsfilename):
AND cem2.table_name = 'coinc_event' AND cem2.event_id = ?
""", (coinc_event_id,)).fetchone()
if row is None:
raise ValueError(
"No database record found for event '{0}' in '{1}'".format(
coinc_event_id, sqlite.get_filename(db)))
return None
simulation_id, true_ra, true_dec, true_dist, far, snr = row
......@@ -249,5 +247,6 @@ def main(args=None):
with tqdm(total=len(opts.fitsfilenames)) as progress:
for record in pool_map(process, opts.fitsfilenames):
print(*record, sep="\t", file=opts.output)
if record is not None:
print(*record, sep="\t", file=opts.output)
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