Changeset 25830
- Timestamp:
- Oct 13, 2009, 11:12:03 AM (17 years ago)
- Location:
- branches/pap/ppStack/src
- Files:
-
- 7 edited
-
ppStack.h (modified) (1 diff)
-
ppStackCombineFinal.c (modified) (2 diffs)
-
ppStackConvolve.c (modified) (1 diff)
-
ppStackLoop.c (modified) (2 diffs)
-
ppStackLoop.h (modified) (1 diff)
-
ppStackReadout.c (modified) (4 diffs)
-
ppStackThread.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap/ppStack/src/ppStack.h
r25812 r25830 84 84 const psVector *weightings, // Weighting factors for each image 85 85 const psVector *addVariance, // Additional variance for rejection 86 bool full // Combine full image? 86 bool full, // Combine full image? 87 const psVector *norm // Normalisations to apply 87 88 ); 88 89 -
branches/pap/ppStack/src/ppStackCombineFinal.c
r25813 r25830 11 11 12 12 bool ppStackCombineFinal(pmReadout *target, ppStackThreadData *stack, 13 ppStackOptions *options, pmConfig *config, bool full )13 ppStackOptions *options, pmConfig *config, bool full, bool normalise) 14 14 { 15 15 psAssert(stack, "Require stack"); … … 42 42 psArrayAdd(job->args, 1, config); 43 43 PS_ARRAY_ADD_SCALAR(job->args, full, PS_TYPE_U8); 44 PS_ARRAY_ADD_SCALAR(job->args, normalise, PS_TYPE_U8); 44 45 if (!psThreadJobAddPending(job)) { 45 46 psFree(job); -
branches/pap/ppStack/src/ppStackConvolve.c
r25788 r25830 149 149 psFree(rng); 150 150 151 psFree(options->norm); options->norm = NULL;152 151 psFree(options->sourceLists); options->sourceLists = NULL; 153 152 psFree(options->psf); options->psf = NULL; -
branches/pap/ppStack/src/ppStackLoop.c
r25812 r25830 97 97 // Final combination 98 98 psTrace("ppStack", 2, "Final stack of convolved images....\n"); 99 if (!ppStackCombineFinal(options->outRO, stack, options, config, false )) {99 if (!ppStackCombineFinal(options->outRO, stack, options, config, false, false)) { 100 100 psError(PS_ERR_UNKNOWN, false, "Unable to perform final combination."); 101 101 psFree(stack); … … 132 132 } 133 133 psTrace("ppStack", 2, "Stack of unconvolved images....\n"); 134 if (!ppStackCombineFinal(options->unconvRO, stack, options, config, true )) {134 if (!ppStackCombineFinal(options->unconvRO, stack, options, config, true, true)) { 135 135 psError(PS_ERR_UNKNOWN, false, "Unable to perform unconvolved combination."); 136 136 psFree(stack); -
branches/pap/ppStack/src/ppStackLoop.h
r25812 r25830 60 60 ppStackOptions *options, // Options 61 61 pmConfig *config, // Configuration 62 bool full // Combine full image? 62 bool full, // Combine full image? 63 bool norm // Normalise images? 63 64 ); 64 65 -
branches/pap/ppStack/src/ppStackReadout.c
r25821 r25830 44 44 pmConfig *config = args->data[3]; // Configuration 45 45 bool full = PS_SCALAR_VALUE(args->data[4], U8); // Combine full image? 46 bool normalise = PS_SCALAR_VALUE(args->data[5], U8); // Normalise images? 46 47 47 48 psVector *mask = options->inputMask; // Mask for inputs … … 49 50 psVector *weightings = options->weightings; // Weightings (1/noise^2) for each image 50 51 psVector *addVariance = options->matchChi2; // Additional variance when rejecting 51 52 psVector *norm = normalise ? options->norm : NULL; // Normalisations to apply to images 52 53 53 54 bool status = ppStackReadoutFinal(config, target, thread->readouts, mask, rejected, 54 weightings, addVariance, full ); // Status of operation55 weightings, addVariance, full, norm); // Status of operation 55 56 56 57 thread->busy = false; … … 182 183 bool ppStackReadoutFinal(const pmConfig *config, pmReadout *outRO, const psArray *readouts, 183 184 const psVector *mask, const psArray *rejected, const psVector *weightings, 184 const psVector *addVariance, bool full )185 const psVector *addVariance, bool full, const psVector *norm) 185 186 { 186 187 assert(config); … … 252 253 data->reject = rejected ? psMemIncrRefCounter(rejected->data[i]) : NULL; 253 254 stack->data[i] = data; 255 256 if (norm) { 257 float normalise = powf(10.0, -0.4 * norm->data.F32[i]); // Normalisation 258 psBinaryOp(ro->image, ro->image, "*", psScalarAlloc(normalise, PS_TYPE_F32)); 259 psBinaryOp(ro->variance, ro->variance, "*", psScalarAlloc(PS_SQR(normalise), PS_TYPE_F32)); 260 } 254 261 } 255 262 -
branches/pap/ppStack/src/ppStackThread.c
r25824 r25830 282 282 283 283 { 284 psThreadTask *task = psThreadTaskAlloc("PPSTACK_FINAL_COMBINE", 5);284 psThreadTask *task = psThreadTaskAlloc("PPSTACK_FINAL_COMBINE", 6); 285 285 task->function = &ppStackReadoutFinalThread; 286 286 psThreadTaskAdd(task);
Note:
See TracChangeset
for help on using the changeset viewer.
