next up previous contents index
Next: Grid line and Pixel Up: 2-D grdfiles Previous: 2-D grdfiles

   
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.


 
Table B.1: GMT gridded file header record
Parameter Description
char title[80] Descriptive title of the data set
char command[320] Command line that produced the grdfile
char remark[160] Any additional comments
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
int nx Number of nodes in the x-dimension
int ny Number of nodes in the y-dimension
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
int node_offset 0 for grid line registration, 1 for pixel registration
float z[nx*ny] z-values stored 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 up previous contents index
Next: Grid line and Pixel Up: 2-D grdfiles Previous: 2-D grdfiles
Paul Wessel
1999-07-01