READU on IRX and Win95 [message #16344] |
Tue, 20 July 1999 00:00 |
Paul O Storaasli
Messages: 2 Registered: July 1999
|
Junior Member |
|
|
When I use READU on the same file in Win95 and IRIX, I get different
results.
Is this possible? How would I read the file on a Win95 system?
I am trying to read a binary file of 32-bit floats with the following
code:
function readfile
; This function will read the data in 'D:\data\thunderb.653'
; as an array of floating point (32-bit) numbers. It assumes
; the array has 716 colums, and calculates the number of rows.
; It returns the array.
file='thunderb.653'
openr,LUN,file,/Get_Lun
result=fstat(LUN)
nbytes=result.size
nx=716L
ny=nbytes / 4L /nx
image=fltarr(nx,ny)
readu,LUN,image
free_lun, LUN
return, image
end
The results I get are quite different:
On Win95
IDL> print,a(1:5,1:5)
-6.32813e-023-4.27821e+008-6.32846e-023-4.27903e+008 1.08637e+024
9.04917e-041-4.27821e+008 8.09951e-043 3.67981e-042 4.16997e-008
9.24857e-044-6.32813e-023-4.27838e+008-6.33169e-023-6.33524e -023
1.08622e+024 8.09951e-043 4.16942e-008-6.33718e-023-4.28427e+008
-4.27903e+008 3.67981e-042 1.44418e-041-4.28427e+008-6.34203e-023
% Program caused arithmetic error: Floating underflow
On an IRIX system:
IDL> print,a(1:5,1:5)
32.4000 32.2000 32.9000 34.7000 35.1000
31.5000 32.2000 32.5000 34.5000 38.3000
32.0000 32.4000 32.7000 37.9000 43.4000
33.1000 32.5000 36.8000 46.4000 50.7000
34.7000 34.5000 42.0000 50.7000 53.9000
|
|
|