XYZT to a 3D Surface

The next transformation is from a list of bathymetric depths and their locations, to a grid of averaged depths, spacially distributed over the surface and then on to a pretty picture. The trick is done by one of the GMT tools: nearneighbor, surface, or triangulate and then by grdview and grdcontour. But these tools require clean data that has been analyzed for its limits and preprocessed other GMT tools.

Cleaning the data

The raw data will likely have some values that have nothing to do with reality: "outliers." If you look at your data set with gnuplot, you will see them. If they are way out of range, they may make the data set look like it is misplaced or missing. In the sample data set which covers only about a half mile in reality, you can see that there are points many degrees of latitude and longitude away.

The fix is a band pass filter, one that removes the extremes. I use my own filter, the instructions follow. GMT has several filters, the most appropriate for this task is gmtselect.

My band pass filter rejects data outside of the minimum and maximum specified, or, if you wish, outside of a standard deviantion value.


	usage: BandPass -i <inputFile> -o <outputFile> [<options>]
  ( input and output files must be specified )
  options:
    -e | --errorFile <errorFile> for rejected records
    -X | --sigmaX <value>
    -Y | --sigmaY <value>
    -Z | --sigmaZ <value>
    -T | --sigmaT <value>
    --minX | --minLong <value>    
    --maxX | --maxLong <value>
    --minY | --minLat <value>
    --maxY | --maxLat <value>
    --minZ | --minDepth <value>
    --maxZ | --maxDepth <value>
    --minT | --minTime <value>
    --maxT | --maxTime <value>
    -v | --verbose
    -h | --help

	
Here is the program BandPass.PL

If we use the BandPass filter with the following arguments,

$ BandPass -minX -62 -maxX -61 -minY 12 -maxY 13.5 \
  -minZ 0.5 -maxZ 100 -minT 10000000000 -maxT 20000000000 \
  -i raw.xyzt -o all.xyzt
and hand editing out a few lines that showed up using Stats, the result looks like image to the right.

Using the Stats Perl program to look at the data before and after the bandpass filter, we see:
Samples 34584 Raw Data -- Before BandPass filter
34348 Data -- After BandPass filter
 XYZT
Min -61.24694
-61.24694
0.0000
12.99999
0.0000
0.6000
0.000
1140980691.000
Max 61.24350
-61.23604
13.0127
13.0127
109.7000
28.6000
1144340817.000
1144340817.000
Avg -60.84338
-61.24270
12.9241
13.0127
7.2197
28.6000
1134966473.770
1142415399.830

Continued


Perl Scripts

  • BandPass a general purpose filter for removing extremes in xyzt data tables
  • Stats a Perl tool for looking at the extrema of xyzt tables

Home
 Art
 Writing
 Boat
 Photos
 Videos
 Hydrography
   nmea2xyzt
   NMEAfields
   Datalogger
  Cleaning
   BandPass
  Analysis
  GridPlot
 Blog
 SAACalendar