summaryrefslogtreecommitdiffstats
path: root/make_stowbkg_image.sh
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2016-04-28 22:05:42 +0800
committerAaron LI <aaronly.me@outlook.com>2016-04-28 22:05:42 +0800
commita530984601629a8dc00cae4a9048ee29ab7fb578 (patch)
treeabfeffec7c7829de9563badb4a1a18ed36de902c /make_stowbkg_image.sh
parentb2d8d255680aaf43db6bcc4048021cdd6b2eb9c5 (diff)
downloadcexcess-a530984601629a8dc00cae4a9048ee29ab7fb578.tar.bz2
make_stowbkg_image.sh: use the existing only one bgstow if no proper one found
Diffstat (limited to 'make_stowbkg_image.sh')
-rwxr-xr-xmake_stowbkg_image.sh10
1 files 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