Is GMT is the right tool for gridding onto a new projection for further processing?

I am trying to determine if GMT is the right tool for a simple task I am trying to accomplish. My end goal is not a plot, but rather a re-gridded xyz dataset in a new projection. Our raw data is Lat-Long-Z values (gravity or magnetic data) in a regular grid, ASCII. What we need is X-Y-Z values on a regular grid in a projected coordinate system (e.g. State Plane or UTM), ASCII. I know we would just be using a tiny subset of GMT, but when I look for open source gridding software, GMT seems to be the go-to package. When I tried to work through the modules involved, it seemed like GMT had some inherent assumptions/defaults that I couldn’t quite get past. I could easily project the input data to the desired coordinate system before input to GMT. I was expecting to read that data as “random spaced” values, and compute a grid at a desired regular x,y spacing and output it to ASCII.

Maybe someone can point me to an example script or how to use the appropriate modules. Or maybe we should be getting the source code and extracting subsets of appropriate modules to build our own tool, in which case what modules or subroutines should we be looking at? Or maybe there is another open source package we should be looking at?

Thanks in advance to any who have the time and inclination to respond.


You have a grid that you want to reproject? See grdproject, or gdal’s gdalwarp.

maybe also xyz2grd (and grd2xyz)