comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Reading HDF5 signed bytes gives strange results
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Reading HDF5 signed bytes gives strange results [message #49856] Tue, 22 August 2006 09:38 Go to previous message
Maarten[1] is currently offline  Maarten[1]
Messages: 176
Registered: November 2005
Senior Member
Hi,

When reading a signed byte from and HDF5 file I get all kinds of nasty
results. Of course, IDL doesn't know about signed bytes, but I expect
it to be nice to the bit-images, and read -127 (signed) as 129
(unsigned). However, none of that seems to happen with the routines I
use.

When reading with h5_parse(file, /read), I get the fields, with -127
(the fill value, in case you're wondering) replaced by 129, as expected
in 2-complement notation. All would be well, If the rest of my software
could use h5_parse. But I can't use it for various reasons.

When using h5f_open, h5d_open, h5d_read & friends, the value -127 is
repleaced by 0. The fill value (an attribute) is replaced by 0. And 0
is a perfectly valid data-value. When I then try to filter for fill
values, I throw out quite a few valid values.

How can I force the field to be read differently so that values < 0 end
up at values > 127, while not resorting to h5_parse?

Maarten
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: reduce the size of eps
Next Topic: Here you can read books free and buy all tickets

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 10:25:10 PDT 2025

Total time taken to generate the page: 0.31836 seconds