Changeset 41842
- Timestamp:
- Oct 15, 2021, 8:20:12 AM (5 years ago)
- Location:
- branches/eam_branches/ppStack.20211015/src
- Files:
-
- 8 edited
-
Makefile.am (modified) (1 diff)
-
ppStack.h (modified) (1 diff)
-
ppStackCombinePercent.c (modified) (2 diffs)
-
ppStackLoopByPercent.c (modified) (3 diffs)
-
ppStackOptions.c (modified) (1 diff)
-
ppStackOptions.h (modified) (1 diff)
-
ppStackReadout.c (modified) (4 diffs)
-
ppStackSetup.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ppStack.20211015/src/Makefile.am
r38034 r41842 29 29 ppStackPrepare.c \ 30 30 ppStackConvolve.c \ 31 ppStackLoopByPercent.c \ 32 ppStackCombinePercent.c \ 31 33 ppStackCombinePrepare.c \ 32 34 ppStackCombineInitial.c \ -
branches/eam_branches/ppStack.20211015/src/ppStack.h
r36855 r41842 115 115 bool ppStackReadoutFinalThread(psThreadJob *job // Job to process 116 116 ); 117 118 // Thread entry point for ppStackReadoutPercent 119 bool ppStackReadoutPercentThread(psThreadJob *job); 120 121 bool ppStackReadoutPercent(const pmConfig *config, 122 pmReadout *outRO, 123 const psArray *readouts, 124 const psVector *mask, 125 const psVector *weightings, 126 const psVector *exposures, 127 const psVector *addVariance); 128 117 129 // Perform median stacking for background 118 130 bool ppStackCombineBackground(ppStackThreadData *stack, ppStackOptions *options, pmConfig *config); -
branches/eam_branches/ppStack.20211015/src/ppStackCombinePercent.c
r41841 r41842 1 1 #include "ppStack.h" 2 3 // This is the doomsday switch.4 // #define TESTING // Enable test output5 2 6 3 bool ppStackCombinePercent(ppStackThreadData *stack, ppStackOptions *options, pmConfig *config) … … 40 37 } 41 38 42 // Harvest the jobs, gathering the inspection lists43 options->inspect = psArrayAlloc(options->num);44 options->rejected = psArrayAlloc(options->num);45 for (int i = 0; i < options->num; i++) {46 if (options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) {47 continue;48 }49 options->inspect->data[i] = psArrayAllocEmpty(numChunk);50 options->rejected->data[i] = psArrayAllocEmpty(numChunk);51 }52 53 39 psThreadJob *job; // Completed job 54 40 while ((job = psThreadJobGetDone())) { -
branches/eam_branches/ppStack.20211015/src/ppStackLoopByPercent.c
r41841 r41842 5 5 assert(config); 6 6 7 // Convolve inputs (this must be called even if the convolution is turned off) 7 // Convolve inputs (this must be called even if the convolution is turned off because 8 // it performs the normalization of the inputs). 8 9 psTrace("ppStack", 1, "Convolving inputs to target PSF....\n"); 9 10 if (!ppStackConvolve(options, config)) { … … 15 16 if (options->quality) return true; // Can't do anything else 16 17 17 psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSTACK_RECIPE); // ppStack recipe18 19 18 // Define threading elements 20 19 ppStackThreadData *stack = ppStackThreadDataSetup(options, config, true); … … 24 23 } 25 24 26 // Prepare for combination 25 // Prepare for combination (define outputs, generate output cells) 27 26 if (!ppStackCombinePrepare("PPSTACK.OUTPUT", "PPSTACK.OUTPUT.EXP", options->doBackground ? "PPSTACK.OUTPUT.BKGMODEL" : NULL, PPSTACK_FILES_STACK, stack, options, config)) { 28 27 psError(psErrorCodeLast(), false, "Unable to prepare for combination."); -
branches/eam_branches/ppStack.20211015/src/ppStackOptions.c
r41841 r41842 58 58 59 59 options->clipPercent = false; 60 options->clipMinRange = 0.16; // 1-sigma default61 options->clipMaxRange = 0.84; // 1-sigma default62 60 63 61 options->psf = NULL; -
branches/eam_branches/ppStack.20211015/src/ppStackOptions.h
r41841 r41842 18 18 19 19 bool clipPercent; // use percentile range to clip? 20 psF32 clipMinRange; // min percentile21 psF32 clipMaxRange; // max percentile22 20 23 21 // Prepare -
branches/eam_branches/ppStack.20211015/src/ppStackReadout.c
r41841 r41842 68 68 psVector *addVariance = options->matchChi2; // Additional variance when rejecting 69 69 70 job->results = ppStackReadoutInitial(config, outRO, thread->readouts, mask, 71 weightings, exposures, addVariance); 70 job->results = ppStackReadoutInitial(config, outRO, thread->readouts, mask, weightings, exposures, addVariance); 72 71 thread->busy = false; 73 72 … … 340 339 } 341 340 342 psArray *ppStackReadoutPercent(const pmConfig *config, pmReadout *outRO, const psArray *readouts, 341 bool pmStackCombineByPercentile(pmReadout *outRO, psArray *stack, float minRange, float maxRange, psImageMaskType maskBad, psImageMaskType maskSuspect, psImageMaskType maskBlank); 342 343 bool ppStackReadoutPercent(const pmConfig *config, pmReadout *outRO, const psArray *readouts, 343 344 const psVector *mask, const psVector *weightings, const psVector *exposures, 344 345 const psVector *addVariance) … … 357 358 358 359 bool mdok; // Status of MD lookup 359 float iter = psMetadataLookupF32(NULL, recipe, "COMBINE.ITER"); // Rejection iterations 360 float minRange = psMetadataLookupF32(NULL, recipe, "COMBINE.MIN.RANGE"); // Combination threshold 361 float maxRange = psMetadataLookupF32(NULL, recipe, "COMBINE.MAX.RANGE"); // Combination threshold 362 363 psMetadata *ppsub = psMetadataLookupMetadata(NULL, config->recipes, "PPSUB"); // PPSUB recipe 364 int kernelSize = psMetadataLookupS32(NULL, ppsub, "KERNEL.SIZE"); // Kernel half-size 365 366 psString maskBadStr = psMetadataLookupStr(NULL, recipe, "MASK.VAL"); // Name of bits to mask for bad 367 psImageMaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels 368 369 psString maskSuspectStr = psMetadataLookupStr(NULL, recipe, "MASK.SUSPECT"); // Name of suspect mask bits 360 float minRange = psMetadataLookupF32(&mdok, recipe, "COMBINE.MIN.RANGE"); // Combination threshold 361 float maxRange = psMetadataLookupF32(&mdok, recipe, "COMBINE.MAX.RANGE"); // Combination threshold 362 363 char defaultBlankStr[16] = "BLANK"; 364 365 psString maskBadStr = psMetadataLookupStr(&mdok, recipe, "MASK.VAL"); // Name of bits to mask for bad 366 psString maskSuspectStr = psMetadataLookupStr(&mdok, recipe, "MASK.SUSPECT"); // Name of suspect mask bits 367 psString maskBlankStr = psMetadataLookupStr(&mdok, recipe, "MASK.BLANK"); // Name of bits to set for empty pixels 368 if (!maskBlankStr) { 369 maskBlankStr = psMetadataLookupStr(&mdok, recipe, "MASK.BAD"); // Old name for MASK.BLANK 370 } 371 if (!maskBlankStr) { 372 maskBlankStr = defaultBlankStr; // this is statically allocated above 373 } 374 375 psImageMaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels 370 376 psImageMaskType maskSuspect = pmConfigMaskGet(maskSuspectStr, config); // Suspect bits 371 372 bool status = false; 373 psImageMaskType maskBlank; 374 psString maskBlankStr = psMetadataLookupStr(&status, recipe, "MASK.BLANK"); // Name of bits to set for empty pixels 375 if (maskBlankStr) { 376 maskBlank = pmConfigMaskGet(maskBlankStr, config); // Bits to mask for bad pixels 377 } else { 378 maskBlankStr = psMetadataLookupStr(&status, recipe, "MASK.BAD"); // Old name for MASK.BLANK 379 if (maskBlankStr) { 380 maskBlank = pmConfigMaskGet(maskBlankStr, config); // Bits to mask for bad pixels 381 } else { 382 maskBlank = pmConfigMaskGet("BLANK", config); // Bits to mask for bad pixels 383 } 384 } 377 psImageMaskType maskBlank = pmConfigMaskGet(maskBlankStr, config); // Bits to mask for bad pixels 385 378 386 379 int num = readouts->n; // Number of inputs … … 412 405 sectionNum++; 413 406 414 psArray *results = psArrayAlloc(2); // Array of results 415 results->data[0] = inspect; 416 results->data[1] = reject; 417 418 return results; 419 } 420 421 407 return true; 408 } 409 410 -
branches/eam_branches/ppStack.20211015/src/ppStackSetup.c
r41841 r41842 20 20 21 21 options->clipPercent = psMetadataLookupBool(NULL, recipe, "COMBINE.PERCENT"); // use percentile range to clip? 22 options->clipMinRange = psMetadataLookupF32 (NULL, recipe, "COMBINE.MIN.RANGE"); // min percentile23 options->clipMaxRange = psMetadataLookupF32 (NULL, recipe, "COMBINE.MAX.RANGE"); // max percentile24 25 22 26 23 if (!psMetadataLookupBool(NULL, config->arguments, "HAVE.PSF")) {
Note:
See TracChangeset
for help on using the changeset viewer.
