Commit 7907ca86 authored by Leo P. Singer's avatar Leo P. Singer
Browse files

Add --instrument option to ligo-skymap-from-samples

See lscsoft/lalsuite!692.
parent 0531f3a5
......@@ -8,6 +8,9 @@ Changelog
- The ``bayestar-localize-lvalert`` and ``ligo-skymap-from-samples`` tools will
now generate multiresolution FITS files by default.
- Add ``--instrument`` option to ``ligo-skymap-from-samples`` to support
storing metadata about which detectors contributed data.
0.1.3 (2019-03-04)
......@@ -59,6 +59,8 @@ def parser():
help='generate a multiresolution HEALPix map')
parser.add_argument('-j', '--jobs', action='store_true',
help='Use multiple threads')
parser.add_argument('--instruments', metavar='H1|L1|V1|...', nargs='+',
help='instruments to store in FITS header')
parser.add_argument('--objid', help='event ID to store in FITS header')
return parser
......@@ -139,6 +141,8 @@ def main(args=None):
' '.join([_parser.prog] + sys.argv[1:])]
if args.objid is not None:
hpmap.meta['objid'] = args.objid
if args.instruments:
hpmap.meta['instruments'] = args.instruments
if args.enable_distance_map:
hpmap.meta['distmean'] = np.mean(dist)
hpmap.meta['diststd'] = np.std(dist)
......@@ -43,4 +43,8 @@ def samples(seed, tmpdir):
def test_from_samples(samples, tmpdir):
"""Test ligo-skyamp-from-samples."""
run_entry_point('ligo-skymap-from-samples', '--seed', '150914',
samples, '-o', str(tmpdir))
samples, '-o', str(tmpdir),
'--instruments', 'H1', 'L1', 'V1', '--objid', 'S1234')
table = / 'skymap.fits'), format='fits')
assert table.meta['OBJECT'] == 'S1234'
assert table.meta['INSTRUME'] == 'H1,L1,V1'
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