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

Home » Public Forums » archive » byteoder for float numbers conversion
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: byteoder for float numbers conversion [message #8136 is a reply to message #8071] Thu, 06 February 1997 00:00 Go to previous messageGo to previous message
Thomas A. McGlynn is currently offline  Thomas A. McGlynn
Messages: 23
Registered: March 1996
Junior Member
Peter Suetterlin wrote:
>
> In article <5d8mo8$n98@elaine44.stanford.edu>,
> yafeng@leland.Stanford.EDU (Meili Zhong) writes:
>
>> I want to convert the float numbers from UNIX format(big-edian)
>> to PC format(small-edian). For example, I have a float array
>> data(420)
>
> byteorder, data, /lswap
>
> Or have a look at the /XDR Keyword for opening files.
>
> Peter
>
> Peter "Pit" Suetterlin


I've had lots of problems with the byteorder routine. It's
been broken on a number of versions of IDL on Dec hardware
and some PC versions.

If you actually know that you just want to invert data of
a given type you can do things like:

float x[100];
qinvers = float(rotate(byte(x,0,4,100),5),0,100)

to invert bytes. You can look at the IDL astronomy library
rotines host_to_ieee and ieee_to_host at

http://idlastro.gsfc.nasa.gov/ftp/pro/misc

to see if any machines/IDL versions you're interested in have
errors in their byteorder implementations. There do
seem to be some problems indicated for linux and Windows
versions of IDL. These routines try to take care of these little
gotcha's in a generic way.

Good luck,


Tom McGlynn
tam@silk.gsfc.nasa.gov
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Calling C routines
Next Topic: Re: Constructing Color Tables in IDL

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

Current Time: Fri Oct 10 20:27:45 PDT 2025

Total time taken to generate the page: 1.20278 seconds