diff options
author | Aaron LI <aaronly.me@outlook.com> | 2017-02-18 13:52:34 +0800 |
---|---|---|
committer | Aaron LI <aaronly.me@outlook.com> | 2017-02-18 13:52:34 +0800 |
commit | 1d406c7466640a8e7ea4e61aae8c5d8408f7a919 (patch) | |
tree | 3c11a9f16e2d96eb7b4af6d47821e12fbc573273 /scripts | |
parent | 5336eb644f9e5cf4741e076a2eeb2a5b87f0cf4a (diff) | |
download | chandra-acis-analysis-1d406c7466640a8e7ea4e61aae8c5d8408f7a919.tar.bz2 |
calc_centroid.py: Support to get the starting point from a region file
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/calc_centroid.py | 4 |
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) |