Index: /branches/eam_rel9_p0/psModules/src/objects/pmObjects.c
===================================================================
--- /branches/eam_rel9_p0/psModules/src/objects/pmObjects.c	(revision 6286)
+++ /branches/eam_rel9_p0/psModules/src/objects/pmObjects.c	(revision 6287)
@@ -6,6 +6,6 @@
  *  @author EAM, IfA: significant modifications.
  *
- *  @version $Revision: 1.5.4.4 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-01-22 21:12:19 $
+ *  @version $Revision: 1.5.4.5 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-02-01 22:24:05 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -438,7 +438,9 @@
 XXX: In the output psArray elements, should we use the image row/column offsets?
      Currently, we do not.
+XXX EAM : this function needs to return peaks in *parent* coords
  
 XXX: Merge with CVS 1.20.  This had the proper code for images with a single
 row or column.
+ 
 *****************************************************************************/
 psArray *pmFindImagePeaks(const psImage *image,
@@ -458,4 +460,7 @@
     psArray *list = NULL;
 
+    psU32 col0 = image->col0;
+    psU32 row0 = image->row0;
+
     //
     // Find peaks in row 0 only.
@@ -464,4 +469,5 @@
     tmpRow = getRowVectorFromImage((psImage *) image, row);
     psVector *row1 = pmFindVectorPeaks(tmpRow, threshold);
+    // pmFindVectorPeaks returns coords in the vector, not corrected for col0
 
     for (psU32 i = 0 ; i < row1->n ; i++ ) {
@@ -476,5 +482,5 @@
 
                 if (image->data.F32[row][col] > threshold) {
-                    list = myListAddPeak(list, row, col, image->data.F32[row][col], PM_PEAK_EDGE);
+                    list = myListAddPeak(list, row + row0, col + col0, image->data.F32[row][col], PM_PEAK_EDGE);
                 }
             }
@@ -486,5 +492,5 @@
                     (image->data.F32[row][col] >= image->data.F32[row+1][col+1])) {
                 if (image->data.F32[row][col] > threshold) {
-                    list = myListAddPeak(list, row, col, image->data.F32[row][col], PM_PEAK_EDGE);
+                    list = myListAddPeak(list, row + row0, col + col0, image->data.F32[row][col], PM_PEAK_EDGE);
                 }
             }
@@ -495,5 +501,5 @@
                     (image->data.F32[row][col] >= image->data.F32[row+1][col-1])) {
                 if (image->data.F32[row][col] > threshold) {
-                    list = myListAddPeak(list, row, col, image->data.F32[row][col], PM_PEAK_EDGE);
+                    list = myListAddPeak(list, row + row0, col + col0, image->data.F32[row][col], PM_PEAK_EDGE);
                 }
             }
@@ -534,5 +540,5 @@
                         (image->data.F32[row][col] >= image->data.F32[row+1][col+1])) {
                     myType = PM_PEAK_EDGE;
-                    list = myListAddPeak(list, row, col, image->data.F32[row][col], myType);
+                    list = myListAddPeak(list, row + row0, col + col0, image->data.F32[row][col], myType);
                 }
             } else if (col < (image->numCols - 1)) {
@@ -569,5 +575,5 @@
                         }
 
-                        list = myListAddPeak(list, row, col, image->data.F32[row][col], myType);
+                        list = myListAddPeak(list, row + row0, col + col0, image->data.F32[row][col], myType);
                     }
                 }
@@ -581,5 +587,5 @@
                         (image->data.F32[row][col] >= image->data.F32[row+1][col])) {
                     myType = PM_PEAK_EDGE;
-                    list = myListAddPeak(list, row, col, image->data.F32[row][col], myType);
+                    list = myListAddPeak(list, row + row0, col + col0, image->data.F32[row][col], myType);
                 }
             } else {
@@ -605,5 +611,5 @@
                     (image->data.F32[row][col] >  image->data.F32[row][col+1])) {
                 if (image->data.F32[row][col] > threshold) {
-                    list = myListAddPeak(list, row, col, image->data.F32[row][col], PM_PEAK_EDGE);
+                    list = myListAddPeak(list, row + row0, col + col0, image->data.F32[row][col], PM_PEAK_EDGE);
                 }
             }
@@ -615,5 +621,5 @@
                     (image->data.F32[row][col] >= image->data.F32[row][col+1])) {
                 if (image->data.F32[row][col] > threshold) {
-                    list = myListAddPeak(list, row, col, image->data.F32[row][col], PM_PEAK_EDGE);
+                    list = myListAddPeak(list, row + row0, col + col0, image->data.F32[row][col], PM_PEAK_EDGE);
                 }
             }
@@ -624,5 +630,5 @@
                     (image->data.F32[row][col] >  image->data.F32[row][col-1])) {
                 if (image->data.F32[row][col] > threshold) {
-                    list = myListAddPeak(list, row, col, image->data.F32[row][col], PM_PEAK_EDGE);
+                    list = myListAddPeak(list, row + row0, col + col0, image->data.F32[row][col], PM_PEAK_EDGE);
                 }
             }
@@ -730,4 +736,5 @@
 XXX: Sync with IfA on whether the peak x/y coords are data structure coords,
      or they use the image row/column offsets.
+XXX  EAM : peak->x,y uses parent coordinates
  
 XXX: Should we simply set pmSource->peak = peak?  If so, should we increase
@@ -1204,5 +1211,6 @@
 
         // XXX EAM : can we use the value of SATURATE if mask is NULL?
-        inner = psRegionForSquare (tmpSrc->peak->x - tmpSrc->mask->col0, tmpSrc->peak->y - tmpSrc->mask->row0, 2);
+        // inner = psRegionForSquare (tmpSrc->peak->x - tmpSrc->mask->col0, tmpSrc->peak->y - tmpSrc->mask->row0, 2);
+        inner = psRegionForSquare (tmpSrc->peak->x, tmpSrc->peak->y, 2);
         int Nsatpix = psImageCountPixelMask (tmpSrc->mask, inner, PSPHOT_MASK_SATURATED);
 
