IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 31, 2008, 4:04:13 PM (18 years ago)
Author:
Paul Price
Message:

Adding renormalisation of variance map.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppSub/src/ppSubReadout.c

    r20126 r20492  
    116116    int optOrder = psMetadataLookupS32(&mdok, recipe, "OPTIMUM.ORDER"); // Order for search
    117117    bool dual = psMetadataLookupBool(&mdok, recipe, "DUAL"); // Dual convolution?
    118     bool renorm = psMetadataLookupBool(&mdok, recipe, "RENORM"); // Renormalise weights?
    119     int renormWidth = psMetadataLookupS32(&mdok, recipe, "RENORM.WIDTH"); // Width for renormalise
    120118
    121119    psString interpModeStr = psMetadataLookupStr(&mdok, recipe, "INTERPOLATION"); // Interpolation mode
     
    433431    }
    434432
    435     if (renorm) {
    436         psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS, 0); // Random number generator
    437         if (!pmReadoutWeightRenorm(outRO, maskBad, PS_STAT_ROBUST_MEDIAN, PS_STAT_ROBUST_STDEV,
    438                                    renormWidth, rng)) {
    439             psError(PS_ERR_UNKNOWN, false, "Unable to renormalise weights for photometry.");
     433    if (psMetadataLookupBool(&mdok, recipe, "RENORM")) {
     434        // Statistics for renormalisation
     435        psStatsOptions renormMean = psStatsOptionFromString(psMetadataLookupStr(&mdok, recipe,
     436                                                                                "RENORM.MEAN"));
     437        psStatsOptions renormStdev = psStatsOptionFromString(psMetadataLookupStr(&mdok, recipe,
     438                                                                                 "RENORM.STDEV"));
     439        int renormNum = psMetadataLookupS32(&mdok, recipe, "RENORM.NUM"); // Number of samples
     440        float renormWidth = psMetadataLookupS32(&mdok, recipe, "RENORM.WIDTH"); // Width of Gaussian phot
     441        psMaskType maskValue = pmConfigMaskGet("BLANK", config); // Bits to mask
     442        if (!pmReadoutWeightRenormPhot(outRO, maskValue, renormNum, renormWidth,
     443                                       renormMean, renormStdev, NULL)) {
     444            psError(PS_ERR_UNKNOWN, false, "Unable to renormalise variances.");
    440445            psFree(outRO);
    441446            return false;
    442447        }
    443         psFree(rng);
    444448    }
    445449
Note: See TracChangeset for help on using the changeset viewer.