By default, GMT stores 2-D grids as COARDS-compliant netCDF files. COARDS (which stands for Cooperative Ocean/Atmosphere Research Data Service) is a convention used by many agencies distributing gridded data for ocean and atmosphere research. Sticking to this convention allows GMT to read gridded data provided by other institutes and other programs. Conversely, other general domain programs will be able to read grids created by GMT.
The netCDF grdfile in GMT has several attributes (See Table B.1) to describe the content. The routine that deals with netCDF grdfiles is sufficiently flexible so that grdfiles slightly deviating from the standards used by GMT can also be read.
|
By default, the first 2-dimensional variable in a netCDF file will by read as the variable and the coordinate axes and will be determined from the dimensions of the variable. GMT will recognise whether the (latitude) variable increases or decreases. Both forms of data storage are handled appropriately.
For more information on the use of COARDS-compliant netCDF files, and on how to load 3- or 4-dimensional grids, read Section 4.18.
GMT 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. See Section 4.17 for more information.