Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

RE: Attributes as arrays why ?

Reimar wrote:

> Yes it's all correct but the difference to the  variables is 
> thats the reader of the data has no idea how long the vector is. If the 
> vector 
> is defined as a netCDF variable we have to look first at the belonging  
> dimension name and we are able to read it's length.
> This means the data type, length and dimension are described 
> with variables in the file. By a vector as attribute there is no rule given.

That's not true.  There are functions available to inquire about the data type 
and length of any attribute in the file.

Here is the interface you need:
int nc_inq_att        (int ncid, int varid, const char *name,
                       nc_type *xtypep, size_t *lenp);

So you can inquire about the type and size of the attribute using this function.

Mark Rivers
 


 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690