Changeset 17006
- Timestamp:
- Mar 17, 2008, 11:39:43 AM (18 years ago)
- Location:
- trunk/ppStack/src
- Files:
-
- 3 edited
-
ppStackArguments.c (modified) (2 diffs)
-
ppStackLoop.c (modified) (3 diffs)
-
ppStackReadout.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStackArguments.c
r16830 r17006 129 129 psMetadataAddS32(arguments, PS_LIST_TAIL, "-iter", 0, "Number of rejection iterations", 0); 130 130 psMetadataAddF32(arguments, PS_LIST_TAIL, "-combine-rej", 0, "Combination rejection thresold (sigma)", NAN); 131 psMetadataAddF32(arguments, PS_LIST_TAIL, "-convolve-rej", 0, "Convolution rejection thresold (sigma)", NAN);132 psMetadataAddF32(arguments, PS_LIST_TAIL, "-extent", 0, "Extent of convolution (sigma)", NAN);133 131 psMetadataAddU8(arguments, PS_LIST_TAIL, "-mask-bad", 0, "Mask value for bad pixels", 0); 134 132 psMetadataAddU8(arguments, PS_LIST_TAIL, "-mask-blank", 0, "Mask value for blank region", 0); 135 133 psMetadataAddF32(arguments, PS_LIST_TAIL, "-threshold-mask", 0, "Threshold for mask deconvolution", NAN); 134 psMetadataAddF32(arguments, PS_LIST_TAIL, "-image-rej", 0, "Pixel rejection fraction threshold for rejecting entire image", NAN); 136 135 psMetadataAddS32(arguments, PS_LIST_TAIL, "-rows", 0, "Rows to read at once", 128); 137 136 psMetadataAddBool(arguments, PS_LIST_TAIL, "-photometry", 0, "Do photometry on stacked image?", false); … … 180 179 VALUE_ARG_RECIPE_INT("-iter", "ITER", S32, 0); 181 180 VALUE_ARG_RECIPE_FLOAT("-combine-rej", "COMBINE.REJ", F32); 182 VALUE_ARG_RECIPE_FLOAT("-convolve-rej", "CONVOLVE.REJ", F32);183 VALUE_ARG_RECIPE_FLOAT("-extent", "EXTENT", F32);184 181 VALUE_ARG_RECIPE_MASK("-mask-bad", "MASK.BAD"); 185 182 VALUE_ARG_RECIPE_MASK("-mask-blank", "MASK.BLANK"); 186 183 VALUE_ARG_RECIPE_FLOAT("-threshold-mask", "THRESHOLD.MASK", F32); 184 VALUE_ARG_RECIPE_FLOAT("-image-rej", "IMAGE.REJ", F32); 187 185 VALUE_ARG_RECIPE_INT("-rows", "ROWS", S32, 0); 188 186 -
trunk/ppStack/src/ppStackLoop.c
r16999 r17006 183 183 184 184 float threshold = psMetadataLookupF32(NULL, config->arguments, "THRESHOLD.MASK"); // Threshold for mask deconvolution 185 float imageRej = psMetadataLookupF32(NULL, config->arguments, "IMAGE.REJ"); // Maximum fraction of image to reject before rejecting entire image 185 186 186 187 const char *statsName = psMetadataLookupStr(&mdok, config->arguments, "STATS"); // Filename for statistics … … 472 473 subKernels->data[i]); // Pixels to reject 473 474 psFree(inspect); 474 psTrace("ppStack", 5, "%ld pixels rejected from image %d", reject->n, i); 475 float frac = reject->n / (float)(ro->image->numCols * ro->image->numRows); // Pixel fraction 476 psTrace("ppStack", 5, "%ld pixels rejected from image %d (%.1f%%)", reject->n, i, frac * 100.0); 477 if (frac > imageRej) { 478 psWarning("Image %d rejected completely because rejection fraction (%.3f) " 479 "exceeds limit (%.3f)", i, frac, imageRej); 480 psFree(reject); 481 // reject == NULL means reject image completely 482 reject = NULL; 483 } 475 484 rejected->data[i] = reject; 476 485 } … … 484 493 psTrace("ppStack", 2, "Final stack of chunk %d....\n", numChunk); 485 494 for (int i = 0; i < num; i++) { 495 if (!rejected->data[i]) { 496 continue; 497 } 486 498 pmReadout *readout = readouts->data[i]; 487 499 assert(readout); -
trunk/ppStack/src/ppStackReadout.c
r16987 r17006 66 66 } 67 67 68 if (!pmStackCombine(outRO, stack, maskBad, maskBlank, kernelSize, iter, combineRej, useVariance, safe)) { 68 if (!pmStackCombine(outRO, stack, maskBad, maskBlank, kernelSize, iter, combineRej, true, 69 useVariance, safe)) { 69 70 psError(PS_ERR_UNKNOWN, false, "Unable to combine input readouts with rejection."); 70 71 psFree(stack); … … 85 86 for (int i = 0; i < stack->n; i++) { 86 87 pmStackData *data = stack->data[i]; // Data for this image 87 psImage *inspected = psPixelsToMask(NULL, data-> pixels,88 psImage *inspected = psPixelsToMask(NULL, data->inspect, 88 89 psRegionSet(0, outRO->image->numCols - 1, 89 90 0, outRO->image->numRows - 1), … … 105 106 psMetadataAddPtr(readout->analysis, PS_LIST_TAIL, PPSTACK_INSPECT_PIXELS, 106 107 PS_DATA_PIXELS | PS_META_DUPLICATE_OK, "Pixels to inspect from initial combination", 107 data->pixels); 108 } 109 108 data->inspect); 109 } 110 110 psFree(stack); 111 111 … … 144 144 psList *fpaList = psListAlloc(NULL); // List of input FPAs, for concept averaging 145 145 psList *cellList = psListAlloc(NULL); // List of input cells, for concept averaging 146 int numGood = num; // Number of good inputs: images that haven't been completely rejected 146 147 for (int i = 0; i < num; i++) { 148 if (!rejected->data[i]) { 149 // Image completely rejected 150 numGood--; 151 continue; 152 } 153 147 154 pmReadout *ro = readouts->data[i]; 148 155 assert(ro); … … 201 208 202 209 pmStackData *data = pmStackDataAlloc(ro, weighting); 203 data-> pixels= psMemIncrRefCounter(rejected->data[i]);210 data->reject = psMemIncrRefCounter(rejected->data[i]); 204 211 stack->data[i] = data; 205 212 } … … 212 219 continue; 213 220 } 214 psImage *reject = psPixelsToMask(NULL, data-> pixels,221 psImage *reject = psPixelsToMask(NULL, data->reject, 215 222 psRegionSet(0, outRO->image->numCols - 1, 216 223 0, outRO->image->numRows - 1), … … 227 234 #endif 228 235 229 if (!pmStackCombine(outRO, stack, maskBad, maskBlank, 0, 0, NAN, useVariance, false)) {236 if (!pmStackCombine(outRO, stack, maskBad, maskBlank, 0, 0, NAN, numGood != num, useVariance, false)) { 230 237 psError(PS_ERR_UNKNOWN, false, "Unable to combine input readouts."); 231 238 psFree(fpaList);
Note:
See TracChangeset
for help on using the changeset viewer.
