Changeset 24483 for trunk/psModules/src/camera/pmFPAMaskWeight.c
- Timestamp:
- Jun 18, 2009, 10:39:29 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/camera/pmFPAMaskWeight.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPAMaskWeight.c
r24399 r24483 199 199 } 200 200 201 bool pmReadoutSetVariance(pmReadout *readout, bool poisson)201 bool pmReadoutSetVariance(pmReadout *readout, const psImage *noiseMap, bool poisson) 202 202 { 203 203 PS_ASSERT_PTR_NON_NULL(readout, false); 204 // check that the noiseMap (if it exists) matches the readout variance size) 204 205 205 206 pmCell *cell = readout->parent; // The parent cell … … 240 241 } 241 242 242 // XXX if readnoise is based on an image map, we need to apply it here 243 readout->variance = (psImage*)psBinaryOp(readout->variance, readout->variance, "+", 244 psScalarAlloc(readnoise*readnoise/gain/gain, PS_TYPE_F32)); 243 // apply a supplied readnoise map (NOTE: in DN, not electrons): 244 if (noiseMap) { 245 psImage *rdVar = (psImage*)psBinaryOp(NULL, (const psPtr) noiseMap, "*", (const psPtr) noiseMap); 246 readout->variance = (psImage*)psBinaryOp(readout->variance, readout->variance, "+", rdVar); 247 psFree (rdVar); 248 } else { 249 readout->variance = (psImage*)psBinaryOp(readout->variance, readout->variance, "+", psScalarAlloc(readnoise*readnoise/gain/gain, PS_TYPE_F32)); 250 } 245 251 246 252 return true; … … 249 255 // this function creates the variance pixels, or uses the existing variance pixels. it will set 250 256 // the noise pixel values only if the variance image is not supplied 251 bool pmReadoutGenerateVariance(pmReadout *readout, bool poisson)257 bool pmReadoutGenerateVariance(pmReadout *readout, const psImage *noiseMap, bool poisson) 252 258 { 253 259 PS_ASSERT_PTR_NON_NULL(readout, false); … … 293 299 readout->variance = variance; 294 300 295 return pmReadoutSetVariance(readout, poisson);296 } 297 298 bool pmReadoutGenerateMaskVariance(pmReadout *readout, psImageMaskType satMask, psImageMaskType badMask, bool poisson)301 return pmReadoutSetVariance(readout, noiseMap, poisson); 302 } 303 304 bool pmReadoutGenerateMaskVariance(pmReadout *readout, psImageMaskType satMask, psImageMaskType badMask, const psImage *noiseMap, bool poisson) 299 305 { 300 306 PS_ASSERT_PTR_NON_NULL(readout, false); … … 303 309 304 310 success &= pmReadoutGenerateMask(readout, satMask, badMask); 305 success &= pmReadoutGenerateVariance(readout, poisson);311 success &= pmReadoutGenerateVariance(readout, noiseMap, poisson); 306 312 307 313 return success; 308 314 } 309 315 310 bool pmCellGenerateMaskVariance(pmCell *cell, psImageMaskType satMask, psImageMaskType badMask, bool poisson)316 bool pmCellGenerateMaskVariance(pmCell *cell, psImageMaskType satMask, psImageMaskType badMask, const psImage *noiseMap, bool poisson) 311 317 { 312 318 PS_ASSERT_PTR_NON_NULL(cell, false); … … 316 322 for (int i = 0; i < readouts->n; i++) { 317 323 pmReadout *readout = readouts->data[i]; // The readout 318 success &= pmReadoutGenerateMaskVariance(readout, poisson, satMask, badMask);324 success &= pmReadoutGenerateMaskVariance(readout, satMask, badMask, noiseMap, poisson); 319 325 } 320 326
Note:
See TracChangeset
for help on using the changeset viewer.
