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

Home » Public Forums » archive » Re: Reading non-standard variable sizes
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: Reading non-standard variable sizes [message #81397 is a reply to message #81393] Fri, 07 September 2012 14:23 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 9/7/12 2:44 PM, Brian J. Daniel wrote:
> I'm attempting to read values from a binary file with some strange variable formats. Specifically, I have a field of data that uses 9 bytes. No IDL data format has 9 bytes. I can do the following:
>
> data = bytarr(9)
> ReadU, lun, data
>
> And lun will be ready to read the next variable, but how do I convert the 9 byte variable into a single 8-byte double number?
>
> Unfortunately, I can't change the format of this data because its a standard. Thanks for your interest.
>
> -Brian
>

Check out the DOUBLE function. I think you want something like:

d = double(data, 0)

or

d = double(data, 1)

depending on which 8 bytes of the 9 bytes are used.

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
Research Mathematician
Tech-X Corporation
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: Off-kilter z-axis label in function graphics?
Next Topic: IDLdoc 3.5 released

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

Current Time: Sat Oct 11 10:13:29 PDT 2025

Total time taken to generate the page: 1.28390 seconds