Handy IDL codes & examples

Updated: Jul 6, 2021

Text in purple is what you type into the command line.

Quickstart guide to using IDL

1. To start up the IDL environment, go to where your codes are and simply type: idl

2. Compile the program: .com

a. It is recommended to compile each program twice in a row, because sometimes on the first instance, not everything is compiled correctly.

3. Run the program: filename

a. if a procedure with variables to include: filename, variable1, variable2, keyword1=keyword1, /keyword2

a. if a function with variables to include: result = filename(variable1, variable2, keyword1=keyword1, /keyword2)

Check which version of an IDL program is being used

To print the location of the currently compiled version of a code:

Type: print, ROUTINE_FILEPATH("program_name", /EITHER)

To print all instances of a program (wildcards allowed)

Type: findpro, "program_name"

Check running processes

Just me: ps

All: ps -a or top

Kill a process (ex. atom)

Type: ps -ef | grep atom

Type: killall -9 atom or kill -9 XXX ← [process ID]