diff options
author | Aaron LI <aaronly.me@outlook.com> | 2017-03-06 18:39:32 +0800 |
---|---|---|
committer | Aaron LI <aaronly.me@outlook.com> | 2017-03-06 18:39:32 +0800 |
commit | f8799d813675c98fbc000ae599d84984f4a09880 (patch) | |
tree | 1b1f9394011039c4fcb52ca11457c47667713319 | |
parent | e4683cf714f4b3f5aeccc3c145b077bdd992054f (diff) | |
download | chandra-acis-analysis-f8799d813675c98fbc000ae599d84984f4a09880.tar.bz2 |
chandra_genspcreg.sh: Give default values for reg_in and reg_out
-rwxr-xr-x | bin/calc_centroid.py | 2 | ||||
-rwxr-xr-x | scripts/chandra_genspcreg.sh | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/bin/calc_centroid.py b/bin/calc_centroid.py index c0bc02d..4314cea 100755 --- a/bin/calc_centroid.py +++ b/bin/calc_centroid.py @@ -175,6 +175,8 @@ def main(): manifest = get_manifest() key = "reg_centroid" manifest.setpath(key, args.outfile) + print("Added item '%s' to manifest: %s" % (key, manifest.get(key)), + file=sys.stderr) if __name__ == "__main__": diff --git a/scripts/chandra_genspcreg.sh b/scripts/chandra_genspcreg.sh index 22754df..41b28a3 100755 --- a/scripts/chandra_genspcreg.sh +++ b/scripts/chandra_genspcreg.sh @@ -33,16 +33,15 @@ CH_HI=479 CH_BKG_LOW=651 CH_BKG_HI=822 -if [ $# -ne 4 ] ; then - printf "usage:\n" - printf " `basename $0` <evt> <bkg_pi> <reg_in> <reg_out>\n" +if [ $# -lt 2 ] ; then + echo "usage: `basename $0` <evt> <bkg_pi> [ centroid.reg rspec.reg ]" exit 1 fi EVT=$1 BKGSPC=$2 -REG_IN=$3 -REG_OUT=$4 +REG_IN=${3:-centroid.reg} +REG_OUT=${4:-rspec.reg} X=`\grep -i 'point' ${REG_IN} | head -n 1 | tr -d 'a-zA-Z() ' | awk -F',' '{ print $1 }'` Y=`\grep -i 'point' ${REG_IN} | head -n 1 | tr -d 'a-zA-Z() ' | awk -F',' '{ print $2 }'` |