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

Home » Public Forums » archive » Re: help with reading unsigned 16-bit integers
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: help with reading unsigned 16-bit integers [message #57477 is a reply to message #57470] Sun, 09 December 2007 01:37 Go to previous message
dcleon@gmail.com is currently offline  dcleon@gmail.com
Messages: 12
Registered: November 2007
Junior Member
On Dec 9, 12:28 am, te...@atmsci.msrc.sunysb.edu wrote:
> 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:
>

Howard,
Try using ISHFT to create a mask that you will use to determine (by
using a bitwise AND) if/where given bits are set:
Taking your example for the 2-'cloud' bit:
> cloudmask = ISHFT(1,2)
> cloudy = FEATURE_CLASSIFICATION_FLAGS AND cloudmask
The resulting "CLOUDY" variable will be nonzero where the 2-'cloud'
bit is set.
combine with other bits as needed.
cheers
dave
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: how to increase dpi of an IPLOT?
Next Topic: Re: Subversion in IDL Workbench

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

Current Time: Sat Oct 11 22:09:34 PDT 2025

Total time taken to generate the page: 1.12253 seconds