[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #ERT-660455]: Unable to retrieve an attribute from a variable using the netcdf C library



Hi Magali,

> Two variables in a netcdf file that I am parsing are described like this :
> 
> double lon_rho(eta_rho=288, xi_rho=263);
> :long_name = "longitude of RHO-points";
> :units = "degree_east";
> :_CoordinateAxisType = "Lon";
> double lat_rho(eta_rho=288, xi_rho=263);
> :long_name = "latitude of RHO-points";
> :units = "degree_north";
> :_CoordinateAxisType = "Lat";
> 
> 
> I'm trying to retrieve the value of the attribute "_CoordinateAxisType" of
> this variable, but it does not work.
> I'm using the 4.1 C version of the library.
> 
> Does the version 4.2 permits to do that ? Or is this not possible to do so
> using the C library, as I saw that it was recognized in the Java library ?

The "_CoordinateAxisType" variable attribute is not a real attribute
in the data file, it's a "virtual" or "synthesized" attribute that's
created by the Java software as it's reading and analyzing the
metadata.  The netCDF C software doesn't see the attribute and doesn't
create it from the metadata, even in version 4.2.

Is there a good reason you need this attribute?  If you are reading the
data and metadata with software that follows the CF metadata
conventions, it will know that lon_rho and lat_rho are longitude and
latitude coordinates, because the units attributes are what CF expects
to specify those coordinate axes.

--Russ

Russ Rew                                         UCAR Unidata Program
address@hidden                      http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: ERT-660455
Department: Support netCDF
Priority: Normal
Status: Closed


NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.