grd2xyz1
Converting a grdfile to an ascii or binary table
Usage
grd2xyz grdfile [ -H[nrec] ] [ -L ] [ -Rwest/east/south/north[r] [ -S[r ] [ -V ] [ -Z[flags] ] [ -bo[s] ]
Overview
grd2xyz reads a binary 2-D grdfile and writes out xyz-triplets in ASCII [or binary] format to standard output. Modify the precision of the ASCII output format by editing the D_FORMAT parameter in your .gmtdefaults file, or choose binary output using single or double precision storage. As an option you may output z-values without the (x,y) in a number of formats, see -Z below.
- grdfile
-
The 2-D binary file to be converted.
Options
-
-H -
Output 1 header record based on information in the grdfile header. Ignored if binary output is selected. [Default is no header].
-
-L -
Indicates that the x values are longitudes (necessary for
-:to work).
-
-R -
west, east, south, and north specify the Region of interest. To specify boundaries in degrees and minutes [and seconds], use the dd:mm[:ss] format. Append
rif lower left and upper right map coordinates are given instead of wesn.
-
-S -
Suppress output for nodes whose z-value equals NaN [Default outputs all nodes]. Append
rto reverse the suppression, i.e., only output the nodes whose z-value equals NaN.
-
-V -
Selects verbose mode, which will send progress reports to stderr [Default runs "silently"].
-
-Z -
Write a 1-column ASCII [or binary] table. Output will be organized according to the specified ordering convention contained in flags. If data should be written by rows, make flags start with T(op) if first row is y = ymax or B(ottom) if first row is y = ymin. Then, append L or R to indicate that first element should start at left or right end of row. Likewise for column formats: start with L or R to position first column, and then append T or B to position first element in a row. For gridline registered grids: If grid is periodic in x but the outcoming data should not contain the (redundant) column at x = xmax, append
x. For grid periodic in y, skip writing the redundant row at y = ymax by appendingy. If the byte-order needs to be swapped, appendw. Select one of several data types (all binary excepta):aASCII representation
csigned 1-byte character
uunsigned 1-byte character
hshort 2-byte integer
i4-byte integer
llong (4- or 8-byte) integer
f4-byte floating point single precision
d8-byte floating point double precisionDefault format is scanline orientation of ASCII numbers:
-ZTLa. Note that-Zonly applies to 1-column output.
-
-bo -
Selects binary output. Append
sfor single precision [Default is double]. This option only applies to xyz output; see-Zfor z table output.
Examples
To edit individual values in the 5' by 5' hawaii_grv.grd file, try
grd2xyz hawaii_grv.grd > hawaii_grv.xyz
To write a single precision binary file without the x,y positions from the file raw_data.grd file, using scanline orientation, try
grd2xyz raw_data.grd -ZTLf > hawaii_grv.b
Releases
2 releases since Debian 2.2 (Potato); the text changed 1 time.
-L since Debian 3.0 (Woody);
-V since Debian 3.0 (Woody).