Docs

IDL

 

Share via

IDL

This article explains how to:

  • use the IDL software on JASMIN
  • run these tools on the scientific analysis servers and LOTUS
  • make efficient use of the IDL licences

What is IDL?  

IDL  stands for Interactive Data Language. It is a licensed data manipulation toolkit made available on JASMIN.

Availability of IDL on JASMIN  

IDL is available on all scientific analysis servers and LOTUS.

To get started with IDL, login to one of scientific analysis servers and do as follows:

Check which versions are available:

module avail idl

-------------------------------------------- /apps/jasmin/modulefiles -----------------------------------------------
  idl/8.2   idl/8.5 (D)   idl/8.6   idl/8.9

  Where:
   D:  Default Module

The current default version is labelled with (D) and can be loaded using just module load idl. Alternatively, load a specific version by adding its version string to the command:

module load idl # or idl/8.5 to specify the version
idl
IDL Version 8.5 (linux x86_64 m64). (c) 2015, Exelis Visual Information Solutions, Inc., a subsidiary of Harris Corporation.
Installation number: 406672.
Licensed for use by: Science & Technology Facilitie

You can then type commands at the IDL prompt

print,1+4
  5
exit

For help on the idl module you can type the following :

module help idl
----------- Module Specific Help for 'idl/8.5' --------------------
         Adds IDL 8.5 to your environment variables,

Making efficient use of IDL development licences  

We have a large pool of run-time licences but a much more limited pool of development licences. In each case, these consist of floating licences shared between JASMIN sci machines and the LOTUS cluster.

Users are welcome to run multiple instances of IDL code, but for that purpose please make use of the run-time licences by compiling your code using a single development session and then running the pre-compiled code using the -rt flag. An example of this is shown in the next section (below).

Please try not to run more than one or two simultaneous IDL development sessions. However, for licence purposes, each unique combination of username, hostname, and $DISPLAY variable counts as a single session. So for example, if you run idl (development mode) in one window, then suspend it with CTRL-Z and start another development session in the same window, this still is only counted as one session by the licence server because the username, hostname, and DISPLAYareallidenticalbetweenthetwoprocesses.Butifyou"ssh"inontwodifferentwindows,probablytheDISPLAY are all identical between the two processes. But if you "ssh" in on two different windows, probably the ` DISPLAYwill differ between the two windows (e.g.localhost:10andlocalhost:11`), so if you start idl development sessions in each window they will require separate licences.

To see what licences you and others are using, you can use the following sequence of commands:

module add idl/8.5
lmstat -a

When interpreting the numbers, note that a single session is counted as 6 licences.

Using IDL on LOTUS (via the run-time Licences)  

IDL run-time licences are available for use on the LOTUS cluster. In order to specify use of the run-time licences please follow the instructions here. You need to compile your IDL code in order to run in run-time mode.

Example program  

The example program, “foo”, depends on some other functions.

======== foo.pro =======
    pro foo  
    print, doubleit(10) end 
========================
        


===== doubleit.pro ===== 
function doubleit, n   
return, two() * n 
end 
========================
        


======= two.pro ======== 
function two   
return, 2 
end 
========================

You must save a compiled version of the code in order to run it.

1. Compile the program:

Compiles top-level routine only

.compile foo
% Compiled module: FOO.

2. Use resolve_all to compile routines it depends on:

Recursively search for and compile modules called

resolve_all
% Compiled module: DOUBLEIT.
% Compiled module: TWO.

3. Save all compiled routines to a file:

save, /routines, file='foo.sav'

4. To run the program, using a run-time licence only:

idl -rt=foo.sav
IDL Version 8.5 (linux x86_64 m64). (c) 2015, Exelis Visual Information Solutions, Inc., a subsidiary of Harris Corporation.
Installation number: 406672.
Licensed for use by: Science & Technology Facilitie
  20

To see what routines are present in the save file:

.reset_session     <=== removes any existing compiled modules

help               <=== show compiled modules (and variables); there shouldn't be any
#% At $MAIN$
#Compiled Procedures:
#$MAIN$

#Compiled Functions:

restore,'foo.sav'   <=== load contents of save file

help
% At $MAIN$
Compiled Procedures:
$MAIN$  FOO                     <=== this was loaded from foo.sav

Compiled Functions:
DOUBLEIT    TWO            <=== so were these

Passing arguments  

You can also pass arguments in to your code as follows:

In your code, use function command_line_args, for example:

argsarray = command_line_args(count = nparams)

Call the code with -args flag:

idl -rt=foo.sav -args 10 20 30

command_line_args returns a string array, so convert type as required, e.g. n = fix(argsarray[0])

Further reading  

  • Vendor documentation: Using IDL  (although may be for a newer version than on JASMIN)
  • The related software MIDL is no longer available on JASMIN.
Follow us

Social media & development