From 742464633d616770712ea6bf4082c35b7f17cf53 Mon Sep 17 00:00:00 2001 From: davidh-ssec <david.hoese@ssec.wisc.edu> Date: Mon, 5 Feb 2018 18:37:43 -0600 Subject: [PATCH] Add regen_tower_level_b1.sh script --- scripts/regen_tower_level_b1.sh | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 scripts/regen_tower_level_b1.sh diff --git a/scripts/regen_tower_level_b1.sh b/scripts/regen_tower_level_b1.sh new file mode 100755 index 0000000..d5055a1 --- /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 -- GitLab