[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: little and big endian -- once more
- To: Martin Schultz <mgs(at)io.harvard.edu>
- Subject: Re: little and big endian -- once more
- From: Liam Gumley <Liam.Gumley(at)ssec.wisc.edu>
- Date: Thu, 13 May 1999 10:15:23 -0500
- Newsgroups: comp.lang.idl-pvwave
- Organization: Space Science and Engineering Center, University of Wisconsin-Madison
- References: <3739C486.92A23A8A@io.harvard.edu> <MPG.email@example.com> <3739FB01.929CEFE2@io.harvard.edu>
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:14723
Martin Schultz wrote:
> So, I guess, I should give Liam's suggestion a try.
> Unfortunately, it seems that you must know what's in the file in order
> to test it, but that's probably a good idea anyway when you are dealing
> with binary files ;-)
Yeah, it's pretty hard to read a binary file if you don't know the
> Just for clarification: is it true that the
> endian matters for integers as well as floats?
Yes, it's true.
Here at SSEC we've messed with porting binary datafiles for years.
However in the last year or so, netCDF has become very widely used in
our applications. Some of the reasons are:
(1) No more byte-swapping worries, ever.
(2) The same IDL code can read the same datafile and give the same
results on any IDL platform (Unix, Linux, Windows, Mac).
(3) If you give someone the file and tell them it's netCDF, they can
then easily figure out what it contains. You don't need to tell them the
(4) The netCDF API is available for Fortran77/90, C, C++, IDL, Matlab,
perl, Python, and Java.
(5) The API is very simple and concise: the only things you can store in
a netCDF file are arrays, attributes, and dimensions. However, you can
create structures using these building blocks which are as simple or as
complex as you like.
(6) netCDF supports the following IDL datatypes: BYTE, STRING, INT,
LONG, FLOAT, DOUBLE.
More information is available at
Liam E. Gumley
Space Science and Engineering Center, UW-Madison