IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 29, 2009, 5:31:30 PM (17 years ago)
Author:
Paul Price
Message:

Changing 'weight' to 'variance'. Mostly propagating psModules changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/pap_branch_20090128/ppStack/src/ppStackLoop.c

    r21204 r21236  
    2424
    2525// Files required for the convolution
    26 static char *convolveFiles[] = { "PPSTACK.INPUT", "PPSTACK.INPUT.MASK", "PPSTACK.INPUT.WEIGHT", NULL };
     26static char *convolveFiles[] = { "PPSTACK.INPUT", "PPSTACK.INPUT.MASK", "PPSTACK.INPUT.VARIANCE", NULL };
    2727
    2828// Output files for the combination
    29 static char *combineFiles[] = { "PPSTACK.OUTPUT", "PPSTACK.OUTPUT.MASK", "PPSTACK.OUTPUT.WEIGHT",
     29static char *combineFiles[] = { "PPSTACK.OUTPUT", "PPSTACK.OUTPUT.MASK", "PPSTACK.OUTPUT.VARIANCE",
    3030                                "PPSTACK.OUTPUT.JPEG1", "PPSTACK.OUTPUT.JPEG2", NULL };
    3131
     
    204204    const char *tempImage = psMetadataLookupStr(NULL, recipe, "TEMP.IMAGE"); // Suffix for temporary images
    205205    const char *tempMask = psMetadataLookupStr(NULL, recipe, "TEMP.MASK"); // Suffix for temporary masks
    206     const char *tempWeight = psMetadataLookupStr(NULL, recipe, "TEMP.WEIGHT"); // Suffix for temp weight maps
    207     if (!tempImage || !tempMask || !tempWeight) {
     206    const char *tempVariance = psMetadataLookupStr(NULL, recipe, "TEMP.VARIANCE"); // Suffix for temp variance maps
     207    if (!tempImage || !tempMask || !tempVariance) {
    208208        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
    209                 "Unable to find TEMP.IMAGE, TEMP.MASK and TEMP.WEIGHT in recipe");
     209                "Unable to find TEMP.IMAGE, TEMP.MASK and TEMP.VARIANCE in recipe");
    210210        return false;
    211211    }
     
    381381    psArray *imageNames = psArrayAlloc(num);
    382382    psArray *maskNames = psArrayAlloc(num);
    383     psArray *weightNames = psArrayAlloc(num);
     383    psArray *varianceNames = psArrayAlloc(num);
    384384    for (int i = 0; i < num; i++) {
    385         psString imageName = NULL, maskName = NULL, weightName = NULL; // Names for convolved images
     385        psString imageName = NULL, maskName = NULL, varianceName = NULL; // Names for convolved images
    386386        psStringAppend(&imageName, "%s/%s.%d.%s", tempDir, tempName, i, tempImage);
    387387        psStringAppend(&maskName, "%s/%s.%d.%s", tempDir, tempName, i, tempMask);
    388         psStringAppend(&weightName, "%s/%s.%d.%s", tempDir, tempName, i, tempWeight);
    389         psTrace("ppStack", 5, "Temporary files: %s %s %s\n", imageName, maskName, weightName);
     388        psStringAppend(&varianceName, "%s/%s.%d.%s", tempDir, tempName, i, tempVariance);
     389        psTrace("ppStack", 5, "Temporary files: %s %s %s\n", imageName, maskName, varianceName);
    390390        imageNames->data[i] = imageName;
    391391        maskNames->data[i] = maskName;
    392         weightNames->data[i] = weightName;
     392        varianceNames->data[i] = varianceName;
    393393    }
    394394    // Free the outputName that we grabbed above to set up tempName.
     
    481481        writeImage(imageNames->data[i],  hdu->header, readout->image, config);
    482482        writeImage(maskNames->data[i],   hdu->header, readout->mask, config);
    483         writeImage(weightNames->data[i], hdu->header, readout->weight, config);
     483        writeImage(varianceNames->data[i], hdu->header, readout->variance, config);
    484484
    485485        pmCell *inCell = readout->parent; // Input cell
     
    609609    // Start threading
    610610    ppStackThreadInit();
    611     ppStackThreadData *stack = ppStackThreadDataSetup(cells, imageNames, maskNames, weightNames, config);
     611    ppStackThreadData *stack = ppStackThreadDataSetup(cells, imageNames, maskNames, varianceNames, config);
    612612
    613613    psTimerStart("PPSTACK_INITIAL");
     
    10231023            psString imageResolved = pmConfigConvertFilename(imageNames->data[i], config, false, false);
    10241024            psString maskResolved = pmConfigConvertFilename(maskNames->data[i], config, false, false);
    1025             psString weightResolved = pmConfigConvertFilename(weightNames->data[i], config, false, false);
     1025            psString varianceResolved = pmConfigConvertFilename(varianceNames->data[i], config, false, false);
    10261026            if (unlink(imageResolved) == -1 || unlink(maskResolved) == -1 ||
    1027                 unlink(weightResolved) == -1) {
     1027                unlink(varianceResolved) == -1) {
    10281028                psWarning("Unable to delete temporary files for image %d", i);
    10291029            }
    10301030            psFree(imageResolved);
    10311031            psFree(maskResolved);
    1032             psFree(weightResolved);
     1032            psFree(varianceResolved);
    10331033        }
    10341034    }
    10351035    psFree(imageNames);
    10361036    psFree(maskNames);
    1037     psFree(weightNames);
     1037    psFree(varianceNames);
    10381038
    10391039    psFree(inputMask);
     
    10731073        float renormWidth = psMetadataLookupS32(&mdok, recipe, "RENORM.WIDTH"); // Width of Gaussian phot
    10741074        psMaskType maskValue = pmConfigMaskGet("BLANK", config); // Bits to mask
    1075         if (!pmReadoutWeightRenormPhot(outRO, maskValue, renormNum, renormWidth,
    1076                                        renormMean, renormStdev, NULL)) {
     1075        if (!pmReadoutVarianceRenormPhot(outRO, maskValue, renormNum, renormWidth,
     1076                                         renormMean, renormStdev, NULL)) {
    10771077            psError(PS_ERR_UNKNOWN, false, "Unable to renormalise variances.");
    10781078            psFree(outRO);
Note: See TracChangeset for help on using the changeset viewer.