GMT & netCDF files

Raymond Venneker venn at geo.vu.nl
Wed Oct 27 08:04:16 EDT 1993


> 	Is anyone else out there using Generic Mapping Tools (GMT) to create
> high quality output from GRASS.  It runs from the command line and a number of
> variables can be adjusted for mapping as required.  It can be ftp'd from 
> kiawe.soest.hawaii.edu, get the tar file GMT.tar.Z form the pub/gmt directory.
> 	It appears to have a number of different projection capabilities that
> would prove useful to our organization.  Only problem is that it uses 
> netCDF formatted gridded data.  One can get a data set out of GRASS well
> enough via r.out.ascii, but in GMT it will only import tri-collumn (xyz) data,
> and not flat ascii grids.  
> 

You may try weej at geo.vu.nl (Jan Diederik van Wees, he's not on the
list). I know he uses both GRASS & GMT, and a bell rings somewhere in my
head he did some conversion -- but I'm not sure

> 	Has anyone already written a conversion utility to go from flat 
> ascii grid to a netCDF format?  

Note that NetCDF can handle multi-dimensional gridded data perfectly
well but has no compression mechanism (version 2.3), this makes it less
suitable for raster data

> 
> 	I was thinking of using this since other people in our group indicated
> that the MAPGEN documentation at charon.er.usgs.gov was outdated and a
> nightmare to sort through.  
> 
> 	Any comments on either of the above packages would be appreciated.
> 

What I know of GMT is from the manual -- not experience! It's a
(mainly Geographical) 2D/3D data plot program for PostScript
output. It handles grid/vector/point data and loads of
geographic projections.

NetCDF. An absolute cracker with great potential for GRASS, *especially*
w.r.t. site data! I'll try to keep this short:

	1. It's a C library for handling data i/o callable from FORTRAN
	as well. Originally for meteorological/geographical data
	storage. Ftp from unidata.ucar.edu /pub/netcdf or /pub/sdm.

	2. Datafiles are within limits OS and CPU independent.

	3. Datafiles are self describing, free form: Files can have a
	number of variables which can have a number of dimensions e.g.
	timeseries of a vertical cup anemometer array has two dimensions
	(time, heigth), borehole logs have one etc.  Dip and strike data
	of geological strata could be saved in one file as two variables
	at a number of locations.

	4. Variables can have attributes: e.g. a fillvalue,
	missing_data_value, unit_of_measurement, but also the
	icon/symbol for map output, colour, you name it.

	5. You rang for floating point? The data type (from char to
	double prec) is saved as an attribute for each variable.

	6. There are tools to convert to and from ascii as well as a
	nifty little library, udunits, for unit conversion (ftp site
	above). I've heard the latest Matlab version handles NetCDF
	files as well.

As I said, it has great potential but is not easy to incorporate/interface.
Frankly, I don't have a clear vision (yet) of how this could be achieved. 
I'm willing to discuss my programming experiences directly or if applicable
on grassp-list.

Raymond



More information about the grass-user mailing list