With the particular lines of interest extracted from the original HYPACK files, additional scripts were run to extract the specific information of interest. The next two scripts run are doholdhypack and awkholdhypack. The doholdhypack is a shell script run under Cygwin which cycles through all the *.navdep files in the folder and calls the awkholdhypack AWK script to process the file, with the results output to *.holdhypack. Of note, if the SDBPT record does not contain a depth value, a value of -9999 is written to the output file - acting as a nodata value. >doholdhypack:
files=`ls *.navdep | cut -d. -f1`
for file in $files
do
awk -f awkholdhypack $file.navdep > $file.holdhypack
done
awkholdhypack:
BEGIN {
FS = ","
}
{
FS = ","
depth = -9999
if ($1 ~ /GPGGA/)
{
utctime = $2
latdeg = substr($3,1,2)
latmin = substr($3,3,6)
declat = latdeg + (latmin/60)
londeg = substr($5,1,3)
lonmin = substr($5,4,6)
declon = -1 * (londeg + (lonmin/60))
if (NR==1) {
holddepth = -9999
}
else {
printf("%s, %9.6f, %9.6f, %5.1f\n", holdutctime, holddeclon, holddeclat, holddepth)
}
holdutctime = utctime
holdutcdate = utcdate
holddeclon = declon
holddeclat = declat
holddepth = -9999
}
if ($1 ~ /SDDBT/)
{
if ($4 != "")
{
depthreal = $4
holddepth = depthreal
}
else
{
depthreal = -9999
holddepth = -9999
}
}
}
END {
printf("%s, %9.6f, %9.6f, %5.1f\n", holdutctime, holddeclon, holddeclat, holddepth)
}