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

Home » Public Forums » archive » BINARY FILES
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: BINARY FILES [message #22046 is a reply to message #21979] Mon, 16 October 2000 00:00 Go to previous messageGo to previous message
Aaron Birenboim is currently offline  Aaron Birenboim
Messages: 24
Registered: October 2000
Junior Member
Todd Clements <mole6e23@hotmail.com> wrote:
: mohamed_nur@my-deja.com wrote:

:>I've been dealing with binary files and every case i had to know before
:>hand the dimensions of the array to setup an IDL variable of the said
:>dimesions and read the unformatted data into.
:>
:>But is it possible or is there a method (in IDL 5.2/5.3) to read it in
:>with no knowledge of the dimensions of the array.


: I always use the fstat routine, which gets a bunch of information about
: the file, but the only one I ever use is the size field:

: ;-----
: openr,lun,'file.dat',/get_lun
: stat = fstat( lun )

: array = fltarr( stat.size )

: readu,lun,array

: free_lun, lun

After that, you can resize the array to the desired dimensions.
I do that frequently.

I have even used a correlation algorithm to determine
widths of image data that is not necessarily aligned!
Hopefully, your problem is not that tricky.
--
Aaron Birenboim
Albuquerque, NM
aaron@ptree.abq.nm.us
http://www.swcp.com/~aaron
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: selecting radnom number from 2D array
Next Topic: LOADCT is not working

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

Current Time: Wed Oct 08 18:20:49 PDT 2025

Total time taken to generate the page: 0.00503 seconds