Re: Nio: x <-> y flipped in RUC grib file?

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Mon, 15 Oct 2007 11:18:49 -0600

Hi Daryl,

In PyNIO's representation of GRIB 1, when 2D coordinates are required
to locate the elements of the grid,
"gridy" refers to the fastest varying dimension of the grid. This is
somewhat counterintuitive and backwards from
the usual convention in the GRIB documentation. However, because this
is how the GRIB 1 reader was originally
coded and used for many years (in NCL before the existence of PyNIO),
it needs to be preserved in the
interest of backwards-compatibility.

We have changed this in the implementation of the GRIB 2 reader: the
fastest varying dimension is
referred to by "xgrid" in situations where an auxiliary 2d coordinate
variables is needed.

Note that whatever the name given to the grid dimensions the
auxiliary coordinate values relate correctly to the
to data value locations.

See http://www.pyngl.ucar.edu/NioFormats.shtml#GRIB for detailed
information about the naming schemes
used for the GRIB reader.
  -dave

On Oct 14, 2007, at 7:00 PM, Daryl Herzmann wrote:

> Greetings,
>
> Hopefully I am not missing something obvious again :( I am having
> a joyous evening playing with PyNGL, but have 1 doubt. I grabbed
> me this grib file:
>
> ftp://ftpprd.ncep.noaa.gov/pub/data/nccf/com/ruc/prod/ruc2a.
> 20071014/ruc2.t07z.grb2f01
>
> And when I asked pyngl about this file:
>
> g = Nio.open_file('ruc2.t07z.grb2f01.grb', 'r')
> v = g.variables["TMP_211_ISBL"]
> print v
> print v.shape
>
> I got:
>
> Dimensions and sizes: [lv_ISBL2 | 37] x [gridx_211 | 65] x
> [gridy_211 | 93]
> ...snip....
> (37, 65, 93)
>
> The v.shape makes sense to me, but I am curious about the other
> line where x and y appear to be flipped ?
>
> I betcha some ignorance of how grib grids are defined is shining
> thru on my behalf! I asked my friend, The Google, about this
> matter and got:
>
> http://www.nco.ncep.noaa.gov/pmb/docs/on388/tableb.html#GRID211
> http://www.unidata.ucar.edu/software/netcdf/NUWG/ruc.cdl
>
> which seem to indicate gridx_211 == 93
>
> thanks!
> daryl
>
> PS:
> Nio.__version__ == '1.2.0'
>
> _______________________________________________
> pyngl-talk mailing list
> pyngl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk

_______________________________________________
pyngl-talk mailing list
pyngl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
Received on Mon Oct 15 2007 - 11:18:49 MDT

This archive was generated by hypermail 2.2.0 : Thu Nov 01 2007 - 07:23:55 MDT