Changeset 20497
- Timestamp:
- Oct 31, 2008, 5:00:04 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
ippconfig/recipes/ppStack.config (modified) (1 diff)
-
ppStack/src/ppStackArguments.c (modified) (2 diffs)
-
ppStack/src/ppStackReadout.c (modified) (2 diffs)
-
psModules/src/imcombine/pmStack.c (modified) (8 diffs)
-
psModules/src/imcombine/pmStack.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippconfig/recipes/ppStack.config
r20490 r20497 3 3 ITER S32 1 # Number of rejection iterations 4 4 COMBINE.REJ F32 3.0 # Rejection threshold in combination (sigma) 5 COMBINE.SYS F32 0.08 # Relative systematic error in combination 5 6 MASK.VAL STR MASK.VALUE,BAD.WARP # Mask value of input bad pixels 6 7 MASK.BAD STR BLANK # Mask value to give bad pixels -
trunk/ppStack/src/ppStackArguments.c
r20494 r20497 145 145 psMetadataAddF32(arguments, PS_LIST_TAIL, "-combine-rej", 0, 146 146 "Combination rejection thresold (sigma)", NAN); 147 psMetadataAddF32(arguments, PS_LIST_TAIL, "-combine-sys", 0, 148 "Relative systematic error in combination", NAN); 147 149 psMetadataAddStr(arguments, PS_LIST_TAIL, "-mask-val", 0, "Mask value of input bad pixels", NULL); 148 150 psMetadataAddStr(arguments, PS_LIST_TAIL, "-mask-bad", 0, "Mask value to give bad pixels", NULL); … … 226 228 VALUE_ARG_RECIPE_INT("-iter", "ITER", S32, 0); 227 229 VALUE_ARG_RECIPE_FLOAT("-combine-rej", "COMBINE.REJ", F32); 230 VALUE_ARG_RECIPE_FLOAT("-combine-sys", "COMBINE.SYS", F32); 228 231 VALUE_ARG_RECIPE_FLOAT("-threshold-mask", "THRESHOLD.MASK", F32); 229 232 VALUE_ARG_RECIPE_FLOAT("-image-rej", "IMAGE.REJ", F32); -
trunk/ppStack/src/ppStackReadout.c
r19532 r20497 96 96 int iter = psMetadataLookupS32(NULL, recipe, "ITER"); // Rejection iterations 97 97 float combineRej = psMetadataLookupF32(NULL, recipe, "COMBINE.REJ"); // Combination threshold 98 float combineSys = psMetadataLookupF32(NULL, recipe, "COMBINE.SYS"); // Combination systematic error 98 99 bool useVariance = psMetadataLookupBool(&mdok, recipe, "VARIANCE"); // Use variance for rejection? 99 100 bool safe = psMetadataLookupBool(&mdok, recipe, "SAFE"); // Be safe when combining small numbers of pixels … … 133 134 } 134 135 135 if (!pmStackCombine(outRO, stack, maskVal | maskBad, maskBad, kernelSize, iter, combineRej, true,136 useVariance, safe)) {136 if (!pmStackCombine(outRO, stack, maskVal | maskBad, maskBad, kernelSize, iter, combineRej, combineSys, 137 true, useVariance, safe)) { 137 138 psError(PS_ERR_UNKNOWN, false, "Unable to combine input readouts with rejection."); 138 139 psFree(stack); -
trunk/psModules/src/imcombine/pmStack.c
r20487 r20497 8 8 * @author GLG, MHPCC 9 9 * 10 * @version $Revision: 1.4 3$ $Name: not supported by cvs2svn $11 * @date $Date: 2008-1 0-31 21:50:59$10 * @version $Revision: 1.44 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2008-11-01 02:59:33 $ 12 12 * Copyright 2004-2007 Institute for Astronomy, University of Hawaii 13 13 * … … 219 219 int numIter, // Number of rejection iterations 220 220 float rej, // Number of standard deviations at which to reject 221 float sys, // Relative systematic error 221 222 bool useVariance, // Use variance for rejection when combining? 222 223 bool safe, // Combine safely? … … 311 312 if (useVariance && numIter > 0) { 312 313 // Use variance to check that the two are consistent 313 float diff = pixelData->data.F32[0] - pixelData->data.F32[1]; 314 float diff = 0.5 * (pixelData->data.F32[0] - pixelData->data.F32[1]); // Mean flux difference 315 float var1 = pixelVariances->data.F32[0]; // Variance of first 316 float var2 = pixelVariances->data.F32[1]; // Variance of second 314 317 #ifdef VARIANCE_FACTORS 315 float sigma2 = pixelVariances->data.F32[0] * varFactors->data.F32[pixelSources->data.U16[0]] + 316 pixelVariances->data.F32[1] * varFactors->data.F32[pixelSources->data.U16[1]]; 317 #else 318 float sigma2 = pixelVariances->data.F32[0] + pixelVariances->data.F32[1]; 318 // Variance factor contributes to the rejection level 319 var1 *= varFactors->data.F32[pixelSources->data.U16[0]]; 320 var2 *= varFactors->data.F32[pixelSources->data.U16[1]]; 319 321 #endif 322 // Systematic error contributes to the rejection level 323 var1 += PS_SQR(sys * pixelData->data.F32[0]); 324 var2 += PS_SQR(sys * pixelData->data.F32[1]); 325 326 float sigma2 = var1 + var2; // 320 327 if (PS_SQR(diff) > PS_SQR(rej) * sigma2) { 321 328 // Not consistent: mark both for inspection … … 346 353 float rej2 = PS_SQR(rej); // Rejection level squared 347 354 for (int i = 0; i < num; i++) { 355 pixelVariances->data.F32[i] *= rej2; 348 356 #ifdef VARIANCE_FACTORS 349 pixelVariances->data.F32[i] *= rej2 * varFactors->data.F32[pixelSources->data.U16[i]]; 350 #else 351 pixelVariances->data.F32[i] *= rej2; 357 // Variance factor contributes to the rejection level 358 pixelVariances->data.F32[i] *= varFactors->data.F32[pixelSources->data.U16[i]]; 352 359 #endif 360 // Systematic error contributes to the rejection level 361 pixelVariances->data.F32[i] += PS_SQR(sys * pixelData->data.F32[i]); 353 362 } 354 363 } … … 554 563 /// Stack input images 555 564 bool pmStackCombine(pmReadout *combined, psArray *input, psMaskType maskVal, psMaskType bad, 556 int kernelSize, int numIter, float rej, bool entire, bool useVariance, bool safe) 565 int kernelSize, int numIter, float rej, float sys, 566 bool entire, bool useVariance, bool safe) 557 567 { 558 568 PS_ASSERT_PTR_NON_NULL(combined, false); … … 660 670 x, y); // Reject these images 661 671 combinePixels(combinedImage, combinedMask, combinedVariance, input, weights, varFactors, 662 reject, x, y, maskVal, bad, numIter, rej, useVariance, safe, buffer);672 reject, x, y, maskVal, bad, numIter, rej, sys, useVariance, safe, buffer); 663 673 } 664 674 } … … 674 684 x, y); // Reject these images 675 685 combinePixels(combinedImage, combinedMask, combinedVariance, input, weights, varFactors, 676 reject, x, y, maskVal, bad, numIter, rej, useVariance, safe, buffer);686 reject, x, y, maskVal, bad, numIter, rej, sys, useVariance, safe, buffer); 677 687 } 678 688 } … … 701 711 for (int x = minInputCols; x < maxInputCols; x++) { 702 712 combinePixels(combinedImage, combinedMask, combinedVariance, input, weights, varFactors, 703 NULL, x, y, maskVal, bad, numIter, rej, useVariance, safe, buffer);713 NULL, x, y, maskVal, bad, numIter, rej, sys, useVariance, safe, buffer); 704 714 } 705 715 } -
trunk/psModules/src/imcombine/pmStack.h
r19532 r20497 8 8 * @author GLG, MHPCC 9 9 * 10 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $11 * @date $Date: 2008- 09-12 04:12:42$10 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2008-11-01 02:59:33 $ 12 12 * 13 13 * Copyright 2004-2007 Institute for Astronomy, University of Hawaii … … 48 48 int numIter, ///< Number of iterations 49 49 float rej, ///< Rejection limit (standard deviations) 50 float sys, ///< Relative systematic error 50 51 bool entire, ///< Combine entire image even if rejection lists provided? 51 52 bool useVariance, ///< Use variance values for rejection?
Note:
See TracChangeset
for help on using the changeset viewer.
