IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 5, 2009, 5:03:33 PM (17 years ago)
Author:
Paul Price
Message:

Merging pap_branch_20090128. Resolved a small number of conflicts. Compiles, but not tested in detail.

File:
1 edited

Legend:

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

    r21199 r21366  
    1616                     PM_SOURCE_MODE_CR_LIMIT) // Mask to apply to input sources
    1717#define FAINT_SOURCE_FRAC 1.0e-4         // Set minimum flux to this fraction of faintest source flux
     18#define COVAR_FRAC 0.01                 // Truncation fraction for covariance matrix
    1819
    1920//#define TESTING                         // Enable debugging output
     
    233234        }
    234235
    235         // Read image, mask, weight
     236        // Read image, mask, variance
    236237        const char *tempImage = psMetadataLookupStr(NULL, recipe, "TEMP.IMAGE"); // Suffix for image
    237238        const char *tempMask = psMetadataLookupStr(NULL, recipe, "TEMP.MASK"); // Suffix for mask
    238         const char *tempWeight = psMetadataLookupStr(NULL, recipe, "TEMP.WEIGHT"); // Suffix for weight map
    239         psString imageName = NULL, maskName = NULL, weightName = NULL; // Names for convolved images
     239        const char *tempVariance = psMetadataLookupStr(NULL, recipe, "TEMP.VARIANCE"); // Suffix for variance map
     240        psString imageName = NULL, maskName = NULL, varianceName = NULL; // Names for convolved images
    240241        psStringAppend(&imageName, "%s.%d.%s", outName, numInput, tempImage);
    241242        psStringAppend(&maskName, "%s.%d.%s", outName, numInput, tempMask);
    242         psStringAppend(&weightName, "%s.%d.%s", outName, numInput, tempWeight);
     243        psStringAppend(&varianceName, "%s.%d.%s", outName, numInput, tempVariance);
    243244
    244245        if (!readImage(&readout->image, imageName, config) || !readImage(&readout->mask, maskName, config) ||
    245             !readImage(&readout->weight, weightName, config)) {
     246            !readImage(&readout->variance, varianceName, config)) {
    246247            psError(PS_ERR_IO, false, "Unable to read previously produced image.");
    247248            psFree(imageName);
    248249            psFree(maskName);
    249             psFree(weightName);
     250            psFree(varianceName);
    250251            return false;
    251252        }
    252253        psFree(imageName);
    253254        psFree(maskName);
    254         psFree(weightName);
     255        psFree(varianceName);
    255256
    256257        psRegion *region = psMetadataLookupPtr(NULL, output->analysis,
     
    374375                                                                                         "RENORM.STDEV"));
    375376
    376                 if (!pmReadoutWeightRenormPixels(readout, maskBad, renormMean, renormStdev, rng)) {
     377                if (!pmReadoutVarianceRenormPixels(readout, maskBad, renormMean, renormStdev, rng)) {
    377378                    psError(PS_ERR_UNKNOWN, false, "Unable to renormalise variances.");
    378379                    psFree(output);
     
    444445            psFree(readout->image);
    445446            psFree(readout->mask);
    446             psFree(readout->weight);
     447            psFree(readout->variance);
     448            psFree(readout->covariance);
    447449            readout->image  = psMemIncrRefCounter(output->image);
    448450            readout->mask   = psMemIncrRefCounter(output->mask);
    449             readout->weight = psMemIncrRefCounter(output->weight);
     451            readout->variance = psMemIncrRefCounter(output->variance);
     452            readout->covariance = psImageCovarianceTruncate(output->covariance, COVAR_FRAC);
    450453        } else {
    451454            // Fake the convolution
     
    559562                                                                                 "RENORM.STDEV"));
    560563
    561         if (!pmReadoutWeightRenormPixels(readout, maskBad, renormMean, renormStdev, rng)) {
     564        if (!pmReadoutVarianceRenormPixels(readout, maskBad, renormMean, renormStdev, rng)) {
    562565            psError(PS_ERR_UNKNOWN, false, "Unable to renormalise variances.");
    563566            psFree(output);
     
    583586    psFree(bg);
    584587
    585 
    586588#if 0
    587589#define RADIUS 10                       // Radius of photometry
Note: See TracChangeset for help on using the changeset viewer.