Commit 26f8ac50 authored by Leo P. Singer's avatar Leo P. Singer
Browse files

Accept sky map file names as globs

Original: c263e633812b09bedcf4258e79654940348d8172
parent 58d26226
......@@ -28,6 +28,9 @@ summary values for each sky map:
* searched posterior probability
* angle between true sky location and maximum a posteriori estimate
* runtime in seconds
The filenames of the sky maps may be provided as positional command line
arguments, and may also be provided as globs (such as '*.fits.gz').
"""
__author__ = "Leo Singer <leo.singer@ligo.org>"
......@@ -49,13 +52,15 @@ opts, args = parser.parse_args()
try:
dbfilename = args[0]
fitsfilenames = args[1:]
fitsfileglobs = args[1:]
except IndexError:
parser.error("not enough command line arguments")
outfile = open(opts.output, "w")
# Imports.
import glob
import itertools
import os
import numpy as np
import healpy as hp
......@@ -64,6 +69,10 @@ from pylal.progress import ProgressBar
from lalinference.bayestar import fits
fitsfilenames = itertools.chain.from_iterable(glob.iglob(fitsfileglob)
for fitsfileglob in fitsfileglobs)
sql = """
SELECT DISTINCT sim.longitude AS ra, sim.latitude AS dec, ci.combined_far AS far
FROM coinc_event_map AS cem1 INNER JOIN coinc_event_map AS cem2
......
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