IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.