diff options
author | Aaron LI <aly@aaronly.me> | 2019-01-12 00:24:38 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2019-01-12 00:24:38 +0800 |
commit | 49a4cfc15f198417d48187238a2112d3f3cf8467 (patch) | |
tree | fe950447ac82332723b8b000bd3399146672a537 | |
parent | 6b11a5e445db1d50e931e3ed328b5b8d4d1c2efb (diff) | |
download | atoolbox-49a4cfc15f198417d48187238a2112d3f3cf8467.tar.bz2 |
astro/ds9saveimg.sh: Tweak delays to be more robust
-rwxr-xr-x | astro/ds9saveimg.sh | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/astro/ds9saveimg.sh b/astro/ds9saveimg.sh index 13cbac1..a83a80a 100755 --- a/astro/ds9saveimg.sh +++ b/astro/ds9saveimg.sh @@ -23,8 +23,6 @@ IMG="${FITS%.fits}.png" TITLE="${NAME%.sh}$$" ds9 ${FITS} \ - -width 768 -height 768 \ - -zoom to fit \ -scale linear -scale mode 99.9 \ -cmap sls \ -regions format ds9 -regions ${REG} \ @@ -32,14 +30,19 @@ ds9 ${FITS} \ PID=$! echo "Launched ds9 as PID=${PID}" +sleep 2 retry=1 while [ ${retry} -ne 0 ]; do sleep 1 - # Bring the window to the front and snapshot to an image file - wmctrl -a ${TITLE} - xpaset -p ${TITLE} saveimage png ${IMG} + xpaset -p ${TITLE} width 768 && + xpaset -p ${TITLE} height 768 && + xpaset -p ${TITLE} zoom to fit retry=$? done + +# Bring the window to the front and snapshot to an image file +wmctrl -a ${TITLE} +xpaset -p ${TITLE} saveimage png ${IMG} echo "${TITLE}: ${FITS} + ${REG} => ${IMG}" #echo 'paused ...' && read _ |