⇐ ⇒

[CF-metadata] Confused about ordering of info in "coordinates" attribute

From: David Pierce <dpierce>
Date: Tue, 4 Nov 2008 16:31:13 -0800 (PST)

Hello,

I've gotten various requests over the years to have ncview handle 2-D
coordinate axes, and thought I'd get around to adding that. I figured the
"coordinates" attribute would be the one to parse for this information,
but am surprised by how it seems to be used. (Or, not understanding the
reasoning behind it.) For example, here is a snippet from the CF doc:

variables:
  float T(lev,yc,xc) ;
    T:long_name = "temperature" ;
    T:units = "K" ;
    T:coordinates = "lon lat" ;

As usual, the variable's dimensions are described in the ncdump order (or
C language order) of Z,Y,X. However, the entries in the "coordinates"
attribute are given in X,Y (fortran) order. Is there some reason why
information in "coordinates" is specified in a manner opposite to how the
variable is described?

What the code has to do is match up strings in "coordinates" to their
associated dimensions in the variable. I had thought this would be a
simple ordered matching, i.e., the first entry in the T(lev,yc,xc)
dimension list that requires mapping would be matched to the first entry
in "coordinates", and so on. But obviously that would reverse the axes
here. Is the information in the "coordinates" attribute guaranteed to be
in X,Y order?

Thanks for any info,

--Dave

-------------------------------------------------------------------
David W. Pierce
Division of Climate, Atmospheric Science, and Physical Oceanography
Scripps Institution of Oceanography
(858) 534-8276 (voice) / (858) 534-8561 (fax) dpierce at ucsd.edu
-------------------------------------------------------------------
Received on Tue Nov 04 2008 - 17:31:13 GMT

This archive was generated by hypermail 2.3.0 : Tue Sep 13 2022 - 23:02:40 BST

⇐ ⇒