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

Home » Public Forums » archive » 32bit signed integer problems
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
32bit signed integer problems [message #11460] Mon, 13 April 1998 00:00 Go to next message
Burkhard Prause is currently offline  Burkhard Prause
Messages: 6
Registered: February 1997
Junior Member
I try to read what I believe are 32 bit signed integer binary data
files.

They represent three dimensional data structures of 256 x 128 x 128
pixels. Each file therefore is 16777216 byte long. I read them into IDL
as follows:


> openr, 1, file
> array=lonarr(256,128,128)
> readu, 1, array

Array then turns out to contain sheer noise. If I read the data file
into a one dimesional vector, then extract 16 bit integers by reading
every third and fourth byte into a 256x128x128 integer array, I can
produce the "correct" image. So my data set is not garbage. However, by
doing this I basically limit my contrast, because all values larger than
2^16 are read as 65536.

Any suggestions what I may be doing wrong here?

--
************************************************************ ********************
BURKHARD A. PRAUSE
DEPARTMENT OF PHYSICS
UNIVERSITY OF NOTRE DAME
NOTRE DAME, IN 46556
bprause@campra.phys.nd.edu
(219) 631-4088
Fax: (219) 6315952
************************************************************ ********************
Re: 32bit signed integer problems [message #11719 is a reply to message #11460] Sun, 03 May 1998 00:00 Go to previous message
Burkhard Prause is currently offline  Burkhard Prause
Messages: 6
Registered: February 1997
Junior Member
William Connolley wrote:
>
> In article 38A5@campra.phys.nd.edu, Burkhard Prause <bprause@campra.phys.nd.edu> writes:
>> I try to read what I believe are 32 bit signed integer binary data
>> files.
>> Any suggestions what I may be doing wrong here?
>
> Were they produced on the same machine that you're reading them on?
> Ie do you have byteswap problems?
>
> -W.
>
> ---
> William M Connolley | wmc@bas.ac.uk | http://www.nbs.ac.uk/public/icd/wmc/
> Climate Modeller, British Antarctic Survey | Disclaimer: I speak for myself

I tried writing in BigEndian and little endian byteorder -same problem.
I'll try to use BYTEORDER, as suggested - maybe my source code byte
ordering did not do what I wanted it to.

Thanks,

Burke
--
************************************************************ ********************
BURKHARD A. PRAUSE
DEPARTMENT OF PHYSICS
UNIVERSITY OF NOTRE DAME
NOTRE DAME, IN 46556
bprause@campra.phys.nd.edu
(219) 631-4088
Fax: (219) 6315952
************************************************************ ********************
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Help : I cannot poly_fit to 9 degree!!!
Next Topic: System Variables: defining and using

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

Current Time: Wed Oct 08 13:49:02 PDT 2025

Total time taken to generate the page: 0.00469 seconds