Changeset 10247
- Timestamp:
- Nov 28, 2006, 3:26:24 PM (20 years ago)
- Location:
- trunk/psModules/src/camera
- Files:
-
- 2 edited
-
pmFPAMaskWeight.c (modified) (7 diffs)
-
pmFPAMaskWeight.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPAMaskWeight.c
r10245 r10247 188 188 } 189 189 190 bool pmReadoutSetWeight(pmReadout *readout )190 bool pmReadoutSetWeight(pmReadout *readout, bool poisson) 191 191 { 192 192 PS_ASSERT_PTR_NON_NULL(readout, false); … … 207 207 } 208 208 209 if ( gain > 0.0) {209 if (poisson) { 210 210 // Set weight image to the variance in ADU = f/g + rn^2 211 211 psImage *image = readout->image; // The image pixels … … 217 217 psScalarAlloc(1, PS_TYPE_F32)); 218 218 } else { 219 // Gain is negative or zero --- just use the read noise219 // Just use the read noise 220 220 if (!readout->weight) { 221 221 readout->weight = psImageAlloc(readout->image->numCols, readout->image->numRows, PS_TYPE_F32); … … 230 230 } 231 231 232 bool pmReadoutGenerateWeight(pmReadout *readout )232 bool pmReadoutGenerateWeight(pmReadout *readout, bool poisson) 233 233 { 234 234 PS_ASSERT_PTR_NON_NULL(readout, false); … … 273 273 } 274 274 275 return pmReadoutSetWeight(readout );276 } 277 278 bool pmReadoutGenerateMaskWeight(pmReadout *readout )275 return pmReadoutSetWeight(readout, poisson); 276 } 277 278 bool pmReadoutGenerateMaskWeight(pmReadout *readout, bool poisson) 279 279 { 280 280 PS_ASSERT_PTR_NON_NULL(readout, false); … … 283 283 284 284 success |= pmReadoutGenerateMask(readout); 285 success |= pmReadoutGenerateWeight(readout );285 success |= pmReadoutGenerateWeight(readout, poisson); 286 286 287 287 return success; 288 288 } 289 289 290 bool pmCellGenerateMaskWeight(pmCell *cell )290 bool pmCellGenerateMaskWeight(pmCell *cell, bool poisson) 291 291 { 292 292 PS_ASSERT_PTR_NON_NULL(cell, false); … … 296 296 for (int i = 0; i < readouts->n; i++) { 297 297 pmReadout *readout = readouts->data[i]; // The readout 298 pmReadoutGenerateMaskWeight(readout );298 pmReadoutGenerateMaskWeight(readout, poisson); 299 299 } 300 300 -
trunk/psModules/src/camera/pmFPAMaskWeight.h
r9594 r10247 8 8 /// @author Eugene Magnier, IfA 9 9 /// 10 /// @version $Revision: 1. 5$ $Name: not supported by cvs2svn $11 /// @date $Date: 2006-1 0-17 02:21:03$10 /// @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 11 /// @date $Date: 2006-11-29 01:26:14 $ 12 12 /// 13 13 /// Copyright 2005-2006 Institute for Astronomy, University of Hawaii … … 47 47 /// temporary --- it is not added to the HDU. This is intended for when the user is iterating using 48 48 /// pmReadoutReadNext, in which case the HDU can't be generated. 49 bool pmReadoutSetWeight(pmReadout *readout ///< Readout for which to set weight 49 bool pmReadoutSetWeight(pmReadout *readout, ///< Readout for which to set weight 50 bool poisson ///< Use poisson weights (in addition to read noise)? 50 51 ); 51 52 … … 62 63 /// (CELL.GAIN) and read noise (CELL.READNOISE). The weight map that is produced within the readout is 63 64 /// suitable for output (complete with HDU entry). This is intended for most operations. 64 bool pmReadoutGenerateWeight(pmReadout *readout ///< Readout for which to generate weight 65 bool pmReadoutGenerateWeight(pmReadout *readout, ///< Readout for which to generate weight 66 bool poisson ///< Use poisson weights (in addition to read noise)? 65 67 ); 66 68 … … 68 70 /// 69 71 /// Calls pmReadoutGenerateMask and pmReadoutGenerateWeight for the readout 70 bool pmReadoutGenerateMaskWeight(pmReadout *readout ///< Readout for which to generate mask and weights 72 bool pmReadoutGenerateMaskWeight(pmReadout *readout, ///< Readout for which to generate mask and weights 73 bool poisson ///< Use poisson weights (in addition to read noise)? 71 74 ); 72 75 … … 74 77 /// 75 78 /// Calls pmReadoutGenerateMaskWeight for each readout within the cell. 76 bool pmCellGenerateMaskWeight(pmCell *cell ///< Cell for which to generate mask and weights 79 bool pmCellGenerateMaskWeight(pmCell *cell, ///< Cell for which to generate mask and weights 80 bool poisson ///< Use poisson weights (in addition to read noise)? 77 81 ); 78 82
Note:
See TracChangeset
for help on using the changeset viewer.
