next up previous contents index
Next: B.3 Sun raster files Up: B.2 Grid files Previous: B.2.3 Boundary Conditions for   Contents   Index


B.2.4 Native binary grid files

The old style native grid file format that was common in earlier version of GMT is still supported, although the use of netCDF files is strongly recommended. The file starts with a header containing a number of attributes defining the content. The grdedit utility program will allow you to edit parts of the header of an existing grdfile. The attributes listed in Table B.2 are contained within the header record in the order given (except the $z$-array which is not part of the header structure, but makes up the rest of the file).


Table B.2: GMT gridded file header record. TYPE can be char, short, int, float, or double.
Parameter Description
int nx Number of nodes in the $x$-dimension
int ny Number of nodes in the y-dimension
int node_offset 0 for grid line registration, 1 for pixel registration
double x_min Minimum $x$-value of region
double x_max Maximum $x$-value of region
double y_min Minimum $y$-value of region
double y_max Maximum $y$-value of region
double z_min Minimum $z$-value in data set
double z_max Maximum $z$-value in data set
double x_inc Node spacing in $x$-dimension
double y_inc Node spacing in $y$-dimension
double z_scale_factor Factor to multiply $z$-values after read
double z_add_offset Offset to add to scaled $z$-values
char x_units[80] Units of the $x$-dimension
char y_units[80] Units of the $y$-dimension
char z_units[80] Units of the $z$-dimension
char title[80] Descriptive title of the data set
char command[320] Command line that produced the grdfile
char remark[160] Any additional comments
TYPE z[nx*ny] 1-D array with $z$-values in scanline format



next up previous contents index
Next: B.3 Sun raster files Up: B.2 Grid files Previous: B.2.3 Boundary Conditions for   Contents   Index
Paul Wessel 2006-01-01