diff --git a/scripts/regen_tower_level_b1.sh b/scripts/regen_tower_level_b1.sh new file mode 100755 index 0000000000000000000000000000000000000000..d5055a106ade6cfad29a503b0052f10d74350c43 --- /dev/null +++ b/scripts/regen_tower_level_b1.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +# Description: Create Level b1 netcdf4 files and the corresponding quicklooks +SCRIPT_HOME="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +SCRIPT_NAME=$(basename $0) +SCRIPT_NAME=${SCRIPT_NAME/.sh/} + +# Get environment variables and common functions +source $SCRIPT_HOME/metobs_config.sh + +DATE=$1 +if [ -z "$DATE" ]; then + DATE=`date +%Y%m%d` +fi +LOCK="${LOCKDIR}/${SCRIPT_NAME}.lock" +logfile="${LOGDIR}/${SCRIPT_NAME}.log" + +if [ ! -d $LOGDIR ]; then + oops "Log directory doesn't exist: $LOGDIR" + exit 1 +fi + +base_dir="${TOWER_CACHE_DIR}/level_00/version_00" +for file_pathname in `find $base_dir -name "*.ascii" | sort`; do + dir=`dirname $file_pathname` + day=`basename $dir` + dir=`dirname $dir` + month=`basename $dir` + dir=`dirname $dir` + year=`basename $dir` + + d="${year}${month}${day}" + log_info "Processing $d" + $SCRIPT_HOME/run_tower_level_b1.sh $d || log_info "Failed to generate level b1 for ${d}" +done