IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27673


Ignore:
Timestamp:
Apr 13, 2010, 4:43:28 PM (16 years ago)
Author:
eugene
Message:

psphotCullPeaks now takes a pmReadout so we can get to readout->analysis; add some verbosity to psphotCullPeaks

Location:
trunk/psphot/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphot.h

    r27657 r27673  
    177177psArray        *psphotFindPeaks (psImage *significance, pmReadout *readout, psMetadata *recipe, const float threshold, const int nMax);
    178178bool            psphotFindFootprints (pmDetections *detections, psImage *significance, pmReadout *readout, psMetadata *recipe, const float threshold, const int pass, psImageMaskType maskVal);
    179 psErrorCode     psphotCullPeaks(const psImage *img, const psImage *weight, const psMetadata *recipe, psArray *footprints);
     179psErrorCode     psphotCullPeaks(const pmReadout *readout, const psMetadata *recipe, psArray *footprints);
    180180
    181181// in psphotApResid.c:
  • trunk/psphot/src/psphotCullPeaks.c

    r24877 r27673  
    55 */
    66psErrorCode
    7 psphotCullPeaks(const psImage *image,   // the image wherein lives the footprint
    8                 const psImage *weight,  // corresponding variance image
     7psphotCullPeaks(const pmReadout *readout,   // the image wherein lives the footprint
    98                const psMetadata *recipe,
    109                psArray *footprints) {  // array of pmFootprints
     10
    1111    bool status = false;
     12
    1213    float nsigma_delta = psMetadataLookupF32(&status, recipe, "FOOTPRINT_CULL_NSIGMA_DELTA");
    1314    if (!status) {
     
    2223        fPadding = 0;
    2324    }
    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
    2528    const float min_threshold = nsigma_min*skyStdev;
    2629   
    2730    for (int i = 0; i < footprints->n; i++) {
     31        // if (i % 50 == 0) fprintf (stderr, "cull %d\n", i);
    2832        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) {
    3038            return psError(PS_ERR_UNKNOWN, false, "Culling pmFootprint %d", fp->id);
    3139        }
     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        }
    3244    }
    33    
    3445    return PS_ERR_NONE;
    3546}
     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  
    5555    }
    5656
    57     psphotCullPeaks(readout->image, readout->variance, recipe, detections->footprints);
     57    psphotCullPeaks(readout, recipe, detections->footprints);
    5858    detections->peaks = pmFootprintArrayToPeaks(detections->footprints);
    5959    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.