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

Home » Public Forums » archive » reading binary file with READ_BINARY
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
reading binary file with READ_BINARY [message #86190] Thu, 17 October 2013 05:00 Go to previous message
mishooax is currently offline  mishooax
Messages: 1
Registered: October 2013
Junior Member
Folks,

I am trying to read a binary file in IDL containing a simple 2D array of 360x180 values. For reference, the binary file can be found here:

http://transcom.project.asu.edu/download/transcom03/smoothma p.fix.2.bin

Here is what the readme for this .bin says:

The file 'smoothmap.fix.2.bin' contains a single real, binary
array dimensioned 360 x 180. The array contains the numbers 1
through 22, denoting each of the 22 basis functions in the
TransCom 3 experiment. This file was written on an SGI Origin
2000 hosting UNIX.

And my code:

GET_LUN, fstart
OPENR, fstart, FFilename

mask_data = READ_BINARY(fstart, DATA_DIMS=[360,180], DATA_TYPE=4) ; float data


Now mask_data contains only junk values:
print, mask_data[0:100] gives
-2.24089e-038 0.000000 0.000000 0.000000 ....

Why would that be?

Also, I've noticed the .bin file size is 259208 bytes, aka 8 bytes more than the space required to store a 360x180 float array. I've been looking at this for an hour now and I'm stumped. Played around with endian-ness settings but that did not help.

How can I read in this file correctly?

Thank you!
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Synchronizing xrange of cgZPlot with another plot
Next Topic: quirk End of file encountered before end of program

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

Current Time: Wed Oct 08 15:37:40 PDT 2025

Total time taken to generate the page: 0.00439 seconds