Spitzer Documentation & Tools
IRSCLEAN Manual

9         Appendix 1: Hints

9.1       Automatic Command Line Suggestion

Every session of IRSCLEAN will result in a string being printed to the IDL terminal that gives the equivalent IDL command that you could have typed to get the same set of options non-interactively. You might find this helpful for subsequent runs where you want to vary some but not all parameters and don't want to have to type a long path or pick a file using the dialog again.  It is also useful to build a template command for inclusion in other IDL procedures.

9.2       Getting Help (/Help)

To get full documentation on the input and output parameters of IRSCLEAN, set the keyword /HELP:

 

IDL> irsclean_mask,/HELP

9.3       Setting the Working Directory (Directory)

The working directory for IRSCLEAN is the directory from which files are chosen and to which outputs are written (unless specified otherwise by a full path file name). By default, the starting working directory of IRSCLEAN is the current working directory. If you haven't done anything to change directories during your IDL session, this is the directory you started up IDL in. If you want to set the value explicitly, use the keyword Directory:

 

IDL> irsclean_mask,DIRECTORY='/home/me/idl/IRSCLEAN2.1/sampledata'

9.4       Changing the Default Size of the Displayed Image (WinSize)

The default image display size for Mask-Editing mode is 768 x 768 pixels. This seems to fit in most desktop and laptop screens and still allow for easy mouse editing. If you need to shrink the size of the image or would like to make it bigger, set the WinSize keyword to a two-element vector with the new size in x and y pixels. We recommend that you use the same numbers for both x and y, and stick to multiples of 128.

 

IDL> irsclean_mask,WinSize=[1024,1024]

9.5       Changing the Default Brightness Scaling of the Displayed Image (dataRange)

The default for image scaling in Mask-Editing mode is to display the inner 96% of pixel values.  In many cases this allows sufficient contrast to identify rogue pixels.  To change this from the command line, set the dataRange keyword.

 

IDL> irsclean_mask,dataRange=[0,100]

 

You can scale the image manually using the mouse.  To do this prior to Mask-Editing mode, set dataRange=[0,0] at the command line.  You can bring back the manual scaling widget from within Mask-Edit mode by typing ‘r’.  See Section 6.8.

9.6       Changing the Default Colors for the Rogue Mask and BMASK (colorNames)

Normally rogue pixels are highlighted red and BMASK pixels are highlighted blue, but these colors can be changed at the command line by setting the colorNames keyword to a 2-element string array listing the rogue and BMASK color names, respectively. Available color names can be found by typing

 

IDL> print,FSC_COLOR(/names)

 

Or to visually choose a color name, type

 

IDL> print,PICKCOLORNAME()

 

The result of typing the following command is shown in Figure 9.1.

 

IDL> irsclean_mask,  'sampledata/r13349376/ch3/bcd/SPITZER_S3_13349376_0012_0000_8_bcd.fits',getFmask=2, DataRange=[-22.7,52.36],/abs_val,colornames=['dark orchid','green']

 

Figure 9.1 Using different colors for rogue and bmask pixels (dark orchid for rogues and green for bmask pixels).

9.7       Adding NaN Pixels to the Rogue Mask (/NAN)

If you set the /NAN keyword in IRSCLEAN, you can include in the rogue mask pixels with their values set to “not a number,” or NaN. If other masks are input or derived, the NaN mask will be combined with them.

 

IDL> irsclean_mask,/NAN

 

NOTE: As of the S18.7 pipeline processing version, most NaN pixels are already fatally masked in the BMASK, so these pixels will not by default be allowed in the rogue mask unless you choose them deliberately during Mask-Edit Mode.  Furthermore, SPICE and the online pipeline automatically clean NaN pixels during spectral extraction, so it is no longer necessary to add NaN's to the rogue mask.

 

If you do choose to use IRSCLEAN to clean NaN pixels, make sure that pixels were actually cleaned properly, because cleaning removes the “fatal” flag from the bmask. Poorly-cleaned pixels will add noise to the extracted spectrum. In particular, watch out for clusters of NaN's on the edges of an order, which are very difficult to clean.  It is probably better to leave such pixels to SPICE.

9.8       Using the Cursor Value to Help Find Rogues by Eye

During Mask-Editing mode the cursor position, pixel value, and wavelength are printed to the screen. Sometimes the pixel value is useful for confirming suspected rogues found by eye. If all surrounding pixels have much lower values, it is likely that the pixel is a rogue. (Be careful, however, of mistaking spikes due to unresolved emission lines or faint marginally resolved point sources as rogues.)

9.9       A second pass at cleaning data using the unclean_mask file.

Not all pixels in your bad pixel mask are always successfully cleaned by IRSCLEAN. See the description of the “unclean” mask above.

 

It is possible that once the majority of rogue pixels have been cleaned, the unsuccessfully cleaned pixels will be easier to clean. The unclean mask can be used as an input bad pixel mask (inRmask_File) to a subsequent run of IRSCLEAN on the cleaned image.

 

IDL> irsclean_mask, 'sampledata/r13349376/ch3/bcd/SPITZER_S3_13349376_0012_0000_8_bcd_clean.fits',$

DataRange=[-24,54],$ inRmask_File='sampledata/r13349376/ch3/bcd/SPITZER_S3_13349376_0012_0000_8_bcd_unclean_mask.fits'

 

If after a second pass, a pixel still does not clean, it is likely that there is not enough information to clean the pixel properly.