SSC Home Page

Supported Software: IRSCLEAN


SPITZER HOME - SPITZER SCIENCE - INSTRUMENTS - SCIENCE USER SUPPORT - SEARCH

Purpose and Description

IRSCLEAN is an interactive IDL tool for creating bad pixel masks from Spitzer IRS BCD (and pre-BCD) image data, and "cleaning" the masked pixels in a set of data. The interactive version of the program, IRSCLEAN_MASK, is an outgrowth of the non-interactive IRSCLEAN package developed by members of the SSC IRS instrument support team and the Cornell IRS Instrument team. IRSCLEAN_MASK takes care of file input/output and queries you when it needs information.

System Requirements

In order to run IRSCLEAN you need the following:

  1. IDL version 5.5 or later.
  2. The most up to date version of the IDL Astronomy User's Library, which can be downloaded from http://idlastro.gsfc.nasa.gov/
  3. A 3-button mouse, or its equivalent.

Installing IRSCLEAN

Downloading

The IRSCLEAN distribution can be downloaded as a .tgz (tar-gzip) file here.

Optional: Campaign Rogue Pixel Masks If you wish to examine or edit the campaign-based Rogue pixel masks, you must also download the .tgz file http://ssc.spitzer.caltech.edu/irs/roguepixels/all_campaigns_roguemasks.tgz.

Unpacking

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., IRSCLEAN1.9). For example, to unpack in /home/me/idl/IRSCLEAN1.9 (assuming the directory /home/me/idl exists):

$ tar -xvzf irsclean1.9.tgz -C /home/me/idl/

Optional: Campaign Rogue Pixel Masks If you downloaded the campaign rogue pixel mask .tgz file (see above), you should unpack it after unpacking irsclean. For IRSCLEAN_MASK to be able to automatically load the correct campaign based rogue masks, you should create a directory all_campaigns_roguemasks under the IRSCLEAN distribution, and untar the roguemasks distribution there. For example:

$ mkdir /home/me/idl/IRSCLEAN1.9/all_campaigns_roguemasks
$ tar -xvzf all_campaigns_roguemasks.tgz -C /home/me/idl/IRSCLEAN1.9/all_campaigns_roguemasks

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 three options:

  • IDL Version Less than 6.2, 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/IRSCLEAN1.9"
    

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

  • IDL Version 6.2 or Greater

    Use the command PREF_SET in IDL.

    Under Unix:

    	IDL> PREF_SET, 'IDL_PATH', '<IDL_DEFAULT>:+/home/me/idl/IRSCLEAN1.9', /COMMIT  
          

    Under Windows:

    	IDL> PREF_SET, 'IDL_PATH', '<IDL_DEFAULT>;+C:\home\me\idl\IRSCLEAN1.9'  
    	IDL> PREF_COMMIT  
          

    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

    IDL> PRINT, PREF_GET('IDL_PATH')
    
  • All IDL Versions, all Operating Systems

    Use the Preferences Dialog in IDLDE.

    The IDL Development Environment (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:

For Tiger users:

$ defaults write com.apple.x11 wm_click_through -bool true

For Leopard users:

$ 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:

$ defaults delete com.apple.x11 wm_click_through

For Leopard users:

$ defaults write org.x.x11 wm_click_through -bool false

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

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.

Running IRSCLEAN

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,
    4. saving the result (outRmask_File),
    5. saving the cleaned version of dataFile (outClean_File).
  • 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

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) and using the BMASK as a rogue pixel mask (Bmask_File). If /getFmask is set, the program does not ask for a rogue mask unless you set the inRmask_File keyword. In that case the program will read in a rogue mask and combine it with the FMASK, or you can cancel the dialogue and create a rogue mask from scratch using your mouse.

For all filename arguments (dataFile, inRmask_File, outRmask_File, Bmask_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=''

User's Guide

Detailed documentation can be found at the IRSCLEAN User's Guide


SPITZER HOME - SPITZER SCIENCE - INSTRUMENTS - SCIENCE USER SUPPORT - SEARCH

Contact us
This file was last modified on Wed Aug 13 16:27:16 2008.
California Institute of Technology Jet Propulsion Laboratory NASA