Spitzer Documentation & Tools
Downloading IRSCLEAN

The IRSCLEAN distribution can be downloaded as a .tgz (tar-gzip) file: irsclean2.1.1.tgz (TGZ, 6.13 MB).


Unpack using tar -xz or another appropriate software into a directory that is either in your IDL path, or in a directory that will be added to your IDL path (see below). The distribution will create its own directory (eg., IRSCLEAN2.1.1). For example, to unpack in /home/me/idl/IRSCLEAN2.1.1 (assuming the directory /home/me/idl exists):
unix% tar -xvzf irsclean2.1.1.tgz -C /home/me/idl/

Setting the IDL Path

For IDL to be able to automatically compile and run the IRSCLEAN distribution when the routines are called, either your current IDL working directory has to be the directory where IRSCLEAN resides, or the distribution must be in the IDL path. If IRSCLEAN is placed in a directory which is already in the IDL path, then make sure the path entry is set such that subdirectories are searched, via the "+" symbol.

To add the exact directory where IRSCLEAN resides to the IDL path, you have several options:

Outside of IDL, Unix-type Computers

Add the directory where IRSCLEAN resides to the $IDL_PATH environment variable in your Unix startup file.

For example (csh or tcsh):

setenv IDL_PATH ${IDL_PATH}:"+/home/me/idl/IRSCLEAN2.1.1"

The "+" at the beginning of the path means "search subdirectories".

Inside of IDL

Use the command PREF_SET in IDL.

Under Unix:

IDL> PREF_SET, 'IDL_PATH', ':+/home/me/idl/IRSCLEAN2.1.1', /COMMIT

Under Windows:

IDL> PREF_SET, 'IDL_PATH', ';+C:home/meidlIRSCLEAN2.1.1'

Note the use of the colon (";") as a path separator for Windows, and the separate call to PREF_COMMIT.

You can find out the current value of IDL_PATH by typing


All IDL Versions, all Operating Systems

Use the Preferences Dialog in IDLDE.

The IDL Workbench (was the IDL Development Environment) (command line: idlde) graphical user interface can be used to set permanent IDL preferences. Choose File->Preferences->PATHS and add an entry to the path similar to one of the strings above. Instead of the plus sign, a check box is used to search all subdirectories.

Mac OS X: Enabling Mouse Cursor Input

By default, "click_through" events are not enabled in Mac OS X. As a result, interaction between the mouse cursor and the IDL graphics window (the heart of the mask editing process) will not occur. To fix this, type the following in an X11 command line terminal:

In OS 10.4 (Tiger) and prior:

unix% defaults write com.apple.x11 wm_click_through -bool true

In OS 10.5 (Leopard) and later:

unix% defaults write org.x.x11 wm_click_through -bool true

Then close X11 and restart.

If for any reason you need to undo this, simply type

For Tiger users:

unix% defaults delete com.apple.x11 wm_click_through

For Leopard users:

unix% defaults write org.x.x11 wm_click_through -bool false

Then close X11 and restart. Your original default will be restored.

Emulate a three-button mouse

Another problem that Mac users may encounter is the single-button mouse. Fortunately, X11 for the Mac allows you to emulate a three-button mouse. Under X11 choose X11->Preferences->Input->Emulate three button mouse.


The simplest mode of running IRSCLEAN is to type irsclean_mask at the IDL command line without any inputs:

IDL> irsclean_mask

If no arguments are given, the program will walk you through the required steps. The bare-bones mask editing and data cleaning procedure consists of

Stage 1: Creating and Editing Masks
  1. reading in data (dataFile),
  2. reading a rogue mask if desired (inRmask_File),
  3. editing the mask (skip if /noMaskEdit is set),
  4. saving the result (outRmask_File, /autoSave),
  5. saving the cleaned version of dataFile (outClean_File, /autoSave).

Stage 2: Cleaning a Set of Data
(skip if /noStage2 is set)
  1. picking a set of .fits files to clean and/or one or more list (.txt) files (filesToClean),
  2. reviewing and editing the set of files to clean,
  3. cleaning the data (output files are saved automatically).

If any of the arguments in parentheses above is missing, you will be queried by the program.

Other options include finding rogue pixels automatically (getFmask), in which case the program does not by default ask for a rogue mask (you can still set the inRmask_File keyword; the program will read in a rogue mask and combine it with the FMASK).

For all filename arguments (dataFile, inRmask_File, outRmask_File, Bmask_File, orderMask_File, outClean_File, filesToClean), if you don't want to type out the file name but want to make sure that IRSCLEAN_MASK asks for a file (or set of files in the case of filesToClean), simply enter a null value for the filename and the program will ask you to browse your computer for the file(s). For parameter dataFile, enter the null string '. For keywords, use the syntax inRmask_File='. For example

IDL> irsclean_mask,',inRmask_File=',Bmask_File='