Writing non-string variable attributes to netcdf files

From: Andrew Monaghan <monaghan_at_nyahnyahspammersnyahnyah>
Date: Thu Jan 20 2011 - 17:35:37 MST


I'm creating a netcdf file in which some of the variable attributes are
real numbers (as opposed to strings), but when they are written to the
netcdf output file with ncl, they have quotes around them. For example:

Lambert_Conformal:longitude_of_central_meridian = "297." ;

But what I want is (no quotes around 297):

Lambert_Conformal:longitude_of_central_meridian = 297. ;

I assume that most software can probably distinguish whether an
attribute should be a real or a string value based on the attribute
name, as long as its a standard cf-compliant attribute name. Therefore,
having quotes around a real numbered attribute likely isn't an issue
when reading the netcdf file into another piece of software. However,
this isn't the case when reading netcdf files into ArcGIS -- it appears
that ArcGIS requires that real-numbered attribute values not have
quotes; otherwise any attribute with quotes is assumed to be a string
and the data arrays are subsequently geo-located in the wrong place.

Is there any way, in ncl, to write out certain attributes in netcdf
files so that they do not have quotes around them?

Thanks in advance for any insight you can provide.

Andy Monaghan
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Thu Jan 20 17:35:43 2011

This archive was generated by hypermail 2.1.8 : Tue Jan 25 2011 - 14:22:15 MST