Re: [netcdfgroup] Attributes for dimension variables?

  • To: Choo Heng Kek <hengkek@xxxxxxxxxx>
  • Subject: Re: [netcdfgroup] Attributes for dimension variables?
  • From: Dave Allured - NOAA Affiliate <dave.allured@xxxxxxxx>
  • Date: Thu, 14 May 2015 15:03:05 -0600
Heng,

On Wed, May 13, 2015 at 3:29 AM, Choo Heng Kek <hengkek@xxxxxxxxxx> wrote:

> Dear colleagues
> Probably silly questions but...
>

All good questions.


> Is it possible to have metadata/attributes for Dimensions?
>

Not directly, in the Netcdf data model.

We are creating netcdf files and wish to describe the sometimes cryptic'ly
> named Dimension variables somewhere in the netcdf file itself (since it's
> supposed to be self-describing).  We could put it in the Global Attributes
> section but that may be too "far away" from where the Dimension variables
> are located in the ncdump output.
>

I know what you mean my "too far away", but global attributes might be the
best choice for such documentation.  I suggest that you use a separate
character attribute for each dimension that you need to describe.

Here are some alternatives.  I prefer #1 and #3:

1.  Make up dimension names that are less cryptic and more relevant.  One
example that I have used is "min_max" for a fixed dimension of size 2,
where x(:,:,0) is minimum value statistics, and x(:,:,1) is maximum value
statistics at various time steps and levels.

2.  For any dimension that has an associated coordinate variable, you could
put the documenting attribute on that coordinate variable:

netcdf y {
dimensions:
...
        nn = 44;
variables:
...
        integer nn(nn) ;
                nn:dimension_meaning = "polynomial exponent number" ;

3.  For any dimension that has an associated coordinate variable, a
conventional descriptive attribute for the coordinate variable will
probably be most appropriate.  The distinction between the dimension and
the coordinate variable is merged.  For example:

                level:long_name = "isobaric pressure level"

Also, is it bad practice to type long-winded descriptions in Attributes as
> in the example below?
>

No, this is good practice in my opinion.  Especially good for all those
natural Latin speakers out there.   ;-)


> """
> netcdf y {
> dimensions:
>         latitude = 157 ;
>         longitude = 288 ;
>         time = UNLIMITED ; // (61 currently)
>         nn = 44; // Any way to provide more description of this dimension?
> variables:
>
> ...
>         float DIRSW_surface(time, latitude, longitude) ;
>                 DIRSW_surface:_FillValue = 9.999e+20f ;
>                 DIRSW_surface:short_name = "DIRSW_surface" ;
>                 DIRSW_surface:long_name = "Secondary Wave Direction" ;
>                 DIRSW_surface:units = "deg" ;
>                 DIRSW_surface:notes = "this is an example of a long
> attribute to explain in greater detail what this variable is about. Sit an
> nominavi eloquentiam. Ad decore signiferumque mea. Nostrud ocurreret
> salutatus id sit. Ferri assueverit no vim. Vix ea labore scribentur, pri
> integre nonumes eligendi in, id duo veniam honestatis. Eu eruditi delectus
> pri. Labores veritus blandit te mei. Id reque utroque euripidis pro.
> Moderatius argumentum in vix, cu cum mucius maluisset forensibus, enim
> audire utamur ius eu. Ei illud porro congue eum, ei nec errem putent
> atomorum. Ut ridens blandit eos, ne reque suavitate mel. Et duo consul
> essent persequeris. Ne wisi facilis vis, maiorum singulis vis an. At eum
> solum justo, verear dolores similique quo ut, graece aliquid cotidieque ad
> quo. Duo an facete voluptatum." ;
> }
> """
>

--Dave
  • 2015 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: