Changeset 20829 for trunk/psphot/src/psphotFindFootprints.c
- Timestamp:
- Nov 25, 2008, 2:41:54 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotFindFootprints.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotFindFootprints.c
r20453 r20829 12 12 float FOOTPRINT_NSIGMA_LIMIT; 13 13 if (pass == 1) { 14 FOOTPRINT_NSIGMA_LIMIT = psMetadataLookupS32(&status, recipe, "FOOTPRINT_NSIGMA_LIMIT");14 FOOTPRINT_NSIGMA_LIMIT = psMetadataLookupS32(&status, recipe, "FOOTPRINT_NSIGMA_LIMIT"); 15 15 } else { 16 FOOTPRINT_NSIGMA_LIMIT = psMetadataLookupS32(&status, recipe, "FOOTPRINT_NSIGMA_LIMIT_2");16 FOOTPRINT_NSIGMA_LIMIT = psMetadataLookupS32(&status, recipe, "FOOTPRINT_NSIGMA_LIMIT_2"); 17 17 } 18 18 PS_ASSERT (status, false); … … 25 25 int growRadius = 0; 26 26 if (pass == 1) { 27 growRadius = psMetadataLookupS32(&status, recipe, "FOOTPRINT_GROW_RADIUS");27 growRadius = psMetadataLookupS32(&status, recipe, "FOOTPRINT_GROW_RADIUS"); 28 28 } else { 29 growRadius = psMetadataLookupS32(&status, recipe, "FOOTPRINT_GROW_RADIUS_2");29 growRadius = psMetadataLookupS32(&status, recipe, "FOOTPRINT_GROW_RADIUS_2"); 30 30 } 31 31 PS_ASSERT (status, false); 32 32 33 // find the raw footprints & assign the peaks to those footprints 33 // find the raw footprints & assign the peaks to those footprints 34 34 psArray *footprints = pmFootprintsFind (significance, threshold, npixMin); 35 35 … … 38 38 39 39 // footprints now owns the peaks; after culling (below), we will rebuild the peaks array 40 psFree (detections->peaks); 40 psFree (detections->peaks); 41 41 42 42 psLogMsg ("psphot", PS_LOG_MINUTIA, "found %ld footprints: %f sec\n", footprints->n, psTimerMark ("psphot.footprints")); … … 44 44 // optionally grow footprints isotropically by growRadius pixels 45 45 if (growRadius > 0) { 46 psArray *tmp = pmFootprintArrayGrow(footprints, growRadius); 47 psLogMsg ("psphot", PS_LOG_MINUTIA, "grow footprint coverage by %d pixels, %ld footprints become %ld footprints: %f sec\n", growRadius, footprints->n, tmp->n, psTimerMark ("psphot.footprints")); 48 psFree(footprints); 49 footprints = tmp; 46 bool oldThreads = psImageConvolveThreads(true); // Old value of threading for psImageConvolve 47 psArray *tmp = pmFootprintArrayGrow(footprints, growRadius); 48 psImageConvolveThreads(oldThreads); 49 psLogMsg ("psphot", PS_LOG_MINUTIA, "grow footprint coverage by %d pixels, %ld footprints become %ld footprints: %f sec\n", growRadius, footprints->n, tmp->n, psTimerMark ("psphot.footprints")); 50 psFree(footprints); 51 footprints = tmp; 50 52 } 51 53 52 54 if (pass == 2) { 53 // merge in old peaks; 54 const int includePeaks = 0x0 | 0x2; // i.e. just from newFootprints 55 56 // XXX EAM : still not sure I understand this: are we double-couning or undercounting peaks 55 // merge in old peaks; 56 const int includePeaks = 0x0 | 0x2; // i.e. just from newFootprints 57 57 58 psArray *mergedFootprints = pmFootprintArraysMerge(detections->footprints, footprints, includePeaks); 59 psLogMsg ("psphot", PS_LOG_MINUTIA, "merged %ld new footprints with %ld existing ones: %f sec\n", footprints->n, detections->footprints->n, psTimerMark ("psphot.footprints")); 58 // XXX EAM : still not sure I understand this: are we double-couning or undercounting peaks 60 59 61 psFree(footprints); 62 psFree(detections->footprints); 63 detections->footprints = mergedFootprints; 60 psArray *mergedFootprints = pmFootprintArraysMerge(detections->footprints, footprints, includePeaks); 61 psLogMsg ("psphot", PS_LOG_MINUTIA, "merged %ld new footprints with %ld existing ones: %f sec\n", footprints->n, detections->footprints->n, psTimerMark ("psphot.footprints")); 62 63 psFree(footprints); 64 psFree(detections->footprints); 65 detections->footprints = mergedFootprints; 64 66 } else { 65 detections->footprints = footprints;67 detections->footprints = footprints; 66 68 } 67 69
Note:
See TracChangeset
for help on using the changeset viewer.
