IDL Programmierung

Aus sichardt
Zur Navigation springenZur Suche springen

IDL (Interactive Data Language) is a commercial "programming language" that is used for example in astro- and plasma-physics. The current version is developed and sold by Exelisvis (http://www.exelisvis.com).

An alternative that should be widely compatible is the GNU Data Language GDL that can be used for free (http://gnudatalanguage.sourceforge.net/).

Installation etc.

GDL Installation

to build library: netcdf with fpic

cmake with -DPYTHON_MODULE=On

GDL and Python

/CECL Keyword

The /CECL keyword is currently (version 0.9.5) not supported by GDL. Anyway, the GDL documentation states that this keyword is only important to Windows users. So I just removed that keyword in function calls (calls to external functions) without experiencing any problems.

Programming

Concatenating Strings and other Datatypes

In IDL/GDL the string datatype can be used easily by setting variables the following way:

x = 'text'

In order to build up strings out of different phrases the '+' is used to concat them:

x = 'text'
y='another text'
print, x+y

will print out 'textanother text'.

The same can be done with other datatypes when they are converted to the string datatype by means of the STRING() function:

x = 'text'
y=4.0
print, x+STRING(y)

Anyway, the print-out format will not be what you expect:

text      4.00000

In order to get rid of the spaces, the STRTRIM() function can be used.


Troubleshooting

IDL runs fine but some standard procedures and functions are not found

Strangely, IDL might run fine but complain from time to time when some included functions are called. In my case this happened when I wanted to use the coyote libraries for plotting. The solution is to make sure that the IDL library directory is in your IDL path:

echo $IDL_PATH

If there is not something like /usr/share/itt/idl/idl6.4/lib in that path (version and distributor may be different) then add it. One option is to put

export IDL_PATH=/usr/share/itt/idl/idl6.4/lib:$IDL_PATH

at the end of your /home/username/.bashrc file.