Commit 9c3942f8 authored by Charlie Hoy's avatar Charlie Hoy Committed by Leo Pound Singer

Adding ability to pass `ligo-skymap-from-samples` a `pesummary` metafile

parent 2da8ac3f
......@@ -34,15 +34,23 @@ def _identity(x):
_colname_map = (('rightascension', 'ra', _identity),
('right_ascension', 'ra', _identity),
('declination', 'dec', _identity),
('logdistance', 'dist', np.exp),
('distance', 'dist', _identity),
('luminosity_distance', 'dist', _identity),
('polarisation', 'psi', _identity),
('chirpmass', 'mc', _identity),
('chirp_mass', 'mc', _identity),
('a_spin1', 'a1', _identity),
('a_1', 'a1', _identity),
('a_spin2', 'a2', _identity),
('a_2', 'a2', _identity),
('tilt_spin1', 'tilt1', _identity),
('tilt_spin2', 'tilt2', _identity))
('tilt_1', 'tilt1', _identity),
('tilt_spin2', 'tilt2', _identity),
('tilt_2', 'tilt2', _identity),
('geocent_time', 'time', _identity))
def _remap_colnames(table):
......
......@@ -66,6 +66,12 @@ def parser():
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')
parser.add_argument('--path', type=str, default=None,
help="The path of the dataset within the HDF5 file")
parser.add_argument('--tablename', type=str, default="posterior_samples",
help='The name of the table to search for recursively '
'within the HDF5 file. By default, search for '
'posterior_samples')
return parser
......@@ -90,7 +96,8 @@ def main(args=None):
log.info('reading samples')
try:
data = io.read_samples(args.samples.name)
data = io.read_samples(args.samples.name, path=args.path,
tablename=args.tablename)
except IOError:
# FIXME: remove this code path once we support only HDF5
data = Table.read(args.samples, format='ascii')
......
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