[Thread Prev][Thread Next][Index]

Re: Converting GMT files to the netCDF format



Hi Mark,
Once you've written a NetCDF file, you can always read it
and permute or flip the with, for instance, USE/ORDER=X-Y

For a description of this, go to this section in the Users Guide,
"NetCDF, permuted axes, /ORDER qualifier".  The syntax
must be used carefully.  ( I see we need more index entries
pointing to this information!)  Here's one relevant bit:

To indicate that the coordinates along a particular
axis are reversed  from the "right hand rule" ordering,
for example a Y axis which runs north to south (not
uncommon in image data), we would precede that axis
by a minus sign. For example

USE/ORDER=X-Y my_flipped_images.nc

Hope this is what you need!

Ansley Manke

Mark A Ohrenschall wrote:

Thanks, everyone, for your help -- it works!

However, I have one small detail to take care of. The y-axis of the grid
in the netCDF file is inverted, and I need to re-order the rows. I tried
repeating my steps but this time transposing the coordinates (24 and 31)
in the DEFINE AXIS/Y command, but that makes no difference.

What can I do to re-order the y-axis?

Thanks,

Mark

Mark A Ohrenschall wrote:

> yes? DEFINE AXIS/X=-98:-81/npoints=20401 xax
> yes? DEFINE AXIS/Y=24:31/npoints=8401 yax
> yes? LET my_grid = RESHAPE(depth, x[gx=xax]+y[gy=yax])

--
Ansley Manke  Pacific Marine Environmental Laboratory  Seattle WA  (206)526-6246
 


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement