Index: trunk/psModules/src/objects/pmPeaks.c
===================================================================
--- trunk/psModules/src/objects/pmPeaks.c	(revision 13034)
+++ trunk/psModules/src/objects/pmPeaks.c	(revision 14652)
@@ -6,6 +6,6 @@
  *  @author EAM, IfA: significant modifications.
  *
- *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-04-26 01:20:29 $
+ *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-08-24 00:11:02 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -35,5 +35,5 @@
                         pmPeakType type)
 {
-    psTrace(__func__, 5, "---- begin ----\n");
+    psTrace("psModules.objects", 5, "---- begin ----\n");
 
     if (peaks == NULL) {
@@ -67,5 +67,5 @@
     psFree (peak);
 
-    psTrace(__func__, 5, "---- end ----\n");
+    psTrace("psModules.objects", 5, "---- end ----\n");
     return(peaks);
 }
@@ -118,5 +118,5 @@
 *****************************************************************************/
 static void peakFree(pmPeak *tmp)
-{} // used by pmIsPeak()
+{} // used by pmPeakTest()
 
 pmPeak *pmPeakAlloc(psS32 x,
@@ -145,5 +145,5 @@
 }
 
-bool pmIsPeak(const psPtr ptr)
+bool pmPeakTest(const psPtr ptr)
 {
     return (psMemGetDeallocator(ptr) == (psFreeFunc)peakFree);
@@ -193,5 +193,5 @@
 
 /******************************************************************************
-pmFindVectorPeaks(vector, threshold): Find all local peaks in the given vector
+pmPeaksInVector(vector, threshold): Find all local peaks in the given vector
 above the given threshold.  Returns a vector of type PS_TYPE_U32 containing
 the location (x value) of all peaks.
@@ -203,6 +203,6 @@
 Depending upon actual use, this may need to be optimized.
 *****************************************************************************/
-psVector *pmFindVectorPeaks(const psVector *vector,
-                            psF32 threshold)
+psVector *pmPeaksInVector(const psVector *vector,
+			 psF32 threshold)
 {
     psTrace("psModules.objects", 3, "---- %s() begin ----\n", __func__);
@@ -295,5 +295,5 @@
 
 /******************************************************************************
-pmFindImagePeaks(image, threshold): Find all local peaks in the given psImage
+pmPeaksInImage(image, threshold): Find all local peaks in the given psImage
 above the given threshold.  Returns a psArray containing location (x/y value)
 of all peaks.
@@ -309,5 +309,5 @@
 
 *****************************************************************************/
-psArray *pmFindImagePeaks(const psImage *image, psF32 threshold)
+psArray *pmPeaksInImage(const psImage *image, psF32 threshold)
 {
     psTrace("psModules.objects", 3, "---- %s() begin ----\n", __func__);
@@ -327,6 +327,6 @@
     row = 0;
     tmpRow = getRowVectorFromImage((psImage *) image, row);
-    psVector *row1 = pmFindVectorPeaks(tmpRow, threshold);
-    // pmFindVectorPeaks returns coords in the vector, not corrected for col0
+    psVector *row1 = pmPeaksInVector(tmpRow, threshold);
+    // pmPeaksInVector returns coords in the vector, not corrected for col0
 
     for (psU32 i = 0 ; i < row1->n ; i++ ) {
@@ -382,5 +382,5 @@
     for (row = 1 ; row < (image->numRows - 1) ; row++) {
         tmpRow = getRowVectorFromImage((psImage *) image, row);
-        row1 = pmFindVectorPeaks(tmpRow, threshold);
+        row1 = pmPeaksInVector(tmpRow, threshold);
 
         // Step through all local peaks in this row.
@@ -461,5 +461,5 @@
     row = image->numRows - 1;
     tmpRow = getRowVectorFromImage((psImage *) image, row);
-    row1 = pmFindVectorPeaks(tmpRow, threshold);
+    row1 = pmPeaksInVector(tmpRow, threshold);
     for (psU32 i = 0 ; i < row1->n ; i++ ) {
         col = row1->data.U32[i];
@@ -501,48 +501,6 @@
 }
 
-
-/******************************************************************************
-psCullPeaks(peaks, maxValue, valid): eliminate peaks from the psArray that have
-a peak value above the given maximum, or fall outside the valid region.
- 
-XXX: Should the sky value be used when comparing the maximum?
- 
-XXX: warning message if valid is NULL?
- 
-XXX: changed API to create a NEW output psArray (should change name as well)
- 
-XXX: Do we free the psList elements of those culled peaks?
- 
-XXX EAM : do we still need pmCullPeaks, or only pmPeaksSubset?
-*****************************************************************************/
-psList *pmCullPeaks(psList *peaks,
-                    psF32 maxValue,
-                    const psRegion valid)
-{
-    psTrace("psModules.objects", 3, "---- %s() begin ----\n", __func__);
-    PS_ASSERT_PTR_NON_NULL(peaks, NULL);
-
-    psListElem *tmpListElem = (psListElem *) peaks->head;
-    psS32 indexNum = 0;
-
-    //    printf("pmCullPeaks(): list size is %d\n", peaks->size);
-    while (tmpListElem != NULL) {
-        pmPeak *tmpPeak = (pmPeak *) tmpListElem->data;
-        if ((tmpPeak->value > maxValue) ||
-                (true == isItInThisRegion(valid, tmpPeak->x, tmpPeak->y))) {
-            psListRemoveData(peaks, (psPtr) tmpPeak);
-        }
-
-        indexNum++;
-        tmpListElem = tmpListElem->next;
-    }
-
-    psTrace("psModules.objects", 3, "---- %s() end ----\n", __func__);
-    return(peaks);
-}
-
-// XXX EAM: I changed this to return a new, subset array
-//          rather than alter the existing one
-// XXX: Fix the *valid pointer.
+// return a new array of peaks which are in the valid region and below threshold
+// XXX this function is unused and probably could be dropped
 psArray *pmPeaksSubset(
     psArray *peaks,
@@ -555,5 +513,5 @@
     psArray *output = psArrayAllocEmpty (200);
 
-    psTrace (".pmObjects.pmCullPeaks", 3, "list size is %ld\n", peaks->n);
+    psTrace ("psModules.objects", 3, "list size is %ld\n", peaks->n);
 
     for (int i = 0; i < peaks->n; i++) {
