#! /bin/csh
# eptprocess -- C Shell script to process eqpac test data
#

set oasisDir = /oasis
set eqpacDir = $oasisDir/test
set dataDir = $oasisDir/test/raw
set binDir = $oasisDir/bin
set cfgDir = $eqpacDir/cfg

if ($#argv >= 4) then
	set mooring = $1
	set rx = $2
	set cfgFile = $3
	set dataFile = $4
else
	echo "Usage $0 <ep1|ep2> <tn|td|ao> <cfg file> <data file>\n"
	exit
endif
echo " Processing $mooring using Rx: $rx CFG: $cfgFile File: $dataFile"

exit

# Note that we're erasing data files and re-extracting the entire set.
# It turns out this is easier and faster than appending data to existing
#  files, and then sorting and merging the results.

rm -f $eqpac/ep1/* >& /dev/null
cp $eqpac/cfg/ep1/* $eqpac/ep1 >& /dev/null

cd $eqpac/raw

$bin/argextract -c $cfgfile1 $file1

$bin/argos -c $cfgfile1 $file1 > $eqpac/ep1/data


rm -f $file1 >& /dev/null

cd $eqpac/ep1
mv argos argos.tmp
sort argos.tmp | awk -f $eqpac/bin/argos.awk nmsgs=10 >argos
rm -f argos.tmp


