aboutsummaryrefslogtreecommitdiffstats
path: root/acispy/image.py
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2017-02-24 10:37:34 +0800
committerAaron LI <aaronly.me@outlook.com>2017-02-24 10:37:34 +0800
commit7f58aa20a306650a6817aaabdeeb4974cf27b807 (patch)
treebada2c6ab555e001c580d2d43f02f5203da0dc4a /acispy/image.py
parent59939a96a0811cc982098c047f863b8d6f723789 (diff)
downloadchandra-acis-analysis-7f58aa20a306650a6817aaabdeeb4974cf27b807.tar.bz2
Split 'get_xygrid()' from 'make_expmap.py' to 'acispy/image.py'
Diffstat (limited to 'acispy/image.py')
-rw-r--r--acispy/image.py22
1 files changed, 22 insertions, 0 deletions
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 <liweitianux@live.com>
+# 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