IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 27, 2009, 1:31:32 PM (17 years ago)
Author:
Paul Price
Message:

Need to correct chi2 for the renormalisation, otherwise we're double-renormalising.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/pap/ppStack/src/ppStackConvolve.c

    r25911 r25955  
    4242    options->convCovars = psArrayAlloc(num); // Covariance matrices
    4343
     44    psVector *renorms = psVectorAlloc(num, PS_TYPE_F32); // Renormalisation values for variances
     45    psVectorInit(renorms, NAN);
     46
    4447    psList *fpaList = psListAlloc(NULL); // List of input FPAs, for concept averaging
    4548    psList *cellList = psListAlloc(NULL); // List of input cells, for concept averaging
     
    8891        }
    8992        options->convCovars->data[i] = psMemIncrRefCounter(readout->covariance);
     93
     94        float renorm = psMetadataLookupF32(NULL, readout->analysis, PM_READOUT_ANALYSIS_RENORM);
     95        if (!isfinite(renorm)) {
     96            renorm = 1.0;
     97        }
     98        renorms->data.F32[i] = renorm;
    9099
    91100        if (options->stats) {
     
    234243    }
    235244
     245    // Correct chi^2 for renormalisation
     246    psBinaryOp(options->matchChi2, options->matchChi2, "/", renorms);
     247    psFree(renorms);
     248
    236249    return true;
    237250}
Note: See TracChangeset for help on using the changeset viewer.