Visualization in Paraview, Gocad etc.
When visualizing TERRA data, the most common problems are the size of the datasets and the spatial distribution:
- With a grid spacing of around 25 km, there are in total over 80 million grid points, which is on the upper limit of what typical visualization tools on standard hardware can handle. And if it is possible, then it is often too slow for an intuitive interaction.
- The data is split up into spatially incoherent pieces; every process computes 5 or 10 partitions that are distributed over one or two hemispheres. In order to view a horizontally contiguous part of the model, one has to load a great share of the data partitions, even if only a single layer is needed.
To address these issues, there is an export tool which loads all data partitions and can then export arbitrary layers and arbitrary diamonds in different file formats - Paraview, Gocad and xyz ASCII tables. Here it is: terra_export.pl.
Usage
./terra_export.pl c*.*.00
(The export process itself is interactive; once all the data is loaded, arbitrary parts can be exported successively.)
Grid Layout
A visualization of the diamonds, combined with coastlines, is given in this Paraview file: terra_diamonds_coastlines.vtp
Manual
This is the perldoc information (will be displayed when running the program without options and parameters):
NAME
terra_export.pl - An export program for TERRA output files
SYNOPSIS
terra_export.pl inputfiles ...
terra_export.pl -e
terra_export.pl -h
DESCRIPTION
terra_export.pl is an export program which can export TERRA simulations into several output formats for visualization:
- Paraview (binary *.vtk unstructured grid format)
- Gocad (TSolid *.ts format)
- xyz format (lon, lat, data values, separated by tabulator)
The program deduces the grid size from the number of input files and the header of the first input file. Thus, always the whole model has to be loaded. (If you are really just interested in a part of the dataset, specify the right number of empty files on the command line such that the total number of files is correct and that at least the first file contains a correct header.) The program generates the grid and connectivity and asks the user interactively for output options.
However, the program can also be run in a scripted mode. For this, the script is piped into STDIN. The script contains the same keypresses as in the interactive version. Comments (starting with the '#' sign) are ignored.
An example script can be requested by using the program with the parameter -h.
Scripts can also be recorded by piping STDOUT into a file. (All other output is written to STDERR.)
OPTIONS
-e print the example script and exit the program
-h show help (this page)
EXAMPLES
terra_export.pl c300.00*.01
run interactively
terra_export.pl c300.00*.01.gz
run interactively, read compressed input files; for this, zcat must be available
terra_export.pl -h
show help (this page)
terra_export.pl -e
show example script
terra_export.pl -e > examplescript.txt
save example script
terra_export.pl c300.00*.01 > script.txt
run interactively, record inputs to script.txt
terra_export.pl c300.00*.01 < script.txt
run non-interactively, controlled by script
terra_export.pl -e | terra_export.pl c300.00*.01
apply example script to dataset
terra_export.pl c300.0000.01 $(seq 1 31)
read only first partition of an MT64 simulation, replace rest of input files by dummy files (numbers from 1 to 31)
perl -pe '$.-1or$l=int($_/10+9);$.-$l||exit' c300.0016.03 > header.txt; terra_export.pl header.txt $(seq 1 15) c300.0016.03 $(seq 17 31)
create dummy header as first file; read only 17th partition of an MT64 simulation, replace rest of input files by dummy files
BUGS
The input syntax of the layers has still some bugs.
AUTHOR
Christoph Moder <
>
HISTORY
August 2011: first version released to http://earthmodels.org/
October 2011: new features: downsampling, variable horizontal size, scripting
This version: 2011-10-20