aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--acispy/region.py2
-rwxr-xr-xscripts/calc_centroid.py5
2 files changed, 4 insertions, 3 deletions
diff --git a/acispy/region.py b/acispy/region.py
index 09e42fa..dd98d20 100644
--- a/acispy/region.py
+++ b/acispy/region.py
@@ -210,7 +210,7 @@ class Regions:
def __init__(self, regfile=None):
if regfile:
- self.regions = self.load(regfile)
+ self.load(regfile)
else:
self.regions = []
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)