aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2017-02-18 13:52:34 +0800
committerAaron LI <aaronly.me@outlook.com>2017-02-18 13:52:34 +0800
commit1d406c7466640a8e7ea4e61aae8c5d8408f7a919 (patch)
tree3c11a9f16e2d96eb7b4af6d47821e12fbc573273 /scripts
parent5336eb644f9e5cf4741e076a2eeb2a5b87f0cf4a (diff)
downloadchandra-acis-analysis-1d406c7466640a8e7ea4e61aae8c5d8408f7a919.tar.bz2
calc_centroid.py: Support to get the starting point from a region file
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/calc_centroid.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/calc_centroid.py b/scripts/calc_centroid.py
index f705d3a..d5342a5 100755
--- a/scripts/calc_centroid.py
+++ b/scripts/calc_centroid.py
@@ -19,6 +19,7 @@ import tempfile
from manifest import get_manifest
from setup_pfiles import setup_pfiles
from ds9 import ds9_view
+from regions import Regions
def smooth_image(infile, outfile=None,
@@ -158,7 +159,8 @@ def main():
if args.start:
print("Get starting point from region file: %s" % args.start,
file=sys.stderr)
- raise NotImplementedError
+ region = Regions(args.start).regions[0]
+ center = (region.xc, region.yc)
else:
print("Use peak as the starting point ...", file=sys.stderr)
center = get_peak(img_smoothed)