From 1d406c7466640a8e7ea4e61aae8c5d8408f7a919 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sat, 18 Feb 2017 13:52:34 +0800 Subject: calc_centroid.py: Support to get the starting point from a region file --- scripts/calc_centroid.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts') 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) -- cgit v1.2.2