From 7f58aa20a306650a6817aaabdeeb4974cf27b807 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Fri, 24 Feb 2017 10:37:34 +0800 Subject: Split 'get_xygrid()' from 'make_expmap.py' to 'acispy/image.py' --- bin/make_expmap.py | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) (limited to 'bin') diff --git a/bin/make_expmap.py b/bin/make_expmap.py index ff1fbb0..1df4766 100755 --- a/bin/make_expmap.py +++ b/bin/make_expmap.py @@ -51,28 +51,13 @@ from acispy.manifest import get_manifest from acispy.pfiles import setup_pfiles from acispy.acis import ACIS from acispy.header import write_keyword +from acispy.image import get_xygrid logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) -def get_xygrid(image): - """ - Get the ``xygrid`` of the input image for later ``mkexpmap``'s use. - """ - logger.info("Get the 'xygrid' of image: %s" % image) - subprocess.check_call(["punlearn", "get_sky_limits"]) - subprocess.check_call([ - "get_sky_limits", "image=%s" % image, "verbose=0" - ]) - xygrid = subprocess.check_output([ - "pget", "get_sky_limits", "xygrid" - ]).decode("utf-8").strip() - logger.info("xygrid: %s" % xygrid) - return xygrid - - def make_aspect_histogram(outfile, asol, evtfile, chip, clobber=False): """ Create the aspect histogram for each chip, detailing the aspect @@ -211,6 +196,7 @@ def main(): logger.info("msk: %s" % msk) xygrid = get_xygrid(args.infile) + logger.info("%s:xygrid: %s" % (args.infile, xygrid)) expmaps = [] for c in chips: @@ -237,7 +223,7 @@ def main(): logger.info("Update keyword 'DETNAM' to %s" % detnam) write_keyword(args.outfile, keyword="DETNAM", value=detnam) - # Add created exposure map and exposure-corrected image to manifest + logger.info("Add created exposure map to manifest ...") key = "expmap" manifest.setpath(key, args.outfile) logger.info("Added '%s' to manifest: %s" % (key, manifest.get(key))) -- cgit v1.2.2