From 095ab02fd2a87bb6ea0364526df7f231e550556e Mon Sep 17 00:00:00 2001 From: "edward.safford" Date: Thu, 4 Aug 2022 15:05:49 +0000 Subject: [PATCH] Ref #14 Add check on num files to avoid running exec when pointless. --- src/Radiance_Monitor/image_gen/ush/plot_angle.sh | 5 +++++ src/Radiance_Monitor/image_gen/ush/plot_bcoef.sh | 5 +++++ src/Radiance_Monitor/image_gen/ush/plot_bcor.sh | 5 +++++ src/Radiance_Monitor/image_gen/ush/plot_summary.sh | 5 +++++ src/Radiance_Monitor/image_gen/ush/plot_time.sh | 5 +++++ 5 files changed, 25 insertions(+) diff --git a/src/Radiance_Monitor/image_gen/ush/plot_angle.sh b/src/Radiance_Monitor/image_gen/ush/plot_angle.sh index 78554cab..1b131dbb 100755 --- a/src/Radiance_Monitor/image_gen/ush/plot_angle.sh +++ b/src/Radiance_Monitor/image_gen/ush/plot_angle.sh @@ -129,6 +129,11 @@ for type in ${SATYPE2}; do # prefix="angle." dfiles=`ls *.ieee_d` + if [[ $dfiles = "" ]]; then + echo "NO DATA available for $type, aborting bcoef plot" + continue + fi + for file in $dfiles; do newfile=`basename $file | sed -e "s/^$prefix//"` mv ./${file} ./${newfile} diff --git a/src/Radiance_Monitor/image_gen/ush/plot_bcoef.sh b/src/Radiance_Monitor/image_gen/ush/plot_bcoef.sh index 2bd4a41a..08d36c16 100755 --- a/src/Radiance_Monitor/image_gen/ush/plot_bcoef.sh +++ b/src/Radiance_Monitor/image_gen/ush/plot_bcoef.sh @@ -110,6 +110,11 @@ for type in ${SATYPE}; do # prefix="bcoef." dfiles=`ls *.ieee_d` + if [[ $dfiles = "" ]]; then + echo "NO DATA available for $type, aborting bcoef plot" + continue + fi + for file in $dfiles; do newfile=`basename $file | sed -e "s/^$prefix//"` mv ./${file} ./${newfile} diff --git a/src/Radiance_Monitor/image_gen/ush/plot_bcor.sh b/src/Radiance_Monitor/image_gen/ush/plot_bcor.sh index 64c0aa45..62d6a77a 100755 --- a/src/Radiance_Monitor/image_gen/ush/plot_bcor.sh +++ b/src/Radiance_Monitor/image_gen/ush/plot_bcor.sh @@ -117,6 +117,11 @@ for type in ${SATYPE2}; do # prefix="bcor." dfiles=`ls *.ieee_d` + if [[ $dfiles = "" ]]; then + echo "NO DATA available for $type, aborting bcoef plot" + continue + fi + for file in $dfiles; do newfile=`basename $file | sed -e "s/^$prefix//"` mv ./${file} ./${newfile} diff --git a/src/Radiance_Monitor/image_gen/ush/plot_summary.sh b/src/Radiance_Monitor/image_gen/ush/plot_summary.sh index d126f6fb..48141e65 100755 --- a/src/Radiance_Monitor/image_gen/ush/plot_summary.sh +++ b/src/Radiance_Monitor/image_gen/ush/plot_summary.sh @@ -107,6 +107,11 @@ for type in ${SATYPE2}; do # prefix="time." dfiles=`ls *.ieee_d` + if [[ $dfiles = "" ]]; then + echo "NO DATA available for $type, aborting summary plot" + continue + fi + for file in $dfiles; do newfile=`basename $file | sed -e "s/^$prefix//"` mv ./${file} ./${newfile} diff --git a/src/Radiance_Monitor/image_gen/ush/plot_time.sh b/src/Radiance_Monitor/image_gen/ush/plot_time.sh index b4256c17..e2c7c1cb 100755 --- a/src/Radiance_Monitor/image_gen/ush/plot_time.sh +++ b/src/Radiance_Monitor/image_gen/ush/plot_time.sh @@ -117,6 +117,11 @@ for type in ${SATYPE2}; do # prefix="time." dfiles=`ls *.ieee_d` + if [[ $dfiles = "" ]]; then + echo "NO DATA available for $type, aborting time plot" + continue + fi + for file in $dfiles; do newfile=`basename $file | sed -e "s/^$prefix//"` mv ./${file} ./${newfile}