Changeset 4901 for trunk/psphot/src/source_moments.c
- Timestamp:
- Aug 29, 2005, 5:44:55 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/source_moments.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/source_moments.c
r4574 r4901 5 5 bool status = false; 6 6 psArray *sources = NULL; 7 8 psMemoryId id = psMemGetId (); 7 9 8 10 psTimerStart ("psphot"); … … 17 19 18 20 for (int i = 0; i < peaks->n; i++) { 21 19 22 // create a new source, add peak 20 23 psSource *source = pmSourceAlloc(); 21 source->peak = (psPeak *)p eaks->data[i];24 source->peak = (psPeak *)psMemCopy(peaks->data[i]); 22 25 23 26 // allocate image, noise, mask arrays for each peak (square of radius OUTER) 27 // XXX - this has 12 leaks (v.5) 24 28 pmSourceDefinePixels (source, imdata, source->peak->x, source->peak->y, OUTER); 25 29 26 30 // this should use ROBUST not SAMPLE median, but it is broken 27 31 status = pmSourceLocalSky_EAM (source, PS_STAT_SAMPLE_MEDIAN, INNER); 28 if (!status) continue; 32 if (!status) { 33 psFree (source); 34 continue; 35 } 29 36 30 37 status = pmSourceMoments (source, RADIUS); 31 if (!status) continue; 38 if (!status) { 39 psFree (source); 40 continue; 41 } 32 42 33 43 psArrayAdd (sources, 100, source); 44 psFree (source); 34 45 } 35 46
Note:
See TracChangeset
for help on using the changeset viewer.
