IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 20177


Ignore:
Timestamp:
Oct 15, 2008, 11:14:18 AM (18 years ago)
Author:
Paul Price
Message:

Avoiding assertion: "pmFootprintsAssignPeaks: Assertion `peaks != ((void *)0)' failed."

File:
1 edited

Legend:

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

    r19910 r20177  
    2020    // on first pass, detections have not yet been allocated
    2121    if (!detections) {
    22         detections = pmDetectionsAlloc();
    23         pass = 1;
     22        detections = pmDetectionsAlloc();
     23        pass = 1;
    2424        NSIGMA_PEAK = psMetadataLookupF32 (&status, recipe, "PEAKS_NSIGMA_LIMIT"); PS_ASSERT (status, NULL);
    2525        NMAX = psMetadataLookupS32 (&status, recipe, "PEAKS_NMAX"); PS_ASSERT (status, NULL);
    2626    } else {
    27         pass = 2;
     27        pass = 2;
    2828        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) ?
     29        NMAX = 0; // unlimited number of peaks in final pass: allow a limit (PEAKS_NMAX_2) ?
    3030    }
    3131
    3232    float threshold = PS_SQR(NSIGMA_PEAK);
    3333
    34     // move the old peaks array (if it exists) to oldPeaks 
     34    // move the old peaks array (if it exists) to oldPeaks
    3535    // XXX generically, we should be able to call this function an arbitrary number of times
    3636    assert (detections->oldPeaks == NULL);
     
    4747    detections->peaks = psphotFindPeaks (significance, readout, recipe, threshold, NMAX);
    4848    psMetadataAddF32  (recipe, PS_LIST_TAIL, "PEAK_THRESHOLD", PS_META_REPLACE, "Peak Detection Threshold", threshold);
     49    if (!detections->peaks) {
     50        // No peaks found
     51        return NULL;
     52    }
    4953
    5054    // optionally merge peaks into footprints
    5155    if (useFootprints) {
    52         psphotFindFootprints (detections, significance, readout, recipe, pass, maskVal);
     56        psphotFindFootprints (detections, significance, readout, recipe, pass, maskVal);
    5357    }
    5458
Note: See TracChangeset for help on using the changeset viewer.