From 49a4cfc15f198417d48187238a2112d3f3cf8467 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sat, 12 Jan 2019 00:24:38 +0800 Subject: astro/ds9saveimg.sh: Tweak delays to be more robust --- astro/ds9saveimg.sh | 13 ++++++++----- 1 file 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 _ -- cgit v1.2.2