IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 9, 2009, 2:53:12 PM (17 years ago)
Author:
Paul Price
Message:

Merging branches/pap (unconvolved stacks, reworked combinePixels function into clearer roles, only throw out most variant pixel on each iteration, throw suspect pixels out as first rejection step) stack development. I think I've got everything, but not entirely sure, since I've already merged this branch once before (for dual convolution).

Location:
trunk/ppStack
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStack

  • trunk/ppStack/src/ppStackMatch.c

    r26074 r26076  
    167167    )
    168168{
     169#if 1
    169170    bool mdok; // Status of metadata lookups
    170171
     
    192193    psImageMaskType maskBad = pmConfigMaskGet("BLANK", config); // Bits to mask
    193194
     195    psImageCovarianceTransfer(readout->variance, readout->covariance);
    194196    return pmReadoutVarianceRenormalise(readout, maskBad, num, minValid, maxValid);
     197#else
     198    return true;
     199#endif
    195200}
    196201
     
    212217    int size = psMetadataLookupS32(NULL, ppsub, "KERNEL.SIZE"); // Kernel half-size
    213218
    214     psString maskValStr = psMetadataLookupStr(NULL, recipe, "MASK.VAL"); // Name of bits to mask going in
     219    psString maskValStr = psMetadataLookupStr(NULL, ppsub, "MASK.VAL"); // Name of bits to mask going in
    215220    psImageMaskType maskVal = pmConfigMaskGet(maskValStr, config); // Bits to mask going in to pmSubtractionMatch
    216221    psString maskPoorStr = psMetadataLookupStr(NULL, recipe, "MASK.POOR"); // Name of bits to mask for poor
     
    257262            psFitsClose(fits);
    258263
    259             if (!readImage(&readout->image, options->imageNames->data[index], config) ||
    260                 !readImage(&readout->mask, options->maskNames->data[index], config) ||
    261                 !readImage(&readout->variance, options->varianceNames->data[index], config)) {
     264            if (!readImage(&readout->image, options->convImages->data[index], config) ||
     265                !readImage(&readout->mask, options->convMasks->data[index], config) ||
     266                !readImage(&readout->variance, options->convVariances->data[index], config)) {
    262267                psError(PS_ERR_IO, false, "Unable to read previously produced image.");
    263268                return false;
     
    378383            }
    379384#endif
     385
     386            fprintf(stderr, "vf = %f\n", psImageCovarianceFactor(readout->covariance));
     387
    380388
    381389            if (threads > 0) {
     
    517525            psFree(iter);
    518526            options->matchChi2->data.F32[index] = sum / (psImageCovarianceFactor(readout->covariance) * num);
     527            fprintf(stderr, "chi2 = %f ; vf = %f\n", sum/num, psImageCovarianceFactor(readout->covariance));
    519528        }
    520529
     
    543552    psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS); // Random number generator
    544553    if (!psImageBackground(bg, NULL, readout->image, readout->mask, maskVal | maskBad, rng)) {
    545       psWarning("Can't measure background for image.");
    546       psErrorClear();
     554        psWarning("Can't measure background for image.");
     555        psErrorClear();
    547556    } else {
    548       if (!psMetadataLookupBool(NULL, config->arguments, "PPSTACK.SKIP.BG.SUB")) {
    549         psLogMsg("ppStack", PS_LOG_INFO, "Correcting convolved image background by %lf (+/- %lf)",
    550                  psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN), psStatsGetValue(bg, PS_STAT_ROBUST_STDEV));
    551         (void)psBinaryOp(readout->image, readout->image, "-",
    552                          psScalarAlloc(psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN), PS_TYPE_F32));
    553       }
     557        if (!psMetadataLookupBool(NULL, config->arguments, "PPSTACK.SKIP.BG.SUB")) {
     558            psLogMsg("ppStack", PS_LOG_INFO, "Correcting convolved image background by %lf (+/- %lf)",
     559                     psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN), psStatsGetValue(bg, PS_STAT_ROBUST_STDEV));
     560            (void)psBinaryOp(readout->image, readout->image, "-",
     561                             psScalarAlloc(psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN), PS_TYPE_F32));
     562        }
    554563    }
    555564
     
    569578    options->weightings->data.F32[index] = 1.0 / (psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN) *
    570579                                                  psImageCovarianceFactor(readout->covariance));
     580    psLogMsg("ppStack", PS_LOG_INFO, "Weighting for image %d is %f\n",
     581             index, options->weightings->data.F32[index]);
    571582    psMetadataAddF32(readout->analysis, PS_LIST_TAIL, "PPSTACK.WEIGHTING", 0,
    572583                     "Weighting by 1/noise^2 for stack", options->weightings->data.F32[index]);
Note: See TracChangeset for help on using the changeset viewer.