Binary (data format)

The following is by Dennis Shea (NCAR)

Binary files encountered in climate are generally created from compiled languages such as fortran or C/C++. These are easy to create and are supported by the compiled languages. Some software tools used in climate research (IDL, Matlab) can produce binary files but they are proprietary and are best read with the tools that produce them.  Binary files created by fortran/C/C++ require that the user know, a priori, the following:

  1. The structure or lay-out of the data;
  2. The data types [eg., integer, float, double] of all the variables;
  3. The "endian" type of the file being read (big endian or little endian);
  4. Whether the file is a 'flat' binary file or if it was written with, say, fortran a sequential write statement, in which case, there are hidden record separators.

Without this external collection of information, it is difficult to unambiguously ascertain a binary file's contents. As a result there are no generic file tools to deal with binary files.  This is one  reason why binary files are not in general use for archiving climate data.