How to Plot Data Using IDL
Barbara Anne am Ende
October 1, 1998
Introduction
The goals of these web pages are to teach how to:
-
Re-write, in IDL, Fortran programs which plotted
graphs using CA-DISSPLA calls. Use this technique if your programs
are short (~1-3 pages).
-
Use callable IDL to plot graphs from Fortran
programs. Use this technique if your code is longish (more than
2-3 pages) or if you have serious computations and/or you call library
functions that IDL doesn't contain.--Updated, October 20, 1998.
-
Use IDL Call External to call a Fortran
subroutine from an IDL program.--Added, November 3, 1998.
-
Produce VRML files of images or surfaces created
in IDL
These examples will not replace the on-line help or the manuals, but are
intended as guides for the type of work you might have. Another useful
manual is IDL Programming Techniques
by David W. Fanning.
What
is IDL?
IDL stands for Interactive Data Language,
and is available through Research Systems,
Inc. Research Systems describes IDL as a "complete
computing environment for the interactive analysis and visualization of
data. IDL integrates a powerful, array-oriented language with numerous
mathematical analysis and graphical display techniques."
Handy syntax to know before you
get started:
-
Comments are prefaced by a semi-colon, ;
-
The line continuation symbol is a dollar sign, $. Use
this at the end of the line to tell the compiler that more code follows
on the next line that belongs to the same statement.
-
IDL is case insenstive (as you might notice since the examples contained
herein may not be consistent)
-
Arrays begin with 0, not 1 (as in C, not Fortran)
-
A slash (/) before a keyword that modifies an IDL command sets the
value to 1. Generally, that is equivalent to turning on that keyword
feature.
"How To" Links
Be sure to glance at the re-write examples.
There are many "how to" examples show there as well.
How to Customize Graphs in IDL
How to Overlay a Contour Graph over a 2D Plot
How to Save to a Postscript File
How to Make Axis Titles Larger than Axis Values
How to Manipulate Arrays and Read Columns of Data
from Files
How to Position Graphs on a Postcript Page
How to Print
How to Start Up in IDL
How to Compile IDL code
How to Compile Callable IDL from Fortran
How to Use Batch Files
How to Understand the Difference Between System
Variable and Keywords
Which NIST machines can
you use?
You can use IDL on any of the cam.nist.gov machines (visit the SAVG
web pages). However, note that all the help in this section is
based on SGI machines. You can also use Sun machines, but the flags
in the Makefile will be different (to find them, look into the calltest
example found in /itl/apps/idl-5.1/idl_5.1/external. You'll also
want to look in the chapter "Using Callable IDL." It is located in
the External Development Guide (aka Advanced Development Guide,
v. 5.0).
Gaithersburg machines which are best to use:
-
visage (SGI)
-
lemon (SGI)
-
scivis (SGI)
-
wahoo (Sun)
-
linden (Sun)
Boulder machines which are best to use:
Issues with Arno:
Arno is a new machine and the rules are not in place as of this writing
(10-01-98). However, it appears that all programs used on arno should
be batch files. This means you cannot work
interactively on arno. Therefore, you should probably use one of
the other public machines. If you have extensive computations, send
them as a batch to arno. Have the output saved as a data file.
Plot the data using IDL on one of the public machines such as lime.