The first step is to check the navigation recorded in the *.gps file for each line of acquisition. At first glance, the navigation data in the files seem fine so I ran an AWK script which extracts the navigation, bathymetry, and temperature information recorded in each individual GPS data file. (* refers to the line name, which for this day are L1F1, L2F1, L3F1, L4F1, F5L1, L6F1, L7F1, L8F1, L9F1, L9F2, L10F1, L11F1, L12F1, L12F2, L13F1.)
AWK script "awkgps":
BEGIN {
FS = ","
}
{
FS = ","
ARGC = 2
depth = -9999
temp = -9999
if ($1=="$GPRMC")
{
utctime = $2
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))
holddepth = -9999
}
if ($1=="$SDDPT")
{
depthreal = $2
holddepth = depthreal
}
if ($1=="$SDMTW")
{
temp = $2
if (holddepth > -1) {
printf("%s, %9.6f, %9.6f, %3.1f, %4.1f, %s\n", utctime, declon, declat, holddepth, temp, ARGV[2])
}
else {
printf("%s, %9.6f, %9.6f, %3.1f, %4.1f, %s\n", utctime, declon, declat, depth, temp, ARGV[2])
}
holddepth = -9999
}
}
This AWK script was initialized by "doawk" - shell script run under CYGWIN (UNIX like environment that runs under Windows):
files=`ls *.gps | cut -d. -f1 | tr "[A-Z"] ["a-z"]`
for file in $files
do
awk -f awkgps $file.gps $file > $file.txt
done