An AWK script was used to extract the navigation, Bathymetry, and temperature information recorded in each individual GPS data file. (* refers to the line name, which for this day are L15F1, L16F1, L17F1, L18F1, L19F1, L20F1, L21F1, L22F1, L23F1, L24F1, L24F2, L25F1, L26F1, L27F1, L28F1, L29F1, L30F1, L31F1, L32F1, L33F1, L34F1, L35F1, and L36F1.) This day needed a slightly different awk script because of the problems with the temperature sensor.
AWK script "awkhold":
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))
if (NR==1) {
holddepth = -9999
holdtemp = -9999
}
else {
printf("%s, %9.6f, %9.6f, %5.1f, %5.1f, %s\n", holdutctime, holddeclon, holddeclat, holddepth, holdtemp, ARGV[2])
}
holdutctime = utctime
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, %9.6f, %9.6f, %5.1f, %5.1f, %s\n", holdutctime, 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):
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