[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: BINARY FILES



mohamed_nur@my-deja.com wrote:
> 
> hello all,
> 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.
> 
>                         thanks for the assistance

At last count (at least on my newsreader) we have two replies (Todd
Clements' second post doesn't count :o) and five.... well I don't know
what to call them. That a SNR of 0.4. Oof.

I have used both Todd Clements' suggestion, then graduated to Liam's
tools. I now work (almost) exclusively in netCDF so I avoid:

a) the problem with needing to know the file format/dimensions/etc, 
b) the problems one encounters moving data files from big->little-endian
machines and 
c) having to use IDL for everything (netCDF has an API in multiple
languages and the list is growing).

If you have the ability to create the files and aren't worried about
portability, I would suggest Liam's binary tools. If portability is a
problem, then (for a bit more effort) I'd say go with netCDF.

If you're stuck with someone else's files, then you're in the schtook.
It was only recently I discovered that Fortran sequential binary files
aren't as portable as I thought - endian-ness notwithstanding (Those
damn record delimiters!)

paulv
-- 
Paul van Delst           Ph:  (301) 763-8000 x7274
CIMSS @ NOAA/NCEP        Fax: (301) 763-8545
Rm.202, 5200 Auth Rd.    Email: pvandelst@ncep.noaa.gov
Camp Springs MD 20746