Re: How to associate attributes with fields in netCDF-4 compound types?

NOTE: The netcdf-hdf mailing list is no longer active. The list archives are made available for historical reasons.

Guys,

How about a function like this:

EXTERNL int
nc_def_compound_att(int ncid, nc_type compound_typeid, char *att_name,
                        nc_type att_base_typeid, nc_type
                        *att_typeidp);

This could construct a new compound type, suitable for use as such an
attribute. For example, after defining come compound type cmp_typeid,
you could create the type for a "units" attribute like this:

nc_def_compound_att(ncid, cmp_typeid, "units", NC_CHAR, units_att_typeid);

If you passed a base type of NC_NAT, the compound attribute type could
use the same type as each field in the compound type. So you could get
a _FillValue type like this:

nc_def_compound_att(ncid, cmp_typeid, "_FillValue", NC_NAT, fill_att_typeid);

This functions could serve both as a convenience to the user and a way
of ensuring that everyone handles the problem the same way.

Any thoughts?

Ed




-- 
Ed Hartnett  -- ed@xxxxxxxxxxxxxxxx

==============================================================================
To unsubscribe netcdf-hdf, visit:
http://www.unidata.ucar.edu/mailing-list-delete-form.html
==============================================================================


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