RHESSI FAQ - General IDL Tips


 

How do I check my IDL path?
How can I tell where IDL has found a routine it is using?
How can I display times in a human-readable format?
Is there a way to remind myself of the calling sequence for a routine?
What is the difference between an IDL procedure and a function?
Why do I run out of memory on my DEC Alpha computer so quickly?

Back to main RHESSI FAQ page

 


How do I check my IDL path?

Type pr_path from within an SSW IDL session. If SSW IDL isn't set up correctly and pr_path doesn't work, type print,!path in IDL.


How can I tell where IDL has found a routine it is using?

Type which,'routine_name' from within an SSW IDL session. For example, which,'hessi' returns e:\ssw\hessi\idl\widgets\hessi.pro on my machine, showing that the hessi.pro routine was found in the hessi/idl/widgets directory under my ssw tree. This is useful for determining whether IDL has found a rogue copy of a routine.


How can I display times in a human-readable format?

Internally, times are usually stored as double precision seconds from a reference time. To print a time in a year/month/day format, use the anytim function.

For example, to print the observation time interval from a RHESSI object:

IDL> obs_times = object_reference -> get(/obs_time_interval)

IDL> print, anytim(obs_times, /vms)

1-Sep-2000 00:35:24.000 1-Sep-2000 00:39:56.000

Or, even easier, use the ptim procedure:

IDL> ptim, obs_times


Is there a way to remind myself of the calling sequence for a routine?

Type chkarg,'routine_name', e.g. chkarg,'hessi', and you will get a list of all input arguments and keywords the program accepts. It also lets you know whether the routine is a procedure or a function.

This does not work for object method calls.


What is the difference between an IDL procedure and a function?

Both procedures and functions are called to perform a desired function. The difference is that a function always returns a value and can be used in expressions. An example of a procedure call is:

hessi,flare=8

An example of a function call is:

flares = hsi_read_flarelist()


Why do I run out of memory on my DEC Alpha computer so quickly?

By default, on DEC Alpha computers the amount of memory accessible by a single IDL session is limited to ~128MB, even if the machine has much more than that in physical memory and/or swap space.  Increasing those limits is accomplished by entering the commands:

limit stacksize unlimited
limit datasize unlimited

at the shell prompt.  Typing limit alone displays the current limit settings for a number of resources.

Thanks to Theo Classen (Astrophysikalisches Institut Potsdam) for providing this information.


Last updated 16 January 2003 by Kim Tolbert , 301-286-3965