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' --- acispy/image.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 acispy/image.py (limited to 'acispy') diff --git a/acispy/image.py b/acispy/image.py new file mode 100644 index 0000000..0bcaf67 --- /dev/null +++ b/acispy/image.py @@ -0,0 +1,22 @@ +# Copyright (c) 2017 Weitian LI +# MIT license + +""" +FITS image utilities +""" + +import subprocess + + +def get_xygrid(image): + """ + Get the ``xygrid`` of the input 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() + return xygrid -- cgit v1.2.2