You are here: IRS>Smart Web>MakingBitmaskFiles (10 Nov 2008, WikiGuest)

Making Bit Mask Files

During pipeline processing at SSC a number of "mask" files are typically used.
A full description of each type can be found at :

[[][ IRS Pipeline Masks]] (password required).

Two types of relevance here are "bmask" and "pmask" files. (SSC bmask document, SSC pmask document)
Generally only "pmask" files are supplied to Cornell. The SSC WWW site describes "pmask" files as :

"Pixel mask." 2-D. Masks semi-permanent bad pixel conditions.
For the current IRS pipeline, only two conditions are masked: "Warm" pixels are those immediately adjacent to permanently hot pixels; some bleeding into them is evident in lab data.
Bit # 9 is set for them. "Hot" pixels are saturated all the time, and are masked by setting bit # 14.
Typically, a hot pixel is surrounded by ~4 "warm" pixels. There are typically a handful of hot pixels in each IRS array.

(This description taken directly from the SSC WWW site, all relevant authorship is here acknowledged.)

Essensially in a "pmask" file there is one byte for each pixel in the array of the relevant detector.
Each byte contains a bit value between 0 and 2^15 (32768). The value designates the "status" of the corresponding array pixel.
The current bit designations are :

Bit # Condition

  • 0
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7 - Dark current too variable (dark calibration accuracy will be unacceptably low)
  • 8 - Response to light too variable (photometric accuracy will be unacceptably low)
  • 9 - Pixel response to light is too high (unacceptably fast saturation)
  • 10 - Pixel dark current is too excessive (pixel is hot)
  • 11
  • 12
  • 13
  • 14 - Pixel's response to light is too low (pixel is dead)
  • 15 - (reserved: sign bit)

SMART uses "bpm" files which are made at Cornell from "pmask" files.
A "bpm" file has one byte for each pixel in the array of the relevant detector.
This byte is set to (ASCII) "1" or "0". Within SMART :

  • "1" - good pixel
  • "0" - bad pixel

To make "bpm" files use the IDL program "". (This can be found in the "Calibration" or "smart-cal_tools" directory.)

IDL> bpm_convert, 'pmask_file_name'

This will produce an output file called "re-formatted_pmask_file_name".
Once generated re-name this file according to the SMART Calibration File naming convention.
Usually this output file is a FITS type file. A line will be added to the FITS header of the converted file :

'Converted to "1/0" SMART format on "time" "date"'

This re-formatted file will contain one byte for each byte in the input file.
This byte is set to (ASCII) "1" or "0" depending on the bit value in the input file.

Currently (post 10 Feb. 2004) bit values of 128 (2^7) and above are set to "0" (bad) all those lower are set to "1" (good).

Before running "" check with SSC that bit designations have not changed and with the SMART team about what bit value to choose for the "1/0" turnover point.

This site is powered by FoswikiCopyright © 2002-2018 by the IRS Team.
Send feedback. We use Foswiki.