RSF Comprehensive Description

From Madagascar
Revision as of 12:51, 6 April 2009 by Mt (Talk | contribs) (New page: RSF "files" actually consist of a header file and a data file. Normally one manipulates the header file. This file attempts to document the actual interface implemented in file.c ; it is...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

RSF "files" actually consist of a header file and a data file. Normally one manipulates the header file.

This file attempts to document the actual interface implemented in file.c ; it is not a formal specification, and in the event of a disagreement the code should be taken as the official reference.

This is presented to facilitate reading of file.c and development of new RSF utilities.

Corrections and improvements are welcome.

Data Files

Data files are rectangular arrays of data. The following data formats are supported

  • ASCII (C-compatible input)
  • XDR (device independent binary standard)
  • native binary (default)

ASCII format is most useful for debugging, while XDR format is useful for portability across formats.

Performance is optimized for native format.

The following data formats are supported:

  • unsigned byte
  • byte
  • int (native int)
  • short (2 bytes)
  • float (native float)
  • complex (real, imaginary float pairs)

Header Files

Associated with each such data file is a header file. The header file is 7 bit ASCII (UTF-7).

Lines with no "=" are considered comments and are ignored. Lines with more than one "=" are illegal.

Lines with a single "=", with no adjacent spaces, assign a value to an alphanumeric named variable

Textstrings must be delimited by pairs of quotes. Numerical values are subject to C's parsing rules.

"in=" parameter contains the fully qualified path to the relevant data and is required

"n#" (n1, n2, n3) etc. is the number of points in a dimension. n1 is the fastest direction (maps directly onto memory).

n1 must be specified. The size of the array is the product of all n# values with the size of the fundamental type

Conventions

In addition to the above, many filters enforce the following conventions:

"d#" is the physical spacing in the respective dimension

"o#" is the physical origin in some absolute coordinate system of the respectove dimension