OpenDX Intro 2: Data Structures

Author: R.S. Weigel
Date: 06/02/2005
Note: Prepared for 2005 NCAR Summer school.

Keywords and Acronyms:

Field: The primary OpenDX data structure. A valid field has at least three components including "data", "connections", and "positions". Other OpenDX data structures include lists, vectors, matrices, and strings.

Online References:
See http://lasp.colorado.edu/cism/CISM_DX


This section covers the most basic data structure in OpenDX, the "Field", which contains "components". A valid Field contains at minimum the components "data", "positions", and "connections". For each "element" in the data component, there is a corresponding "element" in the position and connections component. An element can be a scalar, vector, or matrix.

In this section the Construct module is used to create a field. From the top menu bar, select File, Open Program, type /usr/local/CISM_DX/Labs/2005_AFWA_ShortCourse/IntroToOpenDX/nets/*.net
in the Filter section, and double click the file OpenDXDataStructures.net.
(If you do not want to type this path, enter /*.net in the Filter section and use the mouse to find the directory)

You should see a set of green boxes on the VPE canvas. Double click on the green Construct module box. You will see user-defined options used to create a Field. The text placed in the boxes tell the Construct module to create a grid with intersection points at [0,0], [1,0], [2,0], [0,1], [1,1], [2,1]. Associated with these grid points are the (scalar) data elements 1.0, 2.0, 3.0, 4.0, 5.0, and 6.0, respectively. Select the "Description" or "Help on Syntax" buttons for more information.

Execute the network by typing CTRL-E (or Execute, Execute Once on the top VPE menu bar). A message window will pop up with the output of the Print module. (Ignore the line containing ERROR: ShowConnections: Missing data: Object must be specified. It occurs because the ShowConnections module does not yet have an input.)

Study the output in the message window. Notice that the positions component of the field is represented by words. For regular grids, OpenDX stores the grid positions in this form. This is done to conserve memory; OpenDX does not allocate memory for the grid points values until it is necessary (usually during the rendering of an image).

The connections component is also represented in a compact form. The connections component tells OpenDX how the grid points are connected. We will return to the connections component later in this exercise.

There is also a box component. This component is used by the Image module so it knows the spatial extent of the object represented by the Field. This box values are analogous to the values that represent the bounding box in the header of an encapsulated postscript file (.eps).

Next, render this Object by connecting the output tab of Construct to the input tab of ShowConnections and type CTRL-E. You should see a window with yellow lines that represent grid point connections. The ShowConnections module adds a component to the field on its input that describes how the connection lines should be rendered (e.g., color, transparency) and passes this to the Image module which uses this rendering information. Draw an axes in the image window by selecting (in the image menu bar) Options, AutoAxes, AutoAxes enabled, Frame On, Grid on, OK. Then type CTRL-E.

You can rotate the object by selecting (in the image window menu bar) Options, View Control, Mode=Rotate, and typing CTRL-E. Next hold down the left click button anywhere in the figure window and move the mouse. (You can restore the original view with CTRL-F and jump back to previous views with CTRL-Z.)

Test your knowledge:


Move on to the next exercise.