IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25027 for branches/pap/ppStack


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:
5 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
  • branches/pap/ppStack/src/ppStackPhotometry.c

    r23688 r25027  
    9494        psArray *sources = psMetadataLookupPtr(NULL, photRO->analysis, "PSPHOT.SOURCES"); // Sources
    9595        psMetadataAddS32(options->stats, PS_LIST_TAIL, "NUM_SOURCES", 0,
    96                          "Number of sources detected", sources->n);
     96                         "Number of sources detected", sources ? sources->n : 0);
    9797        psMetadataAddF32(options->stats, PS_LIST_TAIL, "TIME_PHOT", 0,
    9898                         "Time to do photometry", psTimerMark("PPSTACK_PHOT"));
  • branches/pap/ppStack/src/ppStackThread.c

    r23341 r25027  
    187187
    188188
     189                int zMax = 0;
    189190                bool keepReading = false;
    190                 if (pmReadoutMore(ro, imageFits, 0, rows, config)) {
     191                if (pmReadoutMore(ro, imageFits, 0, &zMax, rows, config)) {
    191192                    keepReading = true;
    192                     if (!pmReadoutReadChunk(ro, imageFits, 0, rows, overlap, config)) {
     193                    if (!pmReadoutReadChunk(ro, imageFits, 0, NULL, rows, overlap, config)) {
    193194                        psError(PS_ERR_IO, false, "Unable to read chunk %d for file PPSTACK.INPUT %d",
    194195                                numChunk, i);
     
    198199                }
    199200
    200                 if (pmReadoutMoreMask(ro, maskFits, 0, rows, config)) {
     201                if (pmReadoutMoreMask(ro, maskFits, 0, &zMax, rows, config)) {
    201202                    keepReading = true;
    202                     if (!pmReadoutReadChunkMask(ro, maskFits, 0, rows, overlap, config)) {
     203                    if (!pmReadoutReadChunkMask(ro, maskFits, 0, NULL, rows, overlap, config)) {
    203204                        psError(PS_ERR_IO, false, "Unable to read chunk %d for file PPSTACK.INPUT.MASK %d",
    204205                                numChunk, i);
     
    208209                }
    209210
    210                 if (pmReadoutMoreVariance(ro, varianceFits, 0, rows, config)) {
     211                if (pmReadoutMoreVariance(ro, varianceFits, 0, &zMax, rows, config)) {
    211212                    keepReading = true;
    212                     if (!pmReadoutReadChunkVariance(ro, varianceFits, 0, rows, overlap, config)) {
     213                    if (!pmReadoutReadChunkVariance(ro, varianceFits, 0, NULL, rows, overlap, config)) {
    213214                        psError(PS_ERR_IO, false,
    214215                                "Unable to read chunk %d for file PPSTACK.INPUT.VARIANCE %d",
Note: See TracChangeset for help on using the changeset viewer.