IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 31, 2008, 3:46:38 PM (18 years ago)
Author:
Paul Price
Message:

Adding renormalisation of variance maps.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStack/src/ppStackMatch.c

    r17031 r17255  
    1616
    1717bool ppStackMatch(pmReadout *readout, psArray **regions, psArray **kernels,
    18                   const pmReadout *sourcesRO, const pmPSF *psf, const pmConfig *config)
     18                  const pmReadout *sourcesRO, const pmPSF *psf, psRandom *rng, const pmConfig *config)
    1919{
    2020    assert(readout);
     
    3030    psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, "PPSUB"); // PPSUB recipe
    3131    int size = psMetadataLookupS32(NULL, recipe, "KERNEL.SIZE"); // Kernel half-size
     32    psMaskType maskBad = pmConfigMask(psMetadataLookupStr(NULL, recipe, "MASK.BAD"), config); // Value to mask
     33    bool mdok;                          // Status of MD lookup
     34    bool renorm = psMetadataLookupBool(&mdok, recipe, "RENORM"); // Renormalise variances?
     35    psStatsOptions renormMean = psMetadataLookupS32(&mdok, recipe, "RENORM.MEAN"); // Statistic for mean
     36    psStatsOptions renormStdev = psMetadataLookupS32(&mdok, recipe, "RENORM.STDEV"); // Statistic for stdev
     37    int renormWidth = psMetadataLookupS32(&mdok, recipe, "RENORM.WIDTH"); // Width for renormalisation box
     38
     39    // Renormalise the variances if desired
     40    if (renorm && !pmReadoutWeightRenorm(readout, maskBad, renormMean, renormStdev, renormWidth, rng)) {
     41        psError(PS_ERR_UNKNOWN, false, "Unable to renormalise variances.");
     42        psFree(output);
     43        return false;
     44    }
    3245
    3346#ifndef NO_CONVOLUTION
    34     bool mdok;                          // Status of MD lookup
    3547    int order = psMetadataLookupS32(NULL, recipe, "SPATIAL.ORDER"); // Spatial polynomial order
    3648    float regionSize = psMetadataLookupF32(NULL, recipe, "REGION.SIZE"); // Size of iso-kernel regs
     
    4759    int ringsOrder = psMetadataLookupS32(NULL, recipe, "RINGS.ORDER"); // RINGS polynomial order
    4860    int binning = psMetadataLookupS32(NULL, recipe, "SPAM.BINNING"); // Binning for SPAM kernel
    49     psMaskType maskBad = pmConfigMask(psMetadataLookupStr(NULL, recipe, "MASK.BAD"),
    50                                       config); // Value to mask
    5161    psMaskType maskBlank = pmConfigMask(psMetadataLookupStr(NULL, recipe, "MASK.BLANK"),
    5262                                        config); // Mask for blank reg.
Note: See TracChangeset for help on using the changeset viewer.