Changeset 20829
- Timestamp:
- Nov 25, 2008, 2:41:54 PM (17 years ago)
- Location:
- trunk/psphot/src
- Files:
-
- 4 edited
-
psphotFindFootprints.c (modified) (4 diffs)
-
psphotReadout.c (modified) (1 diff)
-
psphotSignificanceImage.c (modified) (2 diffs)
-
psphotSourceSize.c (modified) (1 diff)
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 -
trunk/psphot/src/psphotReadout.c
r20464 r20829 7 7 psphotModelClassInit (); // load implementation-specific models 8 8 psphotSetThreads (); 9 psImageConvolveSetThreads(true);10 9 return true; 11 10 } -
trunk/psphot/src/psphotSignificanceImage.c
r20463 r20829 12 12 // smooth the image and weight map 13 13 psTimerStart ("psphot.smooth"); 14 psImageConvolveSetThreads(true);14 bool oldThreads = psImageConvolveSetThreads(true); // Old value of threading in psImageConvolve 15 15 16 16 // XXX we can a) choose fft to convolve if needed and b) multithread fftw … … 128 128 129 129 psFree(smooth_wt); 130 131 psImageConvolveSetThreads(oldThreads); 132 130 133 return smooth_im; 131 134 } 132 135 133 # if (0) 134 { 136 # if (0) 137 { 135 138 // threadingdemo 136 139 // smooth the image, applying the mask as we go -
trunk/psphot/src/psphotSourceSize.c
r20453 r20829 218 218 // now that we have masked pixels associated with CRs, we can grow the mask 219 219 if (grow > 0) { 220 bool oldThreads = psImageConvolveThreads(true); // Old value of threading for psImageConvolveMask 220 221 psImage *newMask = psImageConvolveMask(NULL, readout->mask, crMask, crMask, -grow, grow, -grow, grow); 222 psImageConvolveThreads(oldThreads); 221 223 if (!newMask) { 222 224 psError(PS_ERR_UNKNOWN, false, "Unable to grow CR mask");
Note:
See TracChangeset
for help on using the changeset viewer.
