
Masks and ppImage:

In most operations, ppImage uses masks to identify the good and bad
pixels in the science image being processed.  In some cases, the
ppImage analysis may operate explicitly on a mask.  For example, we
may want to generate a jpeg image of the masked pixels.  

There are three ways in which ppImage may set the masked pixels:

1) ppImage may directly load in the mask associated with a science
   image.  

2) ppImage may load a default ('standard') mask from the command line
   or the detrend database.  

3) ppImage may set masks for pixels based on their data values.

ppImage and psphot also use one special mask bit to identify pixels
currently being used or skipped for an analysis.  

Mask values used by ppImage:

** intrinsic mask values **
DARK     : the pixel has poor dark behavior : dark current is excessive or non-linear
FLAT     : the pixel has poor flat behavior : non-linear or excessive correction
BLANK    : pixel has no valid data (eg, outside of active detector region)
DETECTOR : unspecified bad detector response 

** extrinsic mask values **
LOW      : pixel is below minimum allowed value
SAT      : pixel is saturated, above max value
RANGE    : pixel is out-of-range in an unspecified way

CR       : pixel is part of a cosmic ray
GHOST    : pixel is part of a ghost

    PM_MASK_CLEAR    = 0x00,            ///< The pixel is not masked
    PM_MASK_BLANK    = 0x01,            ///< The pixel is blank or has no (valid) data
    PM_MASK_FLAT     = 0x02,            ///< The pixel is non-positive in the flat-field
    PM_MASK_DETECTOR = 0x02,            ///< The detector pixel is bad (e.g., bad column, charge trap)
    PM_MASK_SAT      = 0x04,            ///< The pixel is saturated in the image of interest
    PM_MASK_BAD      = 0x04,            ///< The pixel is low in the image of interest
    PM_MASK_RANGE    = 0x04,            ///< The pixel is out of range in the image of interest
    PM_MASK_CR       = 0x08,            ///< The pixel is probably a CR
    PM_MASK_SPARE1   = 0x10,            ///< Spare mask value
    PM_MASK_SPARE2   = 0x20,            ///< Spare mask value
    PM_MASK_SUSPECT  = 0x40,            ///< The pixel is suspected of being bad, but may not be
    PM_MASK_MARK     = 0x80,            ///< The pixel is marked as temporarily ignored
