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

Home » Public Forums » archive » Re: Byte Swapping
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: Byte Swapping [message #37023] Thu, 20 November 2003 16:20 Go to previous message
Richard French is currently offline  Richard French
Messages: 173
Registered: December 2000
Senior Member
On 11/20/03 3:27 PM, in article MPG.1a26d18d7232577998974f@news.frii.com,
"David Fanning" <david@dfanning.com> wrote:

> Mike W writes:
>
>> I am having trouble converting binary data from little endian to big
>> endian. Here are my commands:
>>
>> brr=fltarr(1090,820)
>> byteorder,brr,/swap_if_big_endian
>> openr,1,'ndvi0006.d'
>> readu,1,brr
>> close,1
>>
>> and I get this error message as well:
>>
>> % READU: End of file encountered. Unit: 1, File: ndvi0006.d
>> % Execution halted at: $MAIN$
>

In your example, you are swapping a zero-filled array BEFORE you actually
read the data. If you want to use byteorder, you have to do it AFTER you
read the data. Or, you can use the /swap_if_big_endian on the openr command,
as others have pointed out.
Dick French
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: PostScript output from iTools
Next Topic: Re: IDLWave Reference Card?

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

Current Time: Wed Oct 08 13:33:26 PDT 2025

Total time taken to generate the page: 0.00805 seconds