Changeset 13591
- Timestamp:
- Jun 1, 2007, 5:51:03 PM (19 years ago)
- Location:
- trunk/psModules/src
- Files:
-
- 2 added
- 9 edited
-
camera/pmFPAMaskWeight.c (modified) (8 diffs)
-
camera/pmFPAMaskWeight.h (modified) (6 diffs)
-
config/Makefile.am (modified) (2 diffs)
-
config/pmConfigMask.c (added)
-
config/pmConfigMask.h (added)
-
detrend/pmFlatField.c (modified) (2 diffs)
-
detrend/pmFlatField.h (modified) (2 diffs)
-
detrend/pmMaskBadPixels.c (modified) (2 diffs)
-
imcombine/pmReadoutCombine.c (modified) (2 diffs)
-
imcombine/pmReadoutCombine.h (modified) (2 diffs)
-
psmodules.h (modified) (1 diff)
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 /// @} -
trunk/psModules/src/config/Makefile.am
r11550 r13591 8 8 pmConfigCamera.c \ 9 9 pmConfigCommand.c \ 10 pmConfigMask.c \ 10 11 pmVersion.c \ 11 12 pmErrorCodes.c … … 16 17 pmConfigCamera.h \ 17 18 pmConfigCommand.h \ 19 pmConfigMask.h \ 18 20 pmVersion.h \ 19 21 pmErrorCodes.h -
trunk/psModules/src/detrend/pmFlatField.c
r12696 r13591 12 12 #include "pmFlatField.h" 13 13 14 bool pmFlatField(pmReadout *in, const pmReadout *flat )14 bool pmFlatField(pmReadout *in, const pmReadout *flat, psMaskType badFlat) 15 15 { 16 16 PS_ASSERT_PTR_NON_NULL(in, false); … … 79 79 if (flatValue <= 0.0 || (flatMask && flatMask->data.U8[j + yOffset][i + xOffset])) { \ 80 80 if (inMask) { \ 81 inMask->data. U8[j][i] |= PM_MASK_FLAT; \81 inMask->data.PS_TYPE_MASK_DATA[j][i] |= badFlat; \ 82 82 } \ 83 83 inImage->data.TYPE[j][i] = SPECIAL; \ -
trunk/psModules/src/detrend/pmFlatField.h
r12696 r13591 5 5 * @author Paul Price, IfA 6 6 * 7 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $8 * @date $Date: 2007-0 3-30 21:12:56$7 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2007-06-02 03:51:03 $ 9 9 * Copyright 2004-2006 Institute for Astronomy, University of Hawaii 10 10 */ … … 24 24 /// are masked, if there is a mask present in the input readout. 25 25 bool pmFlatField(pmReadout *in, ///< Readout with input image 26 const pmReadout *flat ///< Readout with flat image 26 const pmReadout *flat, ///< Readout with flat image 27 psMaskType badFlat ///< Mask value to give bad flat pixels 27 28 ); 28 29 /// @} -
trunk/psModules/src/detrend/pmMaskBadPixels.c
r12696 r13591 66 66 } 67 67 } 68 } else {69 // set raised pixels in exMask which are selected by maskVal70 for (int j = 0; j < inMask->numRows; j++) {71 int xJ = j - offRow;72 for (int i = 0; i < inMask->numCols; i++) {73 int xI = i - offCol;74 if (exVal[xJ][xI] == 0) {75 inVal[j][i] |= PM_MASK_BAD;76 }77 }78 }79 68 } 80 69 … … 82 71 psString timeString = psTimeToISO(time); // String with time 83 72 psFree(time); 84 psStringPrepend(&timeString, "Static mask applied at ");73 psStringPrepend(&timeString, "Static mask (selecting %x) applied at ", maskVal); 85 74 psMetadataAddStr(hdu->header, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, 86 75 timeString, ""); -
trunk/psModules/src/imcombine/pmReadoutCombine.c
r12696 r13591 29 29 params->combine = combine; 30 30 params->maskVal = 0; 31 params->blank = 0; 31 32 params->nKeep = 0; 32 33 params->fracHigh = 0.0; … … 335 336 336 337 if (numValid == 0) { 337 outputMask[yOut][xOut] = PM_MASK_FLAT;338 outputMask[yOut][xOut] = params->blank; 338 339 outputImage[yOut][xOut] = NAN; 339 340 continue; -
trunk/psModules/src/imcombine/pmReadoutCombine.h
r12696 r13591 1 1 /* @file pmReadoutCombine.h 2 2 * @brief Combine multiple readouts 3 * 3 * 4 4 * @author George Gusciora, MHPCC 5 5 * @author Paul Price, IfA 6 * 7 * @version $Revision: 1.1 1$ $Name: not supported by cvs2svn $8 * @date $Date: 2007-0 3-30 21:12:56$6 * 7 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2007-06-02 03:51:03 $ 9 9 * Copyright 2004-2006 Institute for Astronomy, University of Hawaii 10 10 */ … … 24 24 psStatsOptions combine; ///< Statistic to use when performing the combination 25 25 psMaskType maskVal; ///< Mask value 26 psMaskType blank; ///< Mask value to give blank (i.e., no data) pixels 26 27 int nKeep; ///< Mimimum number of pixels to keep 27 28 float fracHigh; ///< Fraction of high pixels to immediately throw -
trunk/psModules/src/psmodules.h
r13457 r13591 24 24 #include <pmConfigCamera.h> 25 25 #include <pmConfigCommand.h> 26 #include <pmConfigMask.h> 26 27 #include <pmVersion.h> 27 28
Note:
See TracChangeset
for help on using the changeset viewer.
