It would also help to store lists of commands that you find yourself repeating a lot. There are three kinds of command lists that you can use: Scripts. These are simple lists of commands that do not take any input. For example, you could copy all of the example commands from the preceding tutorials and paste them into a new text document, say, example. You can run that text document as a script, and all of the commands will execute in sequence.
|Published (Last):||14 April 2016|
|PDF File Size:||2.65 Mb|
|ePub File Size:||14.73 Mb|
|Price:||Free* [*Free Regsitration Required]|
When a window gets covered, then uncovered, someone has to keep a copy of the obscured part of the image. Introduction IDL Interactive Data Language is a general purpose scientific computing package which provides a suite of mathematical functions, data analysis tools, as well as some scientific visualization and animation tools.
There is an efficient command interpreter for interactive use, as well as the option of developing scripts which may be interpreted or compiled.
This tutorial is organized as a set of examples with explanations. This tutorial assumes that you are working in a directory named idl, that IDL programs are in a subdirectory named pro, and that data is in a subdirectory named dat. The examples used in this tutorial are available for download here Examples. The most effective way for you to go through this tutorial is by running IDL in a separate window, and trying out the commands and programs as you read the tutorial.
It should be kept in mind that this tutorial is only a glimpse at what you can do with IDL. This will tell you on what machines IDL is running, how to set up your environment, how to set your display, and where the documentation is. In this tutorial, we will be running IDL directly from the Unix prompt. IDL distinguishes between procedures such as print which do not return a value and do not have parentheses in their call syntax, and functions such as randomu which do use parentheses when called and always return a value.
To repeat a command, you can go up and down through previous commands using the arrow keys. When you reach the command you want to repeat, hit return. Type a question mark? We will see more of this below in the section on running modes. To exit IDL, type: There are some special characters which you should be aware of for execution management: Ctl-C Stops running runaway program if possible, without killing IDL Ctl-Z Suspends IDL in usual Unix manner Ctl- Stops aborts running program, may leave variables and files in uncertain state Ctl-D Stops IDL, like exit Programs and batch mode IDL can be run by typing commands interactively, by creating programs interactively, by reading programs in from the command line, or it can be run in batch mode.
When you type commands on the command line, each line is executed immediately when you hit the return key. Batch mode Running in batch mode is similar, except the commands come from a file.
You can write programs which can be stored and run multiple times, and you can write functions which may be called from programs and other functions. To create a program from the command line, use the executive command. The variables and procedures defined will then be available. The examples above make it look like batch mode and running programs is very similar. Consider the following simple computation of the factorial function.
The entire loop must essentially be on one line, since each line is executed as soon as it is encountered. Imagine nested loops with long calculations inside. For more information on creating and running programs, including other commands, see the IDL online help.
You can explicitly type variables, or not. See chapter 4 for information on type conversion, etc. The simplest thing to work with is scalars. Another way to think of it is that the way the data is stored, the first index varies fastest, and the second varies the slowest. This agrees with the way the data is printed. X Two examples of plots of a function of one variable. It then fits a cubic to the data, and plots the original data as points, and the fitted function as a curve. It separates them into two 1-dimensional arrays, and fits a cubic to it, and plots this as in the preceding example.
Surface plots IDL provides an interactive viewer for surface plots, called xsurface. There are two examples of producing surface plots from scattered data.
This is data in which the x,y locations for which we have the function evaluated do not lie on a regular gird. To make a surface plot, IDL needs to have the function evaluated on a regular rectangular grid. There are two steps involved. The first is to form a triangulation using the input x,y points to use for interpolation, and the second is to produce a mesh from that interpolation.
This is quite easy using IDL. You may or may not want to have all the images saved when they are obscured, by reasons of speed and memory. It can be done by IDL, done by the windowing system, or not done. By default, the X window system does not have backing store turned on.
IDL Tutorial 3 : Working with Images
Working with Colors in IDL Your display screen consists of about a million little areas called pixels. Your screen dimensions are x , so each pixel is very small. All colors seen by the human eye can be produced by a suitable mixture of intensities of only three colors, red, green, and blue RGB. The most general displays in use today allow intensities of each color. This gives rise to combinations - a big number. Instead, they can display only different combinations.