DataTank

3D Slices - Importing Data

Description

There is a rectangular 3D array saved in a text file - m2.dat. The data is stored as a list of numbers, but laid out in column major format, as would typically be the case with fortran output. If you are exporting data from C you would typically save it in row major order so you need to transpose the array (one of the entries in the context menu). But if you are using C/C++ consider using DTSource to save the data directly as a binary data file.

The twist here is that the file has a header line that needs to be removed. The way this is handled here is that the "From File" module can embed a shell script that will be run on the file file before it is opened. In this case a perl script is used, but python can be used instead. You can test your script with the "Run Check" button and more information can be found in the help document.

The Reshape action will use the same stream of numbers, but access it as an array instead of a list. This array doesn't have a location in space, which is the role of the "3D Mesh" variable.

| Contact | ©2003 Visual Data Tools, Inc.