An AWK script was used to extract the navigation, bathymetry, and temperature information recorded in each individual GPS data file for each day of data acquisition. AWK script "awkhold":
BEGIN {
FS = ","
}
{
FS = ","
ARGC = 2
depth = -9999
temp = -9999
if ($1=="$GPRMC")
{
utctime = $2
utcdate = $10
latdeg = substr($4,1,2)
latmin = substr($4,3,6)
declat = latdeg + (latmin/60)
londeg = substr($6,1,3)
lonmin = substr($6,4,6)
declon = -1 * (londeg + (lonmin/60))
if (NR==1) {
holddepth = -9999
holdtemp = -9999
}
else {
printf("%s, %s, %9.6f, %9.6f, %5.1f, %5.1f, %s\n", holdutctime, holdutcdate, holddeclon, holddeclat, holddepth, holdtemp, ARGV[2])
}
holdutctime = utctime
holdutcdate = utcdate
holddeclon = declon
holddeclat = declat
holddepth = -9999
holdtemp = -9999
}
if ($1=="$SDDPT")
{
depthreal = $2
holddepth = depthreal
}
if ($1=="$SDMTW")
{
tempreal = $2
holdtemp = tempreal
}
}
END {
printf("%s, %s, %9.6f, %9.6f, %5.1f, %5.1f, %s\n", holdutctime, holdutcdate, holddeclon, holddeclat, holddepth, holdtemp, ARGV[2])
}
This AWK script was initialized by "dohold" - shell script run under CYGWIN (UNIX like environment that runs under Windows). This shell script reads all the files in a folder with the extension "gps" and processes them. This is the script used for the April 13 data collection:
files=`ls *.gps | cut -d. -f1 | tr "[A-Z"] ["a-z"]`
for file in $files
do
awk -f awkhold $file.gps $file > $file.holds
done