Commit 7fa9d4cd authored by Matteo Quintiliani's avatar Matteo Quintiliani

Added option for gap tollerance


git-svn-id: file:///home/quintiliani/svncopy/nmxptool/trunk@696 3cd66e75-5955-46cb-a940-c26e5fc5497d
parent e8936e83
#!/bin/sh
# Syntax: cmd <nmxptool_channelfile> <year> <jday>
# Syntax: cmd <nmxptool_channelfile> <year> <jday> [<gap_tol>]
# gap_tol is option -G of qmerge
#
# TODO: add location
#
......@@ -26,6 +27,11 @@ NMXPCHANNELFILE=$1
YEAR=$2
JDAY=`echo $3 | sed -e "s/^[0]*//"`
if [ ! -z $4 ]; then
QMERGEOPT="-G $4"
echo "qmerge option: ${QMERGEOPT}"
fi
# variables dependent on the input parameters
if [ $JDAY -le 0 ]; then
......@@ -51,6 +57,7 @@ DIRARCHIVESDS=/home/sysop/seiscomp/acquisition/archive
DIRLOG=$(dirname $0)/log
NOW=$(date "+%Y%m%dx%H%M%S")
QMERGE=qmerge
FILEOUTARCH=qmerge.out.txt
while read LINE
do
......@@ -58,8 +65,6 @@ do
STA=`echo $LINE | cut -d'.' -f 2`
CHANWILD=`echo $LINE | cut -d'.' -f 3`
echo "$NET $STA $CHANWILD"
if [ "$CHANWILD" == "HH?" ]; then
CHANNELCOMPS="HHZ HHN HHE"
else
......@@ -74,7 +79,15 @@ do
FILEARCH=${DIRARCHIVESDS}/${YEAR}/${NET}/${STA}/${CHAN}.D/${NET}.${STA}.${LOC}.${CHAN}.D.${YEAR}.${JDAY}
if [ -f ${FILEARCH} ]; then
$QMERGE -n $FILEARCH
${QMERGE} ${QMERGEOPT} -n ${FILEARCH} > ${FILEOUTARCH}
NSEGMENTS=`grep ${YEAR}.${JDAY} ${FILEOUTARCH} | wc -l`
NGAP=$(( ${NSEGMENTS} - 1 ))
echo ""
echo "${NET}.${STA}.${CHAN} ${YEAR}.${JDAY} ${QMERGEOPT}: ${NGAP} gaps "
cat ${FILEOUTARCH}
else
echo "WARNING: ${FILEARCH} does not exists!"
fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment