IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 30, 2008, 4:09:46 PM (18 years ago)
Author:
eugene
Message:

fix errors in calculation of sig image; API change: sig image is now actual S/N2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotFindDetections.c

    r17444 r17870  
    66    bool status;
    77    int pass;
     8    float NSIGMA_PEAK = 25.0;
     9    int NMAX = 0;
    810
    911    psTimerStart ("psphot");
     
    2022        detections = pmDetectionsAlloc();
    2123        pass = 1;
     24        NSIGMA_PEAK = psMetadataLookupF32 (&status, recipe, "PEAKS_NSIGMA_LIMIT"); PS_ASSERT (status, NULL);
     25        NMAX = psMetadataLookupS32 (&status, recipe, "PEAKS_NMAX"); PS_ASSERT (status, NULL);
    2226    } else {
    2327        pass = 2;
     28        NSIGMA_PEAK = psMetadataLookupF32 (&status, recipe, "PEAKS_NSIGMA_LIMIT_2"); PS_ASSERT (status, NULL);
     29        NMAX = 0; // unlimited number of peaks in final pass: allow a limit (PEAKS_NMAX_2) ?
    2430    }
     31
     32    float threshold = PS_SQR(NSIGMA_PEAK);
    2533
    2634    // move the old peaks array (if it exists) to oldPeaks
     
    3442
    3543    // detect the peaks in the significance image
    36     detections->peaks = psphotFindPeaks (significance, readout, recipe, pass, maskVal);
     44    detections->peaks = psphotFindPeaks (significance, readout, recipe, threshold, NMAX);
     45    psMetadataAddF32  (recipe, PS_LIST_TAIL, "PEAK_THRESHOLD", PS_META_REPLACE, "Peak Detection Threshold", threshold);
    3746
    3847    // optionally merge peaks into footprints
     
    4756// if we use the footprints, the output peaks list contains both old and new peaks,
    4857// otherwise it only contains the new peaks.
    49 
    50 // if psf is defined, we should treat this as pass "2", not "1".  re-define this boolean to
    51 // be "have PSF"
Note: See TracChangeset for help on using the changeset viewer.