This page imported from: /afs/bu.edu/cwis/webuser/web/s/c/scv/documentation/tutorials/SciVis/datascribe.html
Introduction to Scientific Visualization Tools
Numerical Algorithms Group DataScribe Tutorial
DataScribe’s purpose in life is to help you get your data into a
format that Explorer can understand. It is a stand-alone program
which can also be used to create data converters for use outside
of Explorer.
It can produce data conversion modules that show up in
Explorer’s Librarian. These modules can convert user’s ascii or binary data
into and out of Explorer lattice data type. This can be used to
convert external data files into input data lattices, convert one
lattice type to another, or convert one file type to another. You
can run the script separately outside of Explorer.
DataScribe cannot handle geometry, pick or pyramid data.
Click here to see what an Explorer lattice file really looks like in ascii form.
It is sometimes necessary to write your own conversion script using a language with which
you are familiar, convert your data into
a new file, and use one of the standard explorer reader modules to
read your data in.
If you use DataScribe, you will never have to know the sticky details of writing
Explorer lattice files.
Remember to do setenv EXPLORERUSERHOME to your home directory or
some sub-directory of your home directory that you plan to
do your work in. File names of maps you create and DataScribe
modules get sent to directories relative to EXPLORERUSERHOME. If
it is not set, explorer will attempt to write your work into
/usr/explorer (not a good thing!).
This tutorial will focus on converting user files to Explorer lattice types.
Here are the basic steps to creating conversion modules with DataScribe:
- Use DataScribe to set up input and output templates to generate a conversion script.
- Configure the input template to recognize your file’s format and the output
template to produce an Explorer lattice type. - Hook up the appropriate parameters on the output port of the Input template to
the appropriate parameters on the input port of the Output template. - “Parse” script to see if it’s valid.
- Create a module interface (ie control panel)
- Save the module, so that it can appear Explorer like any other module.
Let’s do an example:
- Create a simple data file that looks like this:
5 5 6 4 3 4 6 4 5 4 5 4 3 4 6 4 3 3 4 5 4 3 5 5 6 5 5
- Type dscribe on the command line. You will get two windows, DataScribe and DataScribe Palette. DataScribe is where you will do all the work. The Palette is where you get the data types.
- Select Template… from the Template menu in the DataScribe menubar.
The DataScribe New Template Dialog will pop up. Enter a name for your input
template in the Name text field. Select the toggle button to the left of Input in the Direction category. Select Ascii in the Type category. Now hit OK. An input template should appear on the left hand side of the DataScribe window. Initially, there are no data types specified. - Select the current title “Template1” from the editable title bar. Enter a new name for your input template over it.
- Drag and drop a Vector onto the input template. You do this by selecting the colored
icons to the left of each data type on the palette, keeping the mousebutton down until
you are over the input template, then releasing. Do the same thing with a 2D Array.This is what your input template should now look like:
- The names for the data elements are editable also by selecting the name area to
the right of the data type. Enter the name “dimensions” for the vector data type.
This will be the name of the vector into which the first vector’s worth of data is
read from your file. - Select the Open/Close button to the right end of the Vector. This will pop down a
description of the vector’s size. You need to enter a size for the vector. The “N” is
an editable text area into which you can type a new value for the vector size. Enter
a “2”. - Now drop a 2D Array onto the input template. Enter the name “data_array” in the
name text area. Open it up. You will see a representation of the two axes. N1 and N2
represent the length of each axis. Since this information will be read into the
“dimensions” vector in order, dimensions[1] will be the x axis length and dimension[2]
will be the “y” axis length. Of course, we could have done this in some other order,
but this is the order we designed the original data file.Your input template should now look like this:
- Create an output template the same way. Only instead of Input for Direction,
select Output. And instead of Ascii for Type, select Explorer. - Drag and Drop a 2D Uniform Lattice onto the Output template. Enter a “” into
the nDataVar1 text area to the right of that data element. This means that. - Hook up the appropriate parameters on the output port of the Input template to
the appropriate parameters on the input port of the Output template. You can do this
on the templates in the main editing area, or in the overview area at the
bottom. This operation is very similar to hooking up inputs and outputs in the MapEditor. On the output
port of the InputTemplate, select “dimensions”. On the input port of the Output
template, select “dims1”. A blue pipe should appear connecting the template represenations
in the overview area. They will not be shown in the main area. Now connect “data_array”
on the InputTemplate to “data1” on the output template. - Select File–>Parse to verify that this is a valid conversion scheme. If you get
an error, then go back over the previous instructions and images to make sure you
did everything correctly. - Save the .mres and .scribe files. Select File->Save. Go to your explorer work directory,
the one you EXPLORERUSERHOME to.
.scribe – conversion script – “wiring”
.mres – script + control panel – “appearance”
Figuring out which variables can be wired can be a challenge,
since the visual cues are non-existant.
If the script has no parameters, a default control panel is
created for it.