summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@gmail.com>2016-04-26 23:23:46 +0800
committerAaron LI <aaronly.me@gmail.com>2016-04-26 23:23:46 +0800
commit1f85f3116955e7da0be3249b8908aaa8d0c3f18c (patch)
treee8ea80d443732623e90f71ad664442149df87ba3
parent395569261fabaedcc7674fd88a1a627bee0745f4 (diff)
downloadcexcess-1f85f3116955e7da0be3249b8908aaa8d0c3f18c.tar.bz2
merge_imgdir_zzh.sh: new; merge the two "img" directories for ZZH
-rwxr-xr-xmerge_imgdir_zzh.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/merge_imgdir_zzh.sh b/merge_imgdir_zzh.sh
new file mode 100755
index 0000000..3f62b95
--- /dev/null
+++ b/merge_imgdir_zzh.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# Clean and merge the two 'img' directories for ZZH's sample data.
+# * 'img': ${name}/${obsid}/evt2/img
+# * 'img2': ${name}/${obsid}/repro/img
+# The contents of 'img2' are merged to 'img'.
+#
+# Aaron LI
+# Created: 2016-04-26
+#
+
+IMG_DIR="img"
+IMG2_DIR="img2"
+
+case "$1" in
+ -[hH]*)
+ echo "Usage:"
+ echo " `basename $0` <repro_dir1> ..."
+ exit 1
+ ;;
+esac
+
+INIT_DIR=`pwd -P`
+while [ ! -z "$1" ]; do
+ repro_dir="$1"
+ shift
+ cd ${INIT_DIR}
+ cd ${repro_dir}
+ echo "*** ${PWD} ***"
+ # clean ${IMG_DIR} and ${IMG2_DIR}
+ ( cd ${IMG_DIR}; \
+ rm -fv _* *.log *bak evt2_*.fits img_*.fits smooth.fits; )
+ ( cd ${IMG2_DIR}; \
+ rm -fv rspec* sbprofile* radius_sbp.txt flux_sbp.txt )
+ # merge
+ mv -fv ${IMG2_DIR}/* ${IMG_DIR}
+ rmdir -v ${IMG2_DIR}
+done
+