aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2017-02-20 21:13:01 +0800
committerAaron LI <aaronly.me@outlook.com>2017-02-20 21:13:01 +0800
commit770d77da3ce9d91dd5fd2bca548797d67cd79989 (patch)
tree531609ddedfb944285dd24872307486db121c115 /scripts
parentdeed9f233b0f22a4778d547587442d6834a9e53d (diff)
downloadchandra-acis-analysis-770d77da3ce9d91dd5fd2bca548797d67cd79989.tar.bz2
Fix errors in acispy/region.py and scripts/calc_centroid.py
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/calc_centroid.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/calc_centroid.py b/scripts/calc_centroid.py
index 2f4606f..6d8ba33 100755
--- a/scripts/calc_centroid.py
+++ b/scripts/calc_centroid.py
@@ -20,7 +20,7 @@ from _context import acispy
from acispy.manifest import get_manifest
from acispy.pfiles import setup_pfiles
from acispy.ds9 import ds9_view
-from acispy.regions import Regions
+from acispy.region import Regions
def smooth_image(infile, outfile=None,
@@ -177,7 +177,8 @@ def main():
radius=radius)
print("Done!", file=sys.stderr)
- open(args.outfile, "w").write("point(%f,%f)\n" % centroid).close()
+ with open(args.outfile, "w") as f:
+ f.write("point(%f,%f)\n" % centroid)
print("Saved centroid to file:", args.outfile, file=sys.stderr)
if args.view:
ds9_view(img_smoothed, regfile=args.outfile)