IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 29, 2005, 5:44:55 PM (21 years ago)
Author:
eugene
Message:

various psphot updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/source_moments.c

    r4574 r4901  
    55    bool     status  = false;
    66    psArray *sources = NULL;
     7
     8    psMemoryId id = psMemGetId ();
    79
    810    psTimerStart ("psphot");
     
    1719
    1820    for (int i = 0; i < peaks->n; i++) {
     21
    1922        // create a new source, add peak
    2023        psSource *source = pmSourceAlloc();
    21         source->peak = (psPeak *)peaks->data[i];
     24        source->peak = (psPeak *)psMemCopy(peaks->data[i]);
    2225
    2326        // allocate image, noise, mask arrays for each peak (square of radius OUTER)
     27        // XXX - this has 12 leaks (v.5)
    2428        pmSourceDefinePixels (source, imdata, source->peak->x, source->peak->y, OUTER);
    2529
    2630        // this should use ROBUST not SAMPLE median, but it is broken
    2731        status = pmSourceLocalSky_EAM (source, PS_STAT_SAMPLE_MEDIAN, INNER);
    28         if (!status) continue;
     32        if (!status) {
     33          psFree (source);
     34          continue;
     35        }
    2936
    3037        status = pmSourceMoments (source, RADIUS);
    31         if (!status) continue;
     38        if (!status) {
     39          psFree (source);
     40          continue;
     41        }
    3242       
    3343        psArrayAdd (sources, 100, source);
     44        psFree (source);
    3445    }
    3546
Note: See TracChangeset for help on using the changeset viewer.