Re: [netcdf-java] Reading attributes with unsigned data types

John Caron wrote:
Gilbert, Allen D

Hello,

I am trying to use NetCDF Java 4.1 to read HDF5 files that contain datasets and attributes of type unsigned short. I am able to read the datasets correctly; when Array.isUnsigned() returns true, I widen each element to an int to retain the correct value. However, it seems that there is no way to determine whether or not an attribute value is unsigned once it is read, as the returned Array’s unsigned field does not get set to “true” for unsigned attribute values.

Is there a way to find out if an attribute value is unsigned in NetCDF Java?

Thanks for your time!

-Allen

Hi Gilbert:
I have a fix for this in the current CDM release (4.1.20100126.2307). The HDF5 IOSP now sets the Attribute Array unsigned flag. I have also added a convenience routine Attribute.isUnsigned(). Thanks for reporting this problem.



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