Commit f004adf1 authored by Leo Pound Singer's avatar Leo Pound Singer

lalinference.io.fits: write VCS info

Original: cd5d7e95506c40ea26046c327d96631fe5a03d6b
parent 4fe4dd9d
......@@ -37,6 +37,7 @@ from . import postprocess
from . import timing
from . import moc
from .. import healpix_tree
from .. import InferenceVCSInfo as vcs_info
try:
from . import _sky_map
except ImportError:
......@@ -392,6 +393,7 @@ def ligolw_sky_map(
# Fill in metadata and return.
skymap.meta['creator'] = 'BAYESTAR'
skymap.meta['origin'] = 'LIGO/Virgo'
skymap.meta['vcs_info'] = vcs_info
skymap.meta['gps_time'] = float(epoch)
skymap.meta['runtime'] = float(end_time - start_time)
skymap.meta['instruments'] = {sngl_inspiral.ifo for sngl_inspiral in sngl_inspirals}
......
......@@ -208,7 +208,11 @@ FITS_META_MAPPING = (
('distmean', 'DISTMEAN', 'Posterior mean distance in Mpc', identity, identity),
('diststd', 'DISTSTD', 'Posterior standard deviation of distance in Mpc', identity, identity),
('log_bci', 'LOGBCI', 'Log Bayes factor: coherent vs. incoherent', identity, identity),
('log_bsn', 'LOGBSN', 'Log Bayes factor: signal vs. noise', identity, identity))
('log_bsn', 'LOGBSN', 'Log Bayes factor: signal vs. noise', identity, identity),
('vcs_info', 'VCSVERS', 'Software version', lambda _: _.name + ' ' + _.version, None),
('vcs_info', 'VCSSTAT', 'Software version control status', lambda _: _.vcsStatus, None),
('vcs_info', 'VCSID', 'Software git commit hash', lambda _: _.vcsId, None),
('vcs_info', 'DATE-BLD', 'Software build date', lambda _: _.buildDate, None))
def write_sky_map(filename, m, **kwargs):
......
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