Library next up previous contents
Next: Function and Comment Lines Up: The GRToolbox Previous: Standard Tools

Data Format

The second feature, that makes the GRToolbox usable for a wide area of problems, is the easy and most common data format: The graph modules read in data in ASCII code. Each point of the data set is stored in one line, the coordinates a separated by any whitespace or non-number symbol. The dimension of the points in the set is not fixed (in most cases point sets with 2 or 3 dimensions are used, but except for special tools no specific dimension is demanded).

It is possible to store more than one set in a single file. Different sets are devided by a non-number character (@ and # are not allowed as separators). see chapter: Functions and Comments) at the line beginning. Data must not follow the separator cause they will not be read as data. A simple legal data-format including two sets looks like the following:

0 0
0.5 0.25
1 1
2 4
&
0.3213,5.92
0, 3.323
.565, -.23

Almost every program used for computer graphics is able to write out this kind of format. If this format can not be written, the data can easily be extracted from a postscript file by editing the file. There are also a couple of routines that translate different formates to this simple format. For example, the GRToolbox supports the NetCDF-dataformat which is due to his portabilty used on many platforms for storing large data sets.

The graph tools are able to generate almost any ASCII data format needed by specifying several options, or in worst case by generating a new function (see chapter: Building Specific Modules).

When the sets have different dimensions, it might cause problems. The dimension is determined whenever reading the first line including point data. If a set has a higher dimension than the determined dimension, the dimension will be forced to the determined dimension. To force the tool to always use the higher dimensio use option -d.




next up previous contents
Next: Function and Comment Lines Up: The GRToolbox Previous: Standard Tools

Jens Trapp
Wed Jun 12 20:34:13 MET DST 1996