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 #37025 is a reply to message #37023] Thu, 20 November 2003 14:35 Go to previous messageGo to previous message
bc25 is currently offline  bc25
Messages: 1
Registered: November 2003
Junior Member
mwatson@met.fsu.edu (Mike W) wrote in message news:<eb94e153.0311201151.428e6819@posting.google.com>...
> I have a large set of data that apparently was created on a little
> endian platform. I am working on a big endian platform and cannot get
> the data to read in correctly. These 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:
>
> % READU: End of file encountered. Unit: 1, File: ndvi0006.d
> % Execution halted at: $MAIN$
>
> The data is not read correctly and is also very important when I do
> convert the data. I should get values in the array from -1 to 1. The
> negative values seem to be OK but the positive values are much too
> large. The data works fine when it was read on a little endian machine
> so that is why I assumed that this is the byte order of the data. Any
> help would be greatly appreciated.
>
> -Mike Watson
> -Florida State University

You may want to try:

brr=fltarr(1090,820)
openr,inunit,fname,/GET_LUN,/SWAP_IF_BIG_ENDIAN
readu,inunit,brr
FREE_LUN,inunit

This works for me on Mac, Unix and PC reading data written by a PC.
[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 17:17:19 PDT 2025

Total time taken to generate the page: 0.00390 seconds