IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 32619


Ignore:
Timestamp:
Nov 6, 2011, 2:43:27 PM (15 years ago)
Author:
eugene
Message:

do not require a footprint when generating matched sources; copy the footprint for double objects

Location:
branches/eam_branches/ipp-20110906/psphot/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110906/psphot/src/psphotFitSourcesLinear.c

    r32348 r32619  
    134134    for (int i = 0; i < sources->n; i++) {
    135135        pmSource *source = sources->data[i];
     136
     137        // psAssert (source->peak, "source without peak??");
     138        // psAssert (source->peak->footprint, "peak without footprint??");
    136139
    137140        // turn this bit off and turn it on again if we pass this test
  • branches/eam_branches/ipp-20110906/psphot/src/psphotGuessModels.c

    r32348 r32619  
    170170        if (!source->peak) continue;
    171171
     172        // psAssert (source->peak->footprint, "peak without footprint??");
     173
    172174        nSrc ++;
    173175
  • branches/eam_branches/ipp-20110906/psphot/src/psphotSourceFits.c

    r32348 r32619  
    357357    pmSource *newSrc = pmSourceCopy (source);
    358358    newSrc->modelPSF = psMemIncrRefCounter (DBL->data[1]);
     359    newSrc->peak->footprint = source->peak->footprint; // just a reference; the peak does not own the footprint
     360    psArrayAdd(newSrc->peak->footprint->peaks, 1, newSrc->peak); // the footprint owns the peak
    359361
    360362    // build cached models and subtract
  • branches/eam_branches/ipp-20110906/psphot/src/psphotSourceMatch.c

    r32348 r32619  
    234234           
    235235            // assign to a footprint on this readout->image
    236             peak->footprint = pmFootprintCopyData(footprint, readout->image);
    237 
    238             // the peak does not claim ownership of the footprint (it does not free it). save a copy of this
    239             // footprint on detections->footprints so we can free it later
    240             psArrayAdd(detections->footprints, 100, peak->footprint);
    241             psFree (peak->footprint);
     236            if (footprint) {
     237                peak->footprint = pmFootprintCopyData(footprint, readout->image);
     238
     239                // the peak does not claim ownership of the footprint (it does not free it). save a copy of this
     240                // footprint on detections->footprints so we can free it later
     241                psArrayAdd(detections->footprints, 100, peak->footprint);
     242                psFree (peak->footprint);
     243            }
    242244           
    243245            // create a new source
  • branches/eam_branches/ipp-20110906/psphot/src/psphotSourceStats.c

    r32348 r32619  
    124124        // add the peak
    125125        source->peak = psMemIncrRefCounter(peak);
     126
     127        // psAssert (source->peak->footprint, "peak without footprint??");
    126128
    127129        // allocate space for moments
Note: See TracChangeset for help on using the changeset viewer.