Displaying Contours

The iContour tool's primary purpose is to display contours, though the tool is capable of much more once the data is displayed. The iContour tool can display regular-grid data or irregular-grid data. Gridding is the creation of uniformly-spaced planar data from data points. These points may initially be irregular.

Displaying Regular-grid Data

Regular-grid data points are presented by two-dimensional arrays. The following example shows one way of importing and displaying this type of data into the iContour tool. The 248-by-248 two-dimensional array contained within the convec.dat binary file in the examples/data directory is imported into IDL with the READ_BINARY function. The iContour tool then displays this data as contours.

At the IDL Command Line, enter:

file = FILEPATH('convec.dat', SUBDIRECTORY = ['examples', 'data']) 
data = READ_BINARY(file, DATA_DIMS = [248, 248]) 
iContour, data 
 

Figure 13-1: Earth Convection Contours in the iContour Tool

icontourRegularDisplay.gif

Note
The examples/data directory of your IDL 7.1 distribution contains a text file named index.txt. This file lists all data files available in the example directory and also lists their dimensions and values.

Note
For information on how to display contours using the Visualization Palette, see Contour Visualizations).

Displaying Irregular-grid Data

Irregular-grid data points are presented by three one-dimensional vectors, usually known as fields. The following example shows one way of importing and displaying this type of data into the iContour tool. The three fields contained within the irreg_grid1.txt ASCII file in the examples/data directory is imported into IDL with the File → Open option in the iContour tool. This option uses the ASCII Template wizard to import the data, which is then gridded into contour data with the Gridding Wizard. The iContour tool then displays this data as contours.

  1. At the IDL Command Line, enter:
  2. ICONTOUR 
    
  3. Select File → Open from the pulldown menus of the empty iContour tool. The Open dialog will appear.
  4. Use the Open dialog to find and select the irreg_grid1.txt file in the example/data directory. The ASCII Template wizard will appear.
  5. The irreg_grid1 file contains three columns of data points. These columns represent the x-locations, y-locations, and the elevation (respectively) of this data. These columns are specified as three fields (vectors) of data with the ASCII Template wizard.

  6. Click Next on the first and second step of the wizard, then click Finish on the third (last) step of the wizard. The IDL iTools Create Visualization dialog will appear.
  7. Figure 13-2: The iTools Create Visualization Dialog

    createvisdialog.gif

    The IDL iTools Create Visualization dialog contains the following choices:

    • Launch the gridding wizard
    • Select a visualization and specify parameters
    • Do not create a visualization
  8. Select the Launch the gridding wizard radio button, then click OK. The IDL Gridding Wizard Step 1 of 3 dialog will appear.
  9. Figure 13-3: The IDL Gridding Wizard Step 1 of 3

    gridwiz1.gif

    The Gridding Wizard allows you to specify the method of gridding while showing you the possible results for that method. The IDL Gridding Wizard Step 1 of 3 dialog contains the following items:

    • Number of points entered
    • X Coordinates X coordinate range
    • Y Coordinates Y coordinate range
    • Data values — Data values are shown here
    • Spherical data checkbox — Check to make data spherical
    • Coordinate diagram — Shows coordinates of grid data
    • Show points checkbox — Select to show all points (default is checked)
    • Help — Obtain help on this dialog
    • Back — Return to previous step
    • Next — Proceed to Step 2 of 3
    • Cancel — Dismiss the Gridding Wizard
  10. In the Gridding Wizard Step 1, click Next to accept the interpolation of data values and locations. The IDL Gridding Wizard Step 2 of 3 dialog will appear.
  11. Figure 13-4: The IDL Gridding Wizard Step 2 of 3

    gridwiz2.gif

    The IDL Gridding Wizard Step 2 of 3 dialog contains the following items:

    • X Coordinates — modify dimension, start or end
    • Y Coordinates — modify dimension, start or end
    • Coordinate diagram — Shows coordinates of grid data
    • Show points checkbox — Select to show all points (default is checked)
    • Help — Obtain help on this dialog
    • Back — Return to previous step
    • Next — Proceed to Step 3 of 3
    • Cancel — Dismiss the Gridding Wizard
  12. At Step 2, click Next to accept the dimensions, start and spacing. The IDL Gridding Wizard Step 3 of 3 dialog will appear.
  13. Figure 13-5: The IDL Gridding Wizard Step 3 of 3

    gridwiz3.gif

    The IDL Gridding Wizard Step 3 of 3 dialog contains the following items:

    • Choose gridding method — Choose from pull-down list of methods
    • Preview — Click to preview selected method and data
    • Auto preview — Checkbox to turn auto preview on (default = off)
    • Statistics tab — Shows data statistics
    • Options tab — Set options for missing values, smoothing, weighting, and between axes
    • Search tab — Set options for using search ellipse
    • Coordinate diagram — Shows coordinates of grid data
    • Show points checkbox — Select to show all points (default = checked)
    • Help — Obtain help on this dialog
    • Back — Return to previous step
    • Finish — Dismiss the Gridding Wizard with data gridded
    • Cancel — Dismiss the Gridding Wizard
  14. At Step 3, select Inverse Distance as the gridding method and click Finish to display the surface.
  15. The resulting contours are displayed in the iContour tool.
  16. Figure 13-6: Irregular-grid Elevation Contours in the iContour Tool

    gridwiz4.gif

    Note
    For information on how to display contours using the Visualization Palette, see Contour Visualizations).