|
Using IDL: Importing and Writing Data into Variables |
|
There are several ways to open files and access the data that they contain in IDL.You can open a file using interface elements, or using routines. In order of increasing complexity and flexibility, your options are:
Open from an iTool, and browse to select a file. This option automatically displays data (that is a supported type) in the iTool. See Importing and Exporting Data for details.
There are advantages and disadvantages for each option. When you open a file using File
Open in the iTools, there is no opportunity to do pre-processing on the data. However, the display is created for you, and there are numerous interactive operations available.
You can combine the flexibility of accessing data using routines with the power of an iTool display by launching the iTool from the command line as described in Parameter Data and the Command Line. See Accessing Image Data Programmatically and Accessing Non-Image Data Programmatically for examples.
When you access data from the command line or in an IDL program, you have the greatest control over data modification. The iTools incorporate the functionality of many of the common data processing and manipulation routines. However, if you need greater control over data modification, want to create a custom display or object class, or need to use functionality that is not exposed through and iTool, you can import, export, and/or create your data programmatically.
Regardless of the method selected, it is important to note that only the options involving iTools will automatically display data for you. In other instances, you will need to configure a display yourself.
IDL Online Help (March 06, 2007)