Changeset 13591 for trunk/psModules/src/camera
- Timestamp:
- Jun 1, 2007, 5:51:03 PM (19 years ago)
- Location:
- trunk/psModules/src/camera
- Files:
-
- 2 edited
-
pmFPAMaskWeight.c (modified) (8 diffs)
-
pmFPAMaskWeight.h (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPAMaskWeight.c
r12696 r13591 93 93 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// 94 94 95 bool pmReadoutSetMask(pmReadout *readout )95 bool pmReadoutSetMask(pmReadout *readout, psMaskType satMask, psMaskType badMask) 96 96 { 97 97 PS_ASSERT_PTR_NON_NULL(readout, false); … … 131 131 for (int j = 0; j < image->numCols; j++) { 132 132 if (imageData[i][j] >= saturation) { 133 maskData[i][j] |= PM_MASK_SAT;133 maskData[i][j] |= satMask; 134 134 } 135 135 if (imageData[i][j] <= bad) { 136 maskData[i][j] |= PM_MASK_BAD;136 maskData[i][j] |= badMask; 137 137 } 138 138 } … … 145 145 // pixels. currently, it will set mask bits if (value <= BAD) or (value >= SATURATION) 146 146 // should we optionally ignore these tests? 147 bool pmReadoutGenerateMask(pmReadout *readout )147 bool pmReadoutGenerateMask(pmReadout *readout, psMaskType satMask, psMaskType badMask) 148 148 { 149 149 PS_ASSERT_PTR_NON_NULL(readout, false); … … 188 188 } 189 189 190 return pmReadoutSetMask(readout );190 return pmReadoutSetMask(readout, satMask, badMask); 191 191 } 192 192 … … 282 282 } 283 283 284 bool pmReadoutGenerateMaskWeight(pmReadout *readout, bool poisson)284 bool pmReadoutGenerateMaskWeight(pmReadout *readout, psMaskType satMask, psMaskType badMask, bool poisson) 285 285 { 286 286 PS_ASSERT_PTR_NON_NULL(readout, false); … … 288 288 bool success = true; // Was everything successful? 289 289 290 success &= pmReadoutGenerateMask(readout );290 success &= pmReadoutGenerateMask(readout, satMask, badMask); 291 291 success &= pmReadoutGenerateWeight(readout, poisson); 292 292 … … 294 294 } 295 295 296 bool pmCellGenerateMaskWeight(pmCell *cell, bool poisson)296 bool pmCellGenerateMaskWeight(pmCell *cell, psMaskType satMask, psMaskType badMask, bool poisson) 297 297 { 298 298 PS_ASSERT_PTR_NON_NULL(cell, false); … … 302 302 for (int i = 0; i < readouts->n; i++) { 303 303 pmReadout *readout = readouts->data[i]; // The readout 304 pmReadoutGenerateMaskWeight(readout, poisson );304 pmReadoutGenerateMaskWeight(readout, poisson, satMask, badMask); 305 305 } 306 306 -
trunk/psModules/src/camera/pmFPAMaskWeight.h
r12696 r13591 5 5 * @author Eugene Magnier, IfA 6 6 * 7 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $8 * @date $Date: 2007-0 3-30 21:12:56$7 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2007-06-02 03:51:03 $ 9 9 * Copyright 2005-2006 Institute for Astronomy, University of Hawaii 10 10 */ … … 16 16 /// @{ 17 17 18 #if 0 18 19 /// Pixel mask values 19 20 typedef enum { 20 PM_MASK_CLEAR = 0x00, ///< The pixel is not masked 21 PM_MASK_TRAP = 0x01, ///< The pixel is a charge trap. 22 PM_MASK_BADCOL = 0x02, ///< The pixel is a bad column. 23 PM_MASK_SAT = 0x04, ///< The pixel is saturated. 24 PM_MASK_BAD = 0x08, ///< The pixel is low 25 PM_MASK_FLAT = 0x10, ///< The pixel is non-positive in the flat-field. 26 PM_MASK_MARK = 0x20, ///< The pixel is marked as temporarily ignored 27 PM_MASK_EXT1 = 0x40, ///< This mask value is not used 28 PM_MASK_EXT2 = 0x80, ///< This mask value is not used 21 PM_MASK_CLEAR = 0x00, ///< The pixel is not masked 22 PM_MASK_BLANK = 0x01, ///< The pixel is blank or has no (valid) data 23 PM_MASK_FLAT = 0x02, ///< The pixel is non-positive in the flat-field 24 PM_MASK_DETECTOR = 0x02, ///< The detector pixel is bad (e.g., bad column, charge trap) 25 PM_MASK_SAT = 0x04, ///< The pixel is saturated in the image of interest 26 PM_MASK_BAD = 0x04, ///< The pixel is low in the image of interest 27 PM_MASK_RANGE = 0x04, ///< The pixel is out of range in the image of interest 28 PM_MASK_CR = 0x08, ///< The pixel is probably a CR 29 PM_MASK_SPARE1 = 0x10, ///< Spare mask value 30 PM_MASK_SPARE2 = 0x20, ///< Spare mask value 31 PM_MASK_SUSPECT = 0x40, ///< The pixel is suspected of being bad, but may not be 32 PM_MASK_MARK = 0x80, ///< The pixel is marked as temporarily ignored 29 33 } pmMaskValue; 30 34 #else 35 #define PM_MASK_MARK 0x80 ///< The pixel is marked as temporarily ignored 36 #define PM_MASK_SAT 0x04 ///< The pixel is saturated in the image of interest 37 #endif 31 38 32 39 /// Set a temporary readout mask using CELL.SATURATION and CELL.BAD … … 35 42 /// within the readout is temporary --- it is not added to the HDU. This is intended for when the user is 36 43 /// iterating using pmReadoutReadNext, in which case the HDU can't be generated. 37 bool pmReadoutSetMask(pmReadout *readout ///< Readout for which to set mask 38 ); 44 bool pmReadoutSetMask(pmReadout *readout, ///< Readout for which to set mask 45 psMaskType sat, ///< Mask value to give saturated pixels 46 psMaskType bad ///< Mask value to give bad (low) pixels 47 ); 39 48 40 49 … … 53 62 /// Identifies pixels that are saturated (>= CELL.SATURATION) or bad (<= CELL.BAD). The mask that is produced 54 63 /// is suitable for output (complete with HDU entry). This is intended for most operations. 55 bool pmReadoutGenerateMask(pmReadout *readout ///< Readout for which to generate mask 56 ); 64 bool pmReadoutGenerateMask(pmReadout *readout, ///< Readout for which to generate mask 65 psMaskType sat, ///< Mask value to give saturated pixels 66 psMaskType bad ///< Mask value to give bad (low) pixels 67 ); 57 68 58 69 /// Generate a weight map (suitable for output) using CELL.GAIN and CELL.READNOISE … … 69 80 /// Calls pmReadoutGenerateMask and pmReadoutGenerateWeight for the readout 70 81 bool pmReadoutGenerateMaskWeight(pmReadout *readout, ///< Readout for which to generate mask and weights 71 bool poisson ///< Use poisson weights (in addition to read noise)? 82 psMaskType sat, ///< Mask value to give saturated pixels 83 psMaskType bad, ///< Mask value to give bad (low) pixels 84 bool poisson ///< Use poisson weights (in addition to read noise)? 72 85 ); 73 86 … … 76 89 /// Calls pmReadoutGenerateMaskWeight for each readout within the cell. 77 90 bool pmCellGenerateMaskWeight(pmCell *cell, ///< Cell for which to generate mask and weights 78 bool poisson ///< Use poisson weights (in addition to read noise)? 91 psMaskType sat, ///< Mask value to give saturated pixels 92 psMaskType bad, ///< Mask value to give bad (low) pixels 93 bool poisson ///< Use poisson weights (in addition to read noise)? 79 94 ); 80 95 /// @}
Note:
See TracChangeset
for help on using the changeset viewer.
