Super Quick Start
If you'd like to begin experimenting with IDL right away, before reading any more, try the following things:
Open the IDL Workbench
The IDL Workbench is a graphical interface and code development environment for IDL. To start the IDL Workbench:
The IDL Workbench is described in more detail in The IDL Workbench.
Display an Image
To quickly display an image using IDL:
IDL's image display and image processing facilities are described in more detail in Images.
Create a 2-D Plot
To further analyze the image displayed in the previous section, you might want to create a plot showing the values of selected pixels plotted against their positions in the image (a line profile). You can do this in two ways:
- Click the Line Profile button
in the iImage tool and draw a line interactively across the image. Three line profiles — one each for the red, blue, and green channels of the image, are displayed in an iPlot window. - Select a line in the image array numerically. To do this, we'll use the IDL variable
ROSE_JPGcreated automatically when we open therose.jpgfile in the previous section. (If you haven't already, go back and do that now.)
Use the Variables view in the IDL Workbench to inspect the ROSE_JPG variable, or type
at the IDL command prompt. This shows us that the ROSE_JPG variable is a [3, 227, 149] byte array consisting of red, green, and blue image planes, each of which is a 227 x 149 pixel array. To extract a single vector of data, we'll use IDL's array indexing syntax:
rose_slice = REFORM(ROSE_JPG[0,200,*])

This tells IDL to create a new variable named rose_slice that contains a vector consisting of the 149 elements found in column 200 of the red image plane (image plane 0, which is the first image plane in the array).
Finally, enter
at the IDL command prompt. The iPlot window displays the selected line profile.
Clearly, creating a line profile interactively using the iImage tool is quicker in this example, but numerically selecting a vector from within an array is more precise and can be accomplished without mouse interaction.
Tip
You can quickly modify the appearance of your plot using the iTools property sheet controls. Simply double-click on an item (the plot line, for example) to display the property sheet. Change the selected options and see the results immediately.
IDL provides many tools for creating, annotating, and modifying two-dimensional plots. See Line Plots for additional details.
Overlay an Image on a Map
If your data is associated with geographic coordinates, you can easily overlay your data on a map using any of several map projections available in IDL:
- Enter
imapat the IDL command prompt. The iMap window appears. - Select File → Open in the iMap window and browse to the
examples/datasubdirectory of your IDL installation. - Select the file
avhrr.pngand click Open. The iMap Register Image wizard appears, allowing you to specify how the pixels in the image map to geographic coordinates. - Click Next, then Finish in the Register Image wizard to accept the default values.

- On the Map tab, click Edit Projection and select Mollweide in the Projection field and click OK.
- Select Insert → Map → Countries (low res)
to overlay country boundaries.
See Maps for more on working with maps in IDL.
Create a Simple IDL Program
Creating and running a program in IDL can be as simple as this:
- Create a new IDL source file in the IDL Workbench by clicking the New IDL Source file toolbar button
. - Enter the following text in the editor window:
- Select File → Save and then click OK in the Save As dialog that appears, accepting the default filename and location. (This saves your code in a file named
helloworld.proin your default IDL project directory.) - Select Run → Run helloworld or press F8. Your routine is compiled and the string
Hello, World!is printed in the Console view.
Tip
You could also run your program by entering helloworld at the IDL command prompt, or from within another IDL program.
See Programming in IDL for more on creating programs in the IDL language.
Get Help
IDL provides several ways to get help, depending on what sort of assistance you require:
- To launch the IDL online help system, which contains both reference and user documentation for IDL, select Help Contents from the Help menu or type "
?" at theIDL>prompt. See Using IDL Help for more information. - In the Editor view of the IDL Workbench, hover the mouse pointer over name of a procedure or function. After a second, text describing the syntax of the routine appears. For example, if you type
a = sinin an editor window and hover the mouse pointer, you'll see something like this:

- Click on a routine name in the editor window. Press F1 (Windows/Macintosh) or Shift+F1 (Solaris/Linux). The full IDL help entry for the routine is displayed.
- Begin a new line in the editor and type the following:
This display (known as "hover help") shows you the syntax for the SIN routine. Note that IDL keyword values are always shown as "null" in the hover help display.
file = dialogWithout moving the cursor from the end of the word "dialog", press Ctrl+space. The following windows appear:
This display is known as "content assist." Use the arrow keys to select DIALOG_PICKFILE() from the left-hand list, noting that the syntax for the DIALOG_PICKFILE function is displayed. Press Enter and the function name is inserted into the editor window. Press Ctrl+space again to see the list of keywords for the routine, followed by functions whose values could be entered as arguments.
Note
Content assist is also available in the IDL Command Line view.

