IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30096


Ignore:
Timestamp:
Dec 17, 2010, 9:20:43 AM (15 years ago)
Author:
eugene
Message:

new peaks for new sources need a footprint, at least to determine extended source analysis area

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20101205/psphot/src/psphotSourceMatch.c

    r29936 r30096  
    187187        pmPhotObj *obj = objects->data[i];
    188188
     189        // we will find the input source with the max number of spans and reproduce that footprint
     190        int nSpansMax = 0;
     191        int iSpansMax = -1;
     192
    189193        // mark the images for which sources have been found
    190194        psVectorInit (found, 0);
     
    196200            psAssert (index < found->n, "invalid index");
    197201
     202            if (src->peak && src->peak->footprint && src->peak->footprint->nspans > nSpansMax) {
     203                nSpansMax = src->peak->footprint->nspans;
     204                iSpansMax = j;
     205            }
     206
    198207            found->data.U8[index] = 1;
     208        }
     209
     210        // we make a copy of the largest footprint; this will be used for all new sources associated with this object
     211        pmFootprint *footprint = NULL;
     212        if (iSpansMax != -1) { // copy the footprint info
     213            pmSource *src = obj->sources->data[iSpansMax];
     214            psAssert(src->peak, "source does not exist?");
     215            psAssert(src->peak->footprint, "footprint does not exist");
     216            psAssert(src->peak->footprint->nspans == nSpansMax, "wrong footprint?");
     217           
     218            // we only care about the spans, do not worry about the image of this footprint
     219            footprint = pmFootprintCopyData(src->peak->footprint, NULL);
    199220        }
    200221
     
    219240            peak->dy = NAN;
    220241           
    221             // XXX assign to a footprint?
     242            // assign to a footprint on this readout->image
     243            peak->footprint = pmFootprintCopyData(footprint, readout->image);
    222244
    223245            // create a new source
     
    241263            psFree (peak);
    242264        }
     265        psFree (footprint);
    243266    }
    244267
Note: See TracChangeset for help on using the changeset viewer.