help with reading unsigned 16-bit integers [message #57478] |
Sat, 08 December 2007 23:28 |
teich
Messages: 33 Registered: May 2007
|
Member |
|
|
Hi,
I am reading a HDF file and one of the SDS is an unsigned 16-bit
integer. According to documentation, the bits have certain meanings.
The bits go from 1 to 16. For example, bits 1-3 represent feature
type (0- invalid, 1-'clean air', 2-'cloud', ...). This is data from
NASA's Calipso Vertical Feature Mask (in case your wondering).
I have no idea what's going on when I read the SDS. For example, I
get the following ouput:
> HDF_SD_GETDATA,sds_id,Feature_Classification_Flags
> FEATURE_CLASSIFICATION_FLAGS UINT = Array[5515, 3744]
IDL> print,FEATURE_CLASSIFICATION_FLAGS(5500:5514,3743)
8221 8221 8221 8221 8221 16413 16413 16413
16413 16413 16413 16413
16413 16413 16413
Could anyone tell me what I am looking at here? Where are bits 1-3,
etc? Do I need to do some conversion? I tried some of the stuff at:
http://www.dfanning.com/tips/unsigned_integers.html,
but none of that seemed to get me anywhere.
Thanks,
Howard
|
|
|