IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13166


Ignore:
Timestamp:
May 2, 2007, 3:00:56 PM (19 years ago)
Author:
eugene
Message:

adding optional peak limit (useful for dense fields)

File:
1 edited

Legend:

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

    r13012 r13166  
    112112    }
    113113
     114    // limit the total number of returned peak as specified
     115    if (pass == 1) {
     116        psArraySort (peaks, pmPeakSortBySN);
     117        int NMAX = psMetadataLookupS32 (&status, recipe, "PEAKS_NMAX");
     118        if (NMAX && (peaks->n > NMAX)) {
     119            psArray *tmpPeaks = psArrayAllocEmpty (NMAX);
     120            for (int i = 0; i < NMAX; i++) {
     121                psArrayAdd (tmpPeaks, 100, peaks->data[i]);
     122            }
     123            psFree (peaks);
     124            peaks = tmpPeaks;
     125        }
     126    }   
     127
    114128    // optional dump of all peak data
    115129    char *output = psMetadataLookupStr (&status, recipe, "PEAKS_OUTPUT_FILE");
     
    118132    }
    119133    psLogMsg ("psphot", PS_LOG_INFO, "%ld peaks: %f sec\n", peaks->n, psTimerMark ("psphot"));
    120     //
     134
    121135    // If they asked us to return a set of pmFootprints, not a raw pmPeak list,
    122136    // go ahead and find the footprints, and assign them their peaks.
Note: See TracChangeset for help on using the changeset viewer.