IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 7, 2009, 4:08:25 PM (17 years ago)
Author:
Paul Price
Message:

Merging trunk (r25026) to get up-to-date on old branch.

Location:
branches/pap
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/pap

  • branches/pap/ppStack

    • Property svn:mergeinfo deleted
  • branches/pap/ppStack/src/ppStackMatch.c

    r23573 r25027  
    209209            pmFPAview *view = pmFPAviewAlloc(0); // View to readout of interest
    210210            view->chip = view->cell = view->readout = 0;
    211             psString filename = pmFPAfileNameFromRule(filerule->rule, file, view); // Filename of interest
     211            psString filename = pmFPAfileNameFromRule(file->filerule, file, view); // Filename of interest
    212212
    213213            // Read convolution kernel
     
    241241                !readImage(&readout->variance, options->varianceNames->data[index], config)) {
    242242                psError(PS_ERR_IO, false, "Unable to read previously produced image.");
    243                 psFree(imageName);
    244                 psFree(maskName);
    245                 psFree(varianceName);
    246243                return false;
    247244            }
    248             psFree(imageName);
    249             psFree(maskName);
    250             psFree(varianceName);
    251245
    252246            psRegion *region = psMetadataLookupPtr(NULL, conv->analysis,
     
    317311            }
    318312
     313            fake->mask = psImageCopy(NULL, readout->mask, PS_TYPE_IMAGE_MASK);
     314
    319315            // Add the background into the target image
    320316            psImage *bgImage = stackBackgroundModel(readout, config); // Image of background
     
    361357                    psFree(stampSources);
    362358                    psFree(conv);
     359                    if (threads > 0) {
     360                        pmSubtractionThreadsFinalize(readout, fake);
     361                    }
    363362                    return false;
    364363                }
     
    375374                    psFree(stampSources);
    376375                    psFree(conv);
     376                    if (threads > 0) {
     377                        pmSubtractionThreadsFinalize(readout, fake);
     378                    }
    377379                    return false;
    378380                }
     
    510512        psBinaryOp(readout->variance, readout->variance, "*", psScalarAlloc(PS_SQR(norm), PS_TYPE_F32));
    511513    }
    512 
     514   
    513515    // Ensure the background value is zero
    514516    psStats *bg = psStatsAlloc(PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV); // Statistics for background
    515517    psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS); // Random number generator
    516518    if (!psImageBackground(bg, NULL, readout->image, readout->mask, maskVal | maskBad, rng)) {
    517         psWarning("Can't measure background for image.");
    518         psErrorClear();
     519      psWarning("Can't measure background for image.");
     520      psErrorClear();
    519521    } else {
    520         psLogMsg("ppStack", PS_LOG_INFO, "Correcting convolved image background by %lf (+/- %lf)",
    521                  psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN), psStatsGetValue(bg, PS_STAT_ROBUST_STDEV));
    522         (void)psBinaryOp(readout->image, readout->image, "-",
    523                          psScalarAlloc(psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN), PS_TYPE_F32));
    524     }
     522      if (!psMetadataLookupBool(NULL, config->arguments, "PPSTACK.SKIP.BG.SUB")) {
     523        psLogMsg("ppStack", PS_LOG_INFO, "Correcting convolved image background by %lf (+/- %lf)",
     524                 psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN), psStatsGetValue(bg, PS_STAT_ROBUST_STDEV));
     525        (void)psBinaryOp(readout->image, readout->image, "-",
     526                         psScalarAlloc(psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN), PS_TYPE_F32));
     527      }
     528    }
     529   
    525530
    526531    // Measure the variance level for the weighting
Note: See TracChangeset for help on using the changeset viewer.