From a530984601629a8dc00cae4a9048ee29ab7fb578 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Thu, 28 Apr 2016 22:05:42 +0800 Subject: make_stowbkg_image.sh: use the existing only one bgstow if no proper one found --- make_stowbkg_image.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/make_stowbkg_image.sh b/make_stowbkg_image.sh index ea75fef..4cd74b7 100755 --- a/make_stowbkg_image.sh +++ b/make_stowbkg_image.sh @@ -10,6 +10,7 @@ # # Changelog: # 2016-04-28: +# * Use the existing only one bgstow if no proper bgstow found # * Update keyword "DETNAM" after merge # @@ -85,8 +86,13 @@ lookup_bgstow() { _bgstow=`\ls ${_dir}/${_det}${_year}-??-??bgstow*.fits | grep -v 'bgstow_cti'` fi if [ -z "${_bgstow}" ]; then - echo "ERROR: cannot found bgstow for blanksky: ${_dir}/${_blanksky}" >/dev/stderr - exit 100 + if [ `\ls ${_dir}/${_det}${_year}-??-??bgstow*.fits | wc -l` -eq 1 ]; then + _bgstow=`\ls ${_dir}/${_det}${_year}-??-??bgstow*.fits` + echo "WARNING: no proper bgstow; but use the only one" > /dev/stderr + else + echo "ERROR: cannot found bgstow for blanksky: ${_dir}/${_blanksky}" >/dev/stderr + exit 100 + fi fi echo "${_bgstow}" unset _dir _blanksky _det _year _bgstow -- cgit v1.2.2