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

Home » Public Forums » archive » Re: Read words coded on 3 bytes (24 bits) in IDL
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: Read words coded on 3 bytes (24 bits) in IDL [message #30680] Fri, 10 May 2002 10:52
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
cinthia.loial@infoterra-global.com (Cinthia) writes:

> Hi all,
>
>
> Any suggestion to read words coded on 3 bytes (24 bits) in IDL?

Yes. Read first as bytes, then convert to whatever you need.

bb3 = bytarr(3, NWORDS)
readu, unit, bb3

For example to convert to long, you would fill it into a 4-byte array,
then convert to long:

bb4 = bytarr(4, NWORDS)
bb4(0:2,*) = bb3
ll = long(bb4, 0, NWORDS)

Then at that stage you may need to do bit twizzling, depending on your
architecture, using the BYTEORDER procedure.

Good luck,
Craig


--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Previous Topic: Read words coded on 3 bytes (24 bits) in IDL
Next Topic: Can IDL build a standalong application

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

Current Time: Fri Oct 10 06:58:32 PDT 2025

Total time taken to generate the page: 1.24837 seconds