Changeset 19454
- Timestamp:
- Sep 10, 2008, 8:17:54 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/pap_branch_080908/psModules/src/imcombine/pmStack.c
r19439 r19454 8 8 * @author GLG, MHPCC 9 9 * 10 * @version $Revision: 1.38.2. 1$ $Name: not supported by cvs2svn $11 * @date $Date: 2008-09- 09 20:40:17$10 * @version $Revision: 1.38.2.2 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2008-09-10 18:17:54 $ 12 12 * Copyright 2004-2007 Institute for Astronomy, University of Hawaii 13 13 * … … 265 265 pixelData->data.F32[num] = image->data.F32[yIn][xIn]; 266 266 if (variance) { 267 pixelVariances->data.F32[num] = variance->data.F32[yIn][xIn] ;267 pixelVariances->data.F32[num] = variance->data.F32[yIn][xIn] * varFactors->data.F32[i]; 268 268 } 269 269 pixelWeights->data.F32[num] = data->weight; … … 312 312 // Use variance to check that the two are consistent 313 313 float diff = pixelData->data.F32[0] - pixelData->data.F32[1]; 314 float sigma2 = pixelVariances->data.F32[0] * varFactors->data.F32[0] + 315 pixelVariances->data.F32[1] * varFactors->data.F32[1]; 314 float sigma2 = pixelVariances->data.F32[0] + pixelVariances->data.F32[1]; 316 315 if (PS_SQR(diff) > PS_SQR(rej) * sigma2) { 317 316 // Not consistent: mark both for inspection … … 342 341 float rej2 = PS_SQR(rej); // Rejection level squared 343 342 for (int i = 0; i < num; i++) { 344 pixelVariances->data.F32[i] *= rej2 * varFactors->data.F32[i];343 pixelVariances->data.F32[i] *= rej2; 345 344 } 346 345 } … … 349 348 // The clipping that follows is solely to identify suspect pixels. 350 349 // These suspect pixels will be inspected in more detail by other functions. 351 int numClipped = INT_MAX; // Number of pixels clipped per iteration 352 int totalClipped = 0; // Total number of pixels clipped 350 int numClipped = INT_MAX; // Number of pixels clipped per iteration 351 int totalClipped = 0; // Total number of pixels clipped 352 float rej2 = PS_SQR(rej); // Rejection level squared 353 353 for (int i = 0; i < numIter && numClipped > 0 && num - totalClipped > 2; i++) { 354 354 numClipped = 0; … … 361 361 } 362 362 363 float limit = NAN; // Rejection limit, when rejecting based on data properties 364 if (!useVariance) { 365 limit = rej * stdev; 366 } 363 float limit = rej * stdev; // Rejection limit, when rejecting based on data properties 367 364 368 365 // Mask a pixel for inspection … … 380 377 if (useVariance) { 381 378 // Comparing squares --- cheaper than lots of sqrts 382 if (PS_SQR(diff) > pixelVariances->data.F32[j]) {379 if (PS_SQR(diff) > rej2 * pixelVariances->data.F32[j]) { 383 380 MASK_PIXEL_FOR_INSPECTION(); 384 381 }
Note:
See TracChangeset
for help on using the changeset viewer.
