Index: /trunk/psModules/src/objects/pmModel.c
===================================================================
--- /trunk/psModules/src/objects/pmModel.c	(revision 15699)
+++ /trunk/psModules/src/objects/pmModel.c	(revision 15700)
@@ -6,6 +6,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-11-27 21:16:45 $
+ *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-11-27 22:23:16 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -236,8 +236,9 @@
             myRx = psImageAlloc (image->numCols, image->numRows, PS_TYPE_F32);
             myRy = psImageAlloc (image->numCols, image->numRows, PS_TYPE_F32);
-            dx = (int)(inRx->numCols / 2) - (xPos - image->col0);
-            dy = (int)(inRx->numCols / 2) - (xPos - image->col0);
+            // Difference between input and desired centres
+            int xDiff = (int)(inRx->numCols / 2) - (xPos - image->col0);
+            int yDiff = (int)(inRy->numRows / 2) - (yPos - image->row0);
             for (int iy = 0; iy < myRo->numRows; iy++) {
-                int jy = iy + dy;
+                int jy = iy + yDiff;
                 if ((jy < 0) || (jy >= inRo->numRows)) {
                     for (int ix = 0; ix < myRo->numCols; ix++) {
@@ -249,5 +250,5 @@
                 }
                 for (int ix = 0; ix < myRo->numCols; ix++) {
-                    int jx = ix + dx;
+                    int jx = ix + xDiff;
                     if ((jx < 0) || (jx >= inRo->numCols)) {
                         myRo->data.F32[iy][ix] = 0.0;
