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

[netCDF #WAI-600439]: Query: How to write a char data to a NetCDF file

This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.


  • Subject: [netCDF #WAI-600439]: Query: How to write a char data to a NetCDF file
  • Date: Fri, 16 Jun 2006 02:50:23 -0600

Howdy Umakanth Ch!

It sounds like you are storing the data correctly. Confusingly, ncdump will 
show NC_BYTE as signed numbers, as it says in the users guide:

"It is possible to interpret byte data as either signed (-128 to 127) or 
unsigned (0 to 255). However, when reading byte data to be converted into other 
numeric types, it is interpreted as signed."

So ncdump is showing you negative numbers, but if you read them in as unsigned 
numbers in another program, it all should work out.

Please let me know if this didn't help...

Thanks!

Ed Hartnett

Ticket Details
===================
Ticket ID: WAI-600439
Department: Support netCDF
Priority: High
Status: Closed