Go backward to 4 Format Descriptions for Array Data
Go up to 4 Format Descriptions for Array Data
Go forward to 4.2 Handling Newlines
4.1 Array Descriptor Syntax
FreeForm ND allows you to describe the same fundamental FreeForm ND
data types in array notation. The arrays can have any number of
dimensions, any number of elements in each dimension, and either an
increasing or a decreasing sequencing in each dimension. Furthermore,
elements in any dimension may be separated from each other
(demultiplexed) and may even be placed in separate files. However,
every element of an array must be of the same type.
Array descriptors are a string of n dimension descriptions for arrays
of n dimensions. FreeForm ND accepts descriptions with the most
significant dimension first (i.e. row-major order for 2 dimensions,
plane-major order in 3 dimensions).
Individual dimension descriptions are enclosed in brackets. Each
dimension description can contain various keywords and values which
specify how the dimension is set up. Some of the specifications are
optional; if you do not specify them, they default to a specific
value.
NOTE: You must not mix array and tabular formats within the input and
output sections of the format definition file. Only one type of
notation can be used within each section of the format description
file, although the sections may use different forms. For example, a
file's input format could use array definitions, but the output
format might be entirely tabular.
The dimension description variables include:
- dimension name (REQUIRED)
-
A name for the dimension. This can be any ASCII string enclosed in
double-quotes ("). The name for each dimension must be unique
throughout the array descriptor.
This example specifies that a dimension named "latitude" exists:
["latitude" 0 to 180]
- starting and ending indices (REQUIRED)
-
A starting and ending index specifying a range for the dimension.
The starting and ending indices are specified as integers separated
by the word "to" following the dimension name. As long as both
numbers are integral, there are no other restrictions on their
values.
This example specifies that the dimension "temperature" has
indices ranging from -50 to +50:
["temperature" -50 to 50]
- granularity (optional)
-
A specification for the density of elements in the indices. The
number provided after the "by" keyword specifies how many index
positions are to be skipped to find the next element.
This example specifies that index values 0, 50, 100, 150 and 200 are
the only valid index values for the dimension "height":
["height" 0 to 200 by 50]
- grouping (optional)
-
A specification for splitting an array across "partitions" (files
or buffers in memory). The number provided after the "gb" or
"groupedby" keyword specifies how many elements of the dimension
are in each partition. If no value is specified, the default is 0
(no partitioning). Each partition must have the same number of
elements. Every more-significant dimension description (those to the
left) must also have a grouping specified- "dangling" grouping
specifications are not allowed. If a dimension is not partitioned,
but is required to have a grouping specification because a
less-significant dimension is partitioned, a grouping of M can be
specified, where:
M = | end_index - start_index | + 1
This example specifies that the dimension "latitude" is partitioned
into 9 chunks of 10 "bands" of latitude each:
["latitude" 1 to 90 gb 10]
- separation (optional)
-
A specification for "unused space" in the array. The number
provided after the "sb" or "separation" keyword specifies how
many bytes of data following each element in the dimension should
not be considered part of the array. An "element in the dimension"
is considered to be everything which occurs in one index of that
dimension. separation takes on a slightly different meaning if the
dimension also has a specified grouping. In dimensions with a
specified grouping, the separation occurs at the end of each
partition, not after every element.
This example specifies a 2-dimensional array with 4 bytes between
the elements in the "columns" and an additional 2 bytes at the end
of every row:
["lat" -90 to 90 sb 2]["lon" -180 to 179 sb 4]
Tom Sgouros and James Gallagher, 2006-02-12
