Index: trunk/ppstamp/src/ppstampRegion.c
===================================================================
--- trunk/ppstamp/src/ppstampRegion.c	(revision 15363)
+++ trunk/ppstamp/src/ppstampRegion.c	(revision 15388)
@@ -3,4 +3,6 @@
 #include "pmHDU.h"
 #include "pmFPA.h"
+
+#include "ppstamp.h"
 
 // Functions to calculate the image space boundaries of a given Chip or Cell
@@ -20,17 +22,8 @@
     // This is the difference between this function and pmReadoutExtent. 
     // pmReadoutExtent ignores the col0, row0 of the readout
-
-    int col0 = 0;
-    int row0 = 0;
    
-#ifdef notdef
-    if (image->parent) {
-        // This is wrong. I'm trying to deal with the strange megacam 'spliced' images
-        // which appear to have inconsistant CELL.X0 and readout.col0
-        col0 = image->col0 - image->parent->col0;
-        row0 = image->row0 - image->parent->row0;
-    }
-#endif
-
+    int col0 = 0;   // should be  image->col0 - readout->col0
+    int row0 = 0;   //            image->row0 - readout->row0
+   
     return psRegionAlloc(col0, col0 + image->numCols,
                          row0, row0 + image->numRows);
@@ -99,4 +92,18 @@
     PS_ASSERT_PTR_NON_NULL(chip, NULL);
 
+    if (ppstampMegacamWorkaround) {
+        // There is an inconsistency in the megacam parameters. 
+        // The offset to the cells is effectively contained in two
+        // places.
+        // The CELL.X0 for the 2 cells are 0 and 1024 while
+        // readout->image.col0 = 32 and 1056
+        // This fact makes it impossible to calculate the Chip bounds 
+        // in a way consistent with say gpc1
+        // we're deferring that problem for now.
+        // Since all chips on megacam have the same bounds, just hard code
+        // the answer. See bug 986
+        return psRegionAlloc(32, 2080, 0, 4612);
+    }
+
     psArray *cells = chip->cells;       // Array of component cells
     psRegion *chipExtent = psRegionAlloc(INFINITY, 0, INFINITY, 0); // Extent of chip
