Read2Da

DESCRIPTION

This module reads in 2D scalar or vector data from an ascii file in a simple format and outputs a 2D uniform lattice. The 2D ascii file format consists of:

nx, ny, veclen, x0, y0, dx, dy, data.

Here nx, x0 and dx are respectively the number of points, the origin and the grid spacing in the x direction (and similarly for the y direction). veclen is the number of data values at each location in the array. Finally, data is the array of values, ordered with the values at each location varying fastest, then x, then y. In this list, nx, ny and veclen are of type short, while the rest of the items are of type float.

The mapping between the file variables and the components of the output lattice is as follows (this can be seen by using DataScribe to view the structure of the module):

 nx -> dims[0];
 ny -> dims[1];
 

10 x0 -> bBox[0]; x0 + (nx-1)*dx -> bBox[1]; y0 -> bBox[2]; y0 + (ny-1)*dy -> bBox[3];

veclen -> nDataVar;

data -> values;

INPUTS

WIDGETS

Port: 2Dfile
Type: Text
Input filename. The name may be entered into the text type-in slot, or via the file browser (obtained using the File item on the menu bar).

Port: Script File
Type: Text

OUTPUTS

Port: Lattice
Type: Lattice
Constraints: 2-D.
float.
uniform.
Output data - 2D uniform float lattice.

PROBLEMS

SEE ALSO

Read3Db which uses a similar format to read in 3D scalar or vector data from binary files
[ Documentation Home ]
© The Numerical Algorithms Group Ltd, Oxford UK. 1996