software/idl

IDL

IDL is the "interactive data language", a clunky old propriatary numerical analysis language still used by the astronomical community.

Language Design

IDL is "pass by reference", which means that arguments to functions are always variable pointers, not the actual value (the alternative is usually to pass by copy, where the value gets passed through to a new variable inside the function. One side effect of this is that return values are collected by passing a recieving variable name as an argument to functions.

Syntax

Procedures are called with a comma seperated list-like syntax where the first element is the procedure and the following elements are arguments.

The ! character as a prefix is used to designate system variables.

; is used for commenting.

. can be used to start executive commands, Indicate constant is floating point Start executive command

& separates multiple statements/expressions on a single line (like ; often does in other languages).

* can be used for pointer dereferencing, as well as for multiplication and a wild card in array slicing.

@ is used to include files, or execute a batch file.

? brings up the IDL GUI help interface when entered at the command line.

Instead of the ever-standard ! to execute system commands, use $. Also, an $ at the end of a line means continue to the next line, like \.

X Windows

When used remotely with X Windows, sometimes plots don't refresh correctly (eg, blacked out after another window has covered them). To correct this issue, add these lines to your ~/.Xdefaults:

!stuff to manage IDL under 24-bit Linux displays
idl.retain:2
idl.gr_visual: TrueColor

and then run xrdb -merge ~/.Xdefault. (This tip from http://star.pst.qub.ac.uk/help/idl.shtml)

Basic Constructors

BINDGEN, CINDGEN, DCINDGEN, DINDGEN, FINDGEN, L64INDGEN, LINDGEN, UINDGEN, UL64INDGEN, and ULINDGEN create arrays of increasing values, similar to range() in python; the prefix characters indicate the data type (B = byte, C = complex integer, etc).

The exponent notation 5.67e3 creates a floating point number, while 5.67d3 creates a double length float.