next up previous

Many computational science projects involve large two dimensional arrays of floating point numbers. For arrays of small dimension, it is possible to examine the values in the arrays by simply inspecting an ascii file. However, for arrays of even modest size, other techniques are required. In this quickstart tutorial, we illustrate how one can create and interrogate a data set consisting of floating point numbers on a regular two dimensional grid. Although several software packages are available for this task, we have selected NCSA X Image because it is in the public domain and is well documented in the NCSA literature. The application NCSA X Image can be obtained via anonymous ftp from

The application X Image requires data sets in the Hierarchical Data Format (HDF files), so before beginning any visualization work involving X Image, check with your system administrator to be sure that the HDF library has been installed on your system. In addition to providing a quick start in the use of X Image, a second aim of this document is to illustrate some basic calls to the HDF library.

To begin to become acquainted with X Image and the HDF library, consider the example FORTRAN code listed below as Code 1. This code creates a two dimensional (rank 2) scientific data set (SDS). Having created a sample data set we will then describe how to use the X Image application to display and interrogate that data set.

Assuming the HDF library has been installed and your path is properly set, then to run program ex2_1 enter

Execute your code by typing

After successful execution a file named ex2_1.sds will be written to your current directory.

Having completed the construction of the scientific data set ex2_1.sds, the X Image application can be used to view and interrogate the data set. If X Image is installed and in your path, it can be invoked from an X-Window environment by entering

at the prompt. Figure 1 shows the choices available when X Image is initiated. Left clicking on Dataset will lead to a loading of a data set; Palette will open a palette manipulation tool; while Animate will ask for a list of files to display in succession.

Figure 1 Main dialog box for X Image

To continue the example, click the left mouse button on the Dataset button to activate the panel displayed in Figure 2. Select ex2_1.sds as the Current Filename and open it. This selection can be made either by typing the file name or by scrolling to and clicking on the file. In either case, then left click on the button labeled Open.

Figure 2 File Selection in X Image

Figure 3 X Image Viewing Options

Having opened the scientific data set ex2_1.sds, you will be able to choose one of the viewing options displayed in Figure 3 . The choice Display Cartesian provides a color xy-raster map representation of the scientific data set; Display Polar provides an r-theta raster map; Display Data Set gives a spread sheet of the floating point numbers in the data set; and Graph give access to both contour maps and xy plots along cross-sections. Experiment with each of these features.

To continue with a concrete example, left click on Display Cartesian. At this point you should see a raster map similar to Figure 4.

Figure 4 Initial Display of ex2_1.sds

When using X Image, it is typical that the initial display of the data set is unsatisfactory for purposes of scientific visualization. This initial display usually uses the default system color palette. So, depending on how your particular workstation has been set up, your initial display may differ from Figure 4.