Index: trunk/psModules/src/camera/pmFPAExtent.c
===================================================================
--- trunk/psModules/src/camera/pmFPAExtent.c	(revision 20635)
+++ trunk/psModules/src/camera/pmFPAExtent.c	(revision 21363)
@@ -16,5 +16,5 @@
     }
     if (!image) {
-        image = readout->weight;
+        image = readout->variance;
     }
 
@@ -23,22 +23,22 @@
 
     if (!image) {
-	pmHDU *hdu = pmHDUFromReadout (readout);
-	if (hdu && hdu->header) {
-	    bool status;
-	    xSize = psMetadataLookupS32(&status, hdu->header, "NAXIS1");
-	    if (!status) {
-		xSize = psMetadataLookupS32(&status, hdu->header, "IMNAXIS1");
-		if (!status) return NULL;
-	    }		
-	    ySize = psMetadataLookupS32(&status, hdu->header, "NAXIS2");
-	    if (!status) {
-		ySize = psMetadataLookupS32(&status, hdu->header, "IMNAXIS2");
-		if (!status) return NULL;
-	    }		
-	} else {
+        pmHDU *hdu = pmHDUFromReadout (readout);
+        if (hdu && hdu->header) {
+            bool status;
+            xSize = psMetadataLookupS32(&status, hdu->header, "NAXIS1");
+            if (!status) {
+                xSize = psMetadataLookupS32(&status, hdu->header, "IMNAXIS1");
+                if (!status) return NULL;
+            }
+            ySize = psMetadataLookupS32(&status, hdu->header, "NAXIS2");
+            if (!status) {
+                ySize = psMetadataLookupS32(&status, hdu->header, "IMNAXIS2");
+                if (!status) return NULL;
+            }
+        } else {
         // Don't have anything to base the true extent on, so have to give the hardwired value (largest possible extent)
-	    xSize = psMetadataLookupS32(NULL, readout->parent->concepts, "CELL.XSIZE");
-	    ySize = psMetadataLookupS32(NULL, readout->parent->concepts, "CELL.YSIZE");
-	}
+            xSize = psMetadataLookupS32(NULL, readout->parent->concepts, "CELL.XSIZE");
+            ySize = psMetadataLookupS32(NULL, readout->parent->concepts, "CELL.YSIZE");
+        }
         return psRegionAlloc(0, xSize, 0, ySize);
     }
@@ -70,10 +70,10 @@
     // Don't have anything to base the true extent on, so have to give the hardwired value (largest possible extent)
     if (readouts->n == 0) {
-	int xSize = psMetadataLookupS32(NULL, cell->concepts, "CELL.XSIZE");
-	int ySize = psMetadataLookupS32(NULL, cell->concepts, "CELL.YSIZE");
-	cellExtent->x0 = 0;
-	cellExtent->x1 = xSize;
-	cellExtent->y0 = 0;
-	cellExtent->y1 = ySize;
+        int xSize = psMetadataLookupS32(NULL, cell->concepts, "CELL.XSIZE");
+        int ySize = psMetadataLookupS32(NULL, cell->concepts, "CELL.YSIZE");
+        cellExtent->x0 = 0;
+        cellExtent->x1 = xSize;
+        cellExtent->y0 = 0;
+        cellExtent->y1 = ySize;
     }
 
@@ -97,20 +97,20 @@
     // CELL.X0,Y0 are the coordinate of the amp on the chip, subtract size if parity flipped
     if (xParityCell > 0) {
-	cellExtent->x0 += x0;
-	cellExtent->x1 += x0;
+        cellExtent->x0 += x0;
+        cellExtent->x1 += x0;
     } else {
-	float x0Cell = x0 - cellExtent->x1;
-	float x1Cell = x0 - cellExtent->x0;
-	cellExtent->x0 = x0Cell;
-	cellExtent->x1 = x1Cell;
+        float x0Cell = x0 - cellExtent->x1;
+        float x1Cell = x0 - cellExtent->x0;
+        cellExtent->x0 = x0Cell;
+        cellExtent->x1 = x1Cell;
     }
     if (yParityCell > 0) {
-	cellExtent->y0 += y0;
-	cellExtent->y1 += y0;
+        cellExtent->y0 += y0;
+        cellExtent->y1 += y0;
     } else {
-	float y0Cell = y0 - cellExtent->y1;
-	float y1Cell = y0 - cellExtent->y0;
-	cellExtent->y0 = y0Cell;
-	cellExtent->y1 = y1Cell;
+        float y0Cell = y0 - cellExtent->y1;
+        float y1Cell = y0 - cellExtent->y0;
+        cellExtent->y0 = y0Cell;
+        cellExtent->y1 = y1Cell;
     }
 
