#!/bin/sh -v # script to prepare a data case after downloading (for Becca Mazur) # @author Lakshman # @version $Id: qctest_sh.txt,v 1.1 2006/03/27 17:15:56 lakshman Exp $ ## to use this script, do this: ## (1) save the script somewhere ## (2) edit the lines marked TOPDIR and RADAR using a text editor ## (3) type: chmod +x qctest.sh ## (4) type: ./qctest.sh > out.log ## (5) in a new terminal, type: tail -f out.log ## The original terminal will give you overview of where the script is ## The second terminal will give you progress in the task itself ## ## Change DOTHIS to SKIP to avoid running part of the script ## TOPDIR="/scratch/lakshman/qcdata/downloads/KFWS041995" ORIG_DATA_DIR="${TOPDIR}/orig" NETCDF_DIR="${TOPDIR}/netcdf" RADAR="KFWS" ## helpful parameters MYDIR=`pwd` DOTHIS="test 1 -lt 2" SKIP="test 2 -lt 1" ## run ldm2netcdf if `${DOTHIS}`; then rm -rf ${NETCDF_DIR} ldm2netcdf -i ${ORIG_DATA_DIR} -o ${NETCDF_DIR} -k -a -1 -p ${RADAR} -D --verbose -s ${RADAR} ## create .xml index file so that programs exit instead of waiting for new data makeIndex.pl ${NETCDF_DIR} radar_data.xml fi ## run w2vil and qcnn on the radar data if `${DOTHIS}`; then w2vil -i "${NETCDF_DIR}/radar_data.xml" -o ${NETCDF_DIR} --verbose w2qcnn -i "${NETCDF_DIR}/radar_data.xml" -o ${NETCDF_DIR} -u ---verbose ## create .xml index file so that programs exit instead of waiting for new data makeIndex.pl ${NETCDF_DIR} radar_data.xml fi ## to run netssap, we need ssapdat in the current directory ## so download it if needed and move to that directory SSAPDIR=/tmp/netssapdat if `test -e ${SSAPDIR}`; then echo "${SSAPDIR} already downloaded, so reusing it" else mkdir ${SSAPDIR} cd ${SSAPDIR} wget "http://cimms.ou.edu/~lakshman/internal/univokla/wdssii_software/ssapdat.tgz" -O ssapdat.tgz tar xvfz ssapdat.tgz fi cd ${SSAPDIR} ## run w2segmotion and netssap on the unedited data if `${SKIP}`; then rm -rf ${NETCDF_DIR}/unedited mkdir ${NETCDF_DIR}/unedited w2segmotioncg -i ${NETCDF_DIR}/code_index.xml -T ReflectivityMaximum:vol -t "30 60 90" -d "20 60" -o "${NETCDF_DIR}/unedited" --verbose netssap -i ${NETCDF_DIR}/code_index.xml -o "${NETCDF_DIR}/unedited" --verbose -s ${RADAR} -R Reflectivity -f 50:7 fi ## run w2segmotion and netssap on the cleaned up data if `${DOTHIS}`; then rm -rf ${NETCDF_DIR}/qc mkdir ${NETCDF_DIR}/qc w2segmotioncg -i ${NETCDF_DIR}/code_index.xml -T ReflectivityQCompositeVolume:vol -t "30 60 90" -d "20 60" -o "${NETCDF_DIR}/qc" --verbose netssap -i "${NETCDF_DIR}/code_index.xml" -o "${NETCDF_DIR}/qc" --verbose -s ${RADAR} -R ReflectivityQC -f 50:7 fi ## go back to directory user was in cd ${MYDIR}