Index: trunk/psModules/src/objects/pmSourcePhotometry.c
===================================================================
--- trunk/psModules/src/objects/pmSourcePhotometry.c	(revision 9843)
+++ trunk/psModules/src/objects/pmSourcePhotometry.c	(revision 9866)
@@ -3,6 +3,6 @@
  *  @author EAM, IfA; GLG, MHPCC
  *
- *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-11-03 15:21:15 $
+ *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-11-06 02:11:04 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -182,68 +182,4 @@
 }
 
-// XXX the implemented version of psImageShift does not work (is inconsistent wrt psImageInterpolate frac pix def?)
-psImage *tmp_psImageShift (psImage *in, float dx, float dy)
-{
-
-    int nx = in->numCols;
-    int ny = in->numRows;
-
-    psImage *out = psImageAlloc (nx, ny, PS_TYPE_F32);
-
-    // we define an integer shift and a (positive) fractional shift
-    int dxi = floor(dx);
-    int dyi = floor(dy);
-    float dxf = dx - dxi;  // +2.3 -> 2 and 0.3; -2.3 -> -3 and +0.7
-    float dyf = dy - dyi;  // +2.3 -> 2 and 0.3; -2.3 -> -3 and +0.7
-
-    // apply the integer shift
-    int DXin = (dxi < 0) ? -dxi : 0;
-    int DXot = (dxi < 0) ?   0  : dxi;
-    int DYin = (dyi < 0) ? -dyi : 0;
-    int DYot = (dyi < 0) ?   0  : dyi;
-
-    for (int j = 0; j < ny - abs(dyi); j++) {
-        for (int i = 0; i < nx - abs(dxi); i++) {
-            out->data.F32[j+DYot][i+DXot] = in->data.F32[j+DYin][i+DXin];
-        }
-        // fill in the exposed x-border with 0.0
-        int pix = (dxi > 0) ? 0 : nx - abs(dxi);
-        for (int i = 0; i < abs(dxi); i++, pix++) {
-            out->data.F32[j+DYot][pix] = 0.0;
-        }
-    }
-
-    // fill in the exposed y-border with 0.0
-    int pix = (dyi > 0) ? 0 : ny - abs(dyi);
-    for (int j = 0; j < abs(dyi); j++, pix++) {
-        for (int i = 0; i < nx; i++) {
-            out->data.F32[pix][i] = 0.0;
-        }
-    }
-
-    // apply the fractional shift
-    if ((dxf > 0) || (dyf > 0)) {
-        float value;
-
-        double f00 =    dxf *   dyf;
-        double f01 =    dxf *(1-dyf);
-        double f10 = (1-dxf)*   dyf;
-        double f11 = (1-dxf)*(1-dyf);
-
-        for (int j = ny - 2; j >= 0; j--) {
-            psF32 *V0 = out->data.F32[j+0];
-            psF32 *V1 = out->data.F32[j+1];
-            for (int i = nx - 2; i >= 0; i--, V0--, V1--) {
-                value  = V0[0] * f00;
-                value += V0[1] * f10;
-                value += V1[0] * f01;
-                value += V1[1] * f11;
-                V1[1] = value;
-            }
-        }
-    }
-    return out;
-}
-
 // return source aperture magnitude
 // interpolate the image pixels to place the center at xi+0.5,yi+0.5
@@ -265,8 +201,10 @@
 
     // shift image to have centroid at xi+0.5, yi+0.5
-    # if (1)
+    # if (0)
+        // this is necessary to make the measurement consistent with the growth model.
+        // only do this if we are applying the model?
         float dx = 0.5 - model->params->data.F32[PM_PAR_XPOS] + (int)model->params->data.F32[PM_PAR_XPOS];
     float dy = 0.5 - model->params->data.F32[PM_PAR_YPOS] + (int)model->params->data.F32[PM_PAR_YPOS];
-    psImage *tmpImage = tmp_psImageShift (image, dx, dy);
+    psImage *tmpImage = psImageShift (NULL, image, dx, dy, 0.0, PS_INTERPOLATE_BICUBE);
     # else
 
