IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25830


Ignore:
Timestamp:
Oct 13, 2009, 11:12:03 AM (17 years ago)
Author:
Paul Price
Message:

Need to normalise the inputs that aren't being convolved before combining.

Location:
branches/pap/ppStack/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/pap/ppStack/src/ppStack.h

    r25812 r25830  
    8484                         const psVector *weightings, // Weighting factors for each image
    8585                         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
    8788    );
    8889
  • branches/pap/ppStack/src/ppStackCombineFinal.c

    r25813 r25830  
    1111
    1212bool ppStackCombineFinal(pmReadout *target, ppStackThreadData *stack,
    13                          ppStackOptions *options, pmConfig *config, bool full)
     13                         ppStackOptions *options, pmConfig *config, bool full, bool normalise)
    1414{
    1515    psAssert(stack, "Require stack");
     
    4242        psArrayAdd(job->args, 1, config);
    4343        PS_ARRAY_ADD_SCALAR(job->args, full, PS_TYPE_U8);
     44        PS_ARRAY_ADD_SCALAR(job->args, normalise, PS_TYPE_U8);
    4445        if (!psThreadJobAddPending(job)) {
    4546            psFree(job);
  • branches/pap/ppStack/src/ppStackConvolve.c

    r25788 r25830  
    149149    psFree(rng);
    150150
    151     psFree(options->norm); options->norm = NULL;
    152151    psFree(options->sourceLists); options->sourceLists = NULL;
    153152    psFree(options->psf); options->psf = NULL;
  • branches/pap/ppStack/src/ppStackLoop.c

    r25812 r25830  
    9797    // Final combination
    9898    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)) {
    100100        psError(PS_ERR_UNKNOWN, false, "Unable to perform final combination.");
    101101        psFree(stack);
     
    132132        }
    133133        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)) {
    135135            psError(PS_ERR_UNKNOWN, false, "Unable to perform unconvolved combination.");
    136136            psFree(stack);
  • branches/pap/ppStack/src/ppStackLoop.h

    r25812 r25830  
    6060    ppStackOptions *options,            // Options
    6161    pmConfig *config,                   // Configuration
    62     bool full                           // Combine full image?
     62    bool full,                          // Combine full image?
     63    bool norm                           // Normalise images?
    6364    );
    6465
  • branches/pap/ppStack/src/ppStackReadout.c

    r25821 r25830  
    4444    pmConfig *config = args->data[3];   // Configuration
    4545    bool full = PS_SCALAR_VALUE(args->data[4], U8); // Combine full image?
     46    bool normalise = PS_SCALAR_VALUE(args->data[5], U8); // Normalise images?
    4647
    4748    psVector *mask = options->inputMask; // Mask for inputs
     
    4950    psVector *weightings = options->weightings; // Weightings (1/noise^2) for each image
    5051    psVector *addVariance = options->matchChi2; // Additional variance when rejecting
    51 
     52    psVector *norm = normalise ? options->norm : NULL; // Normalisations to apply to images
    5253
    5354    bool status = ppStackReadoutFinal(config, target, thread->readouts, mask, rejected,
    54                                       weightings, addVariance, full); // Status of operation
     55                                      weightings, addVariance, full, norm); // Status of operation
    5556
    5657    thread->busy = false;
     
    182183bool ppStackReadoutFinal(const pmConfig *config, pmReadout *outRO, const psArray *readouts,
    183184                         const psVector *mask, const psArray *rejected, const psVector *weightings,
    184                          const psVector *addVariance, bool full)
     185                         const psVector *addVariance, bool full, const psVector *norm)
    185186{
    186187    assert(config);
     
    252253        data->reject = rejected ? psMemIncrRefCounter(rejected->data[i]) : NULL;
    253254        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        }
    254261    }
    255262
  • branches/pap/ppStack/src/ppStackThread.c

    r25824 r25830  
    282282
    283283    {
    284         psThreadTask *task = psThreadTaskAlloc("PPSTACK_FINAL_COMBINE", 5);
     284        psThreadTask *task = psThreadTaskAlloc("PPSTACK_FINAL_COMBINE", 6);
    285285        task->function = &ppStackReadoutFinalThread;
    286286        psThreadTaskAdd(task);
Note: See TracChangeset for help on using the changeset viewer.