Discussion:
Dealing with an irregularly spaced netCDF grid...?
Jose Borrero
2014-05-25 05:43:00 UTC
Permalink
Hey All,

I have a netCDF grid that has latitudes at irregular intervals. So when I grid image it, i get the warning that it's using a constant step size. It makes a plot, but has the latitudes in the wrong place (see attached file, 40 south is not really below New Zealand!).

I tried grid2xyz thinking it would write out the exact (X,Y) values from the netCDF file (then re-grid), but those are written with constant spacing as well.

What can i do to deal with that within GMT? Am I missing something obvious?

Suppose I'd need to ncdump it to a formatted text file somehow, then re-grid in GMT. But not sure how to do that.

I can get the file to plot the right way in MATLAB, but I wanted to give the data the GMT 'look' that I love!

Thanks...

-jose




[cid:7BD3A846-5C9A-4E34-884A-***@telecom]





Mailing list for GMT discussions of all kinds. If you are not sure you have found a bug, discuss it here first.
To formally report bugs or request features, please register and add New Issue on gmt.soest.hawaii.edu
To unsubscribe, send the message "signoff gmt-help" to ***@lists.hawaii.edu
Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu instead.
Paul Wessel
2014-05-25 20:51:40 UTC
Permalink
Hi Jose,

Because GMT does not support variable grid spacing you will need to dump out x,y,z triplets and regrid your data onto an equidistant lattice. Depending on your region you could use surface or nearneighbor to do that, selecting as increment the smallest one you have in the original data.

Paul

Sent from my iPad
Post by Jose Borrero
Hey All,
I have a netCDF grid that has latitudes at irregular intervals. So when I grid image it, i get the warning that it's using a constant step size. It makes a plot, but has the latitudes in the wrong place (see attached file, 40 south is not really below New Zealand!).
I tried grid2xyz thinking it would write out the exact (X,Y) values from the netCDF file (then re-grid), but those are written with constant spacing as well.
What can i do to deal with that within GMT? Am I missing something obvious?
Suppose I'd need to ncdump it to a formatted text file somehow, then re-grid in GMT. But not sure how to do that.
I can get the file to plot the right way in MATLAB, but I wanted to give the data the GMT 'look' that I love!
Thanks...
-jose
<01_Central_Chile.png>
Mailing list for GMT discussions of all kinds. If you are not sure you have found a bug, discuss it here first.
To formally report bugs or request features, please register and add New Issue on gmt.soest.hawaii.edu
To unsubscribe, send the message "signoff gmt-help" to ***@lists.hawaii.edu
Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu instead.
Jose Borrero
2014-05-27 21:07:51 UTC
Permalink
Post by Paul Wessel
Because GMT does not support variable grid spacing you will need to dump out x,y,z triplets and regrid your data onto an equidistant lattice. Depending on your region you could use surface or nearneighbor to do that, selecting as increment the smallest one you have in the original data.
thx Paul,

I did it that way…

was the dumping out bit that I was hoping to accomplish in GMT, but i had to resort to MATLAB. Tried to figure it out with ncks but couldn't and i didn't feel like wrangling with AWK etc. as I had other fish to fry…

cheers!

-jose

Mailing list for GMT discussions of all kinds. If you are not sure you have found a bug, discuss it here first.
To formally report bugs or request features, please register and add New Issue on gmt.soest.hawaii.edu
To unsubscribe, send the message "signoff gmt-help" to ***@lists.hawaii.edu
Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu instead.
Loading...