Next: B.2.2 Grid line and Up: B.2 2-D grdfiles Previous: B.2 2-D grdfiles Contents Index

##
B.2.1 File contents

The default 2-D binary netCDF grdfile in GMT has several attributes. The grdedit utility program will allow you to edit parts of the header of an existing grdfile. The attributes listed in Table B.1 are contained within the header record in the order given (except the -array which is not part of the header structure, but makes up the rest of the file).

Table B.1: GMT gridded file header record.
Parameter | Description
int nx | Number of nodes in the -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 -value of region
double x_max | Maximum -value of region
double y_min | Minimum -value of region
double y_max | Maximum -value of region
double z_min | Minimum -value in data set
double z_max | Maximum -value in data set
double x_inc | Node spacing in -dimension
double y_inc | Node spacing in -dimension
double z_scale_factor | Factor to multiply -values after read
double z_add_offset | Offset to add to scaled -values
char x_units[80] | Units of the -dimension
char y_units[80] | Units of the -dimension
char z_units[80] | Units of the -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
float z[nx*ny] | 1-D array with -values in scanline format

GMT version 3 also allows other formats to be read. In addition to the default netCDF format it can use binary floating points, short integers, bytes, and bits, as well as 8-bit Sun rasterfiles (colormap ignored). Additional formats may be used by supplying read/write functions and linking these with the GMT libraries. The source file gmt_customio.c has the information that programmers will need to augment GMT to read custom grdfiles. We anticipate that the number of pre-programmed formats will increase as enterprising users implement what they need.

Next: B.2.2 Grid line and Up: B.2 2-D grdfiles Previous: B.2 2-D grdfiles Contents Index