If desired, a dimension can have an associated variable called the coordinate variable. This is a vector which defines a piecewise-linear mapping from subscript to physical dimension.
Data in a continuous space with two or more dimensions can be either gridded or scattered. NAP's data-model (with continuous subscripts, coordinate variables, etc.) facilitates the processing of gridded data.
Let us consider the case of two dimensions i.e. matrices. Two-dimensional gridded data is aligned in rows and columns, whereas scattered data is not. The following examples are intended to illustrate the difference between scattered and gridded 2D data.
Note that the data are not aligned in rows and columns.
| • | |||||||||
| • | • | ||||||||
| • | |||||||||
| • | |||||||||
| • | |||||||||
| • | |||||||||
| • | |||||||||
The following example has the grid in black. The blue point is not on the grid and has non-integer subscript values (2.1, 1.6). The coordinate variables are latitude and longitude.
| column | 0 | 1 | 1.6 | 2 | 3 | 4 | ||
| longitude | 30°E | 40°E | 52°E | 60°E | 65°E | 75°E | ||
| row | latitude | |||||||
| 0 | 30°N | • | • | • | • | • | ||
| 1 | 25°N | • | • | • | • | • | ||
| 2 | 10°N | • | • | • | • | • | ||
| 2.1 | 8°N | • | ||||||
| 3 | 10°S | • | • | • | • | • | ||
The following example is similar to that above. However four grid points are missing. These are shown in red.
| column | 0 | 1 | 1.6 | 2 | 3 | 4 | ||
| longitude | 30°E | 40°E | 52°E | 60°E | 65°E | 75°E | ||
| row | latitude | |||||||
| 0 | 30°N | • | • | • | • | • | ||
| 1 | 25°N | • | • | • | • | • | ||
| 2 | 10°N | • | • | • | • | • | ||
| 2.1 | 8°N | • | ||||||
| 3 | 10°S | • | • | • | • | • | ||
The missing points are treated as if they did not exist, as shown in the following:
| column | 0 | 1 | 1.6 | 2 | 3 | 4 | ||
| longitude | 30°E | 40°E | 52°E | 60°E | 65°E | 75°E | ||
| row | latitude | |||||||
| 0 | 30°N | • | • | • | • | |||
| 1 | 25°N | • | • | • | • | • | ||
| 2 | 10°N | • | • | • | ||||
| 2.1 | 8°N | • | ||||||
| 3 | 10°S | • | • | • | • | |||
It would be possible to represent scattered data by a grid with many missing points. In the extreme, each scattered point would have its own row and its own column. There would be only one non-missing point in each row. There would be only one non-missing point in each column. Of course this would be very inefficient for a matrix of significant size.
NAP has no facilities for directly processing scattered data. However it is possible to define a grid from scattered data. This can be done by