Changeset 27673
- Timestamp:
- Apr 13, 2010, 4:43:28 PM (16 years ago)
- Location:
- trunk/psphot/src
- Files:
-
- 3 edited
-
psphot.h (modified) (1 diff)
-
psphotCullPeaks.c (modified) (2 diffs)
-
psphotFindFootprints.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphot.h
r27657 r27673 177 177 psArray *psphotFindPeaks (psImage *significance, pmReadout *readout, psMetadata *recipe, const float threshold, const int nMax); 178 178 bool psphotFindFootprints (pmDetections *detections, psImage *significance, pmReadout *readout, psMetadata *recipe, const float threshold, const int pass, psImageMaskType maskVal); 179 psErrorCode psphotCullPeaks(const p sImage *img, const psImage *weight, const psMetadata *recipe, psArray *footprints);179 psErrorCode psphotCullPeaks(const pmReadout *readout, const psMetadata *recipe, psArray *footprints); 180 180 181 181 // in psphotApResid.c: -
trunk/psphot/src/psphotCullPeaks.c
r24877 r27673 5 5 */ 6 6 psErrorCode 7 psphotCullPeaks(const psImage *image, // the image wherein lives the footprint 8 const psImage *weight, // corresponding variance image 7 psphotCullPeaks(const pmReadout *readout, // the image wherein lives the footprint 9 8 const psMetadata *recipe, 10 9 psArray *footprints) { // array of pmFootprints 10 11 11 bool status = false; 12 12 13 float nsigma_delta = psMetadataLookupF32(&status, recipe, "FOOTPRINT_CULL_NSIGMA_DELTA"); 13 14 if (!status) { … … 22 23 fPadding = 0; 23 24 } 24 const float skyStdev = psMetadataLookupF32(NULL, recipe, "SKY_STDEV"); 25 const float skyStdev = psMetadataLookupF32(&status, readout->analysis, "SKY_STDEV"); 26 psAssert (status, "cannot find SKY_STDEV in readout->analysis"); 27 25 28 const float min_threshold = nsigma_min*skyStdev; 26 29 27 30 for (int i = 0; i < footprints->n; i++) { 31 // if (i % 50 == 0) fprintf (stderr, "cull %d\n", i); 28 32 pmFootprint *fp = footprints->data[i]; 29 if (pmFootprintCullPeaks(image, weight, fp, nsigma_delta, fPadding, min_threshold) != PS_ERR_NONE) { 33 if (fp->npix > 30000) { 34 fprintf (stderr, "big footprint: %f %f to %f %f (%d pix)\n", fp->bbox.x0, fp->bbox.y0, fp->bbox.x1, fp->bbox.y1, fp->npix); 35 } 36 psTimerStart ("psphot.cull.footprints"); 37 if (pmFootprintCullPeaks(readout->image, readout->variance, fp, nsigma_delta, fPadding, min_threshold) != PS_ERR_NONE) { 30 38 return psError(PS_ERR_UNKNOWN, false, "Culling pmFootprint %d", fp->id); 31 39 } 40 float dtime = psTimerMark ("psphot.cull.footprints"); 41 if (dtime > 1.0) { 42 fprintf (stderr, "slow cull for %d (%f sec)\n", i, dtime); 43 } 32 44 } 33 34 45 return PS_ERR_NONE; 35 46 } 47 48 // psLogMsg ("psphot", PS_LOG_INFO, "%ld peaks, %ld total footprints: %f sec\n", detections->peaks->n, detections->footprints->n, -
trunk/psphot/src/psphotFindFootprints.c
r26894 r27673 55 55 } 56 56 57 psphotCullPeaks(readout ->image, readout->variance, recipe, detections->footprints);57 psphotCullPeaks(readout, recipe, detections->footprints); 58 58 detections->peaks = pmFootprintArrayToPeaks(detections->footprints); 59 59 psLogMsg ("psphot", PS_LOG_INFO, "%ld peaks, %ld total footprints: %f sec\n", detections->peaks->n, detections->footprints->n, psTimerMark ("psphot.footprints"));
Note:
See TracChangeset
for help on using the changeset viewer.
