Index: trunk/psModules/src/camera/pmFPAMosaic.c
===================================================================
--- trunk/psModules/src/camera/pmFPAMosaic.c	(revision 21183)
+++ trunk/psModules/src/camera/pmFPAMosaic.c	(revision 21363)
@@ -554,14 +554,14 @@
         // We have to do all of the hard work ourselves
         switch (type) {
-	    FILL_IN(U8);
-	    FILL_IN(U16);
-	    FILL_IN(U32);
-	    FILL_IN(U64);
-	    FILL_IN(S8);
-	    FILL_IN(S16);
-	    FILL_IN(S32);
-	    FILL_IN(S64);
-	    FILL_IN(F32);
-	    FILL_IN(F64);
+            FILL_IN(U8);
+            FILL_IN(U16);
+            FILL_IN(U32);
+            FILL_IN(U64);
+            FILL_IN(S8);
+            FILL_IN(S16);
+            FILL_IN(S32);
+            FILL_IN(S64);
+            FILL_IN(F32);
+            FILL_IN(F64);
           default:
             psAbort("Should never get here.\n");
@@ -575,5 +575,5 @@
 static bool addCell(psArray *images,    // Array of images
                     psArray *masks,     // Array of masks
-                    psArray *weights,   // Array of weights
+                    psArray *variances,   // Array of variances
                     psVector *x0,       // Array of X0
                     psVector *y0,       // Array of Y0
@@ -604,5 +604,5 @@
         images  = psArrayRealloc(images,  index + CELL_LIST_BUFFER);
         masks   = psArrayRealloc(masks,   index + CELL_LIST_BUFFER);
-        weights = psArrayRealloc(weights, index + CELL_LIST_BUFFER);
+        variances = psArrayRealloc(variances, index + CELL_LIST_BUFFER);
         x0    = psVectorRealloc(x0,    index+ CELL_LIST_BUFFER);
         y0    = psVectorRealloc(y0,    index+ CELL_LIST_BUFFER);
@@ -615,5 +615,5 @@
     images->n = index + 1;
     masks->n = index + 1;
-    weights->n = index + 1;
+    variances->n = index + 1;
     x0->n = index + 1;
     y0->n = index + 1;
@@ -726,5 +726,5 @@
     // The images to put into the mosaic
     images->data[index]  = psMemIncrRefCounter(readout->image);
-    weights->data[index] = psMemIncrRefCounter(readout->weight);
+    variances->data[index] = psMemIncrRefCounter(readout->variance);
     masks->data[index]   = psMemIncrRefCounter(readout->mask);
 
@@ -740,5 +740,5 @@
 static bool chipMosaic(psImage **mosaicImage, // The mosaic image, to be returned
                        psImage **mosaicMask, // The mosaic mask, to be returned
-                       psImage **mosaicWeights, // The mosaic weights, to be returned
+                       psImage **mosaicVariances, // The mosaic variances, to be returned
                        int *xBinChip, int *yBinChip, // The binning in x and y, to be returned
                        const pmChip *chip, // Chip to mosaic
@@ -749,5 +749,5 @@
     assert(mosaicImage);
     assert(mosaicMask);
-    assert(mosaicWeights);
+    assert(mosaicVariances);
     assert(xBinChip);
     assert(yBinChip);
@@ -756,5 +756,5 @@
 
     psArray *images = psArrayAlloc(0); // Array of images that will be mosaicked
-    psArray *weights = psArrayAlloc(0); // Array of weight images to be mosaicked
+    psArray *variances = psArrayAlloc(0); // Array of variance images to be mosaicked
     psArray *masks = psArrayAlloc(0); // Array of mask images to be mosaicked
     psVector *x0 = psVectorAlloc(0, PS_TYPE_S32); // Origin x coordinates
@@ -802,5 +802,5 @@
             continue;
         }
-        allGood &= addCell(images, masks, weights, x0, y0, xBin, yBin, xFlip, yFlip,
+        allGood &= addCell(images, masks, variances, x0, y0, xBin, yBin, xFlip, yFlip,
                            cell, xBinChip, yBinChip, false, x0Target, y0Target,
                            xParityTarget, yParityTarget);
@@ -826,5 +826,5 @@
     if (allGood) {
         *mosaicImage = imageMosaic(images, xFlip, yFlip, xBin, yBin, *xBinChip, *yBinChip, x0, y0, BLANK_VALUE);
-        *mosaicWeights = imageMosaic(weights, xFlip, yFlip, xBin, yBin, *xBinChip, *yBinChip, x0, y0, BLANK_VALUE);
+        *mosaicVariances = imageMosaic(variances, xFlip, yFlip, xBin, yBin, *xBinChip, *yBinChip, x0, y0, BLANK_VALUE);
         *mosaicMask = imageMosaic(masks, xFlip, yFlip, xBin, yBin, *xBinChip, *yBinChip, x0, y0, blank);
     }
@@ -832,5 +832,5 @@
     // Clean up
     psFree(images);
-    psFree(weights);
+    psFree(variances);
     psFree(masks);
     psFree(xFlip);
@@ -847,5 +847,5 @@
 static bool fpaMosaic(psImage **mosaicImage, // The mosaic image, to be returned
                       psImage **mosaicMask, // The mosaic mask, to be returned
-                      psImage **mosaicWeights, // The mosaic weights, to be returned
+                      psImage **mosaicVariances, // The mosaic variances, to be returned
                       int *xBinFPA, int *yBinFPA, // The binning in x and y, to be returned
                       const pmFPA *fpa,  // FPA to mosaic
@@ -857,5 +857,5 @@
     assert(mosaicImage);
     assert(mosaicMask);
-    assert(mosaicWeights);
+    assert(mosaicVariances);
     assert(xBinFPA);
     assert(yBinFPA);
@@ -865,5 +865,5 @@
 
     psArray *images = psArrayAlloc(0); // Array of images that will be mosaicked
-    psArray *weights = psArrayAlloc(0); // Array of weight images to be mosaicked
+    psArray *variances = psArrayAlloc(0); // Array of variance images to be mosaicked
     psArray *masks = psArrayAlloc(0); // Array of mask images to be mosaicked
     psVector *x0 = psVectorAlloc(0, PS_TYPE_S32); // Origin x coordinates
@@ -941,5 +941,5 @@
                 continue;
             }
-            allGood |= addCell(images, masks, weights, x0, y0, xBin, yBin, xFlip, yFlip,
+            allGood |= addCell(images, masks, variances, x0, y0, xBin, yBin, xFlip, yFlip,
                                cell, xBinFPA, yBinFPA, true, x0Target, y0Target,
                                xParityTarget, yParityTarget);
@@ -960,5 +960,5 @@
     if (allGood) {
         *mosaicImage = imageMosaic(images, xFlip, yFlip, xBin, yBin, *xBinFPA, *yBinFPA, x0, y0, BLANK_VALUE);
-        *mosaicWeights = imageMosaic(weights, xFlip, yFlip, xBin, yBin, *xBinFPA, *yBinFPA, x0, y0, BLANK_VALUE);
+        *mosaicVariances = imageMosaic(variances, xFlip, yFlip, xBin, yBin, *xBinFPA, *yBinFPA, x0, y0, BLANK_VALUE);
         *mosaicMask = imageMosaic(masks, xFlip, yFlip, xBin, yBin, *xBinFPA, *yBinFPA, x0, y0, blank);
     }
@@ -966,5 +966,5 @@
     // Clean up
     psFree(images);
-    psFree(weights);
+    psFree(variances);
     psFree(masks);
     psFree(xFlip);
@@ -1025,5 +1025,5 @@
     psImage *mosaicImage   = NULL;      // The mosaic image
     psImage *mosaicMask    = NULL;      // The mosaic mask
-    psImage *mosaicWeights = NULL;      // The mosaic weights
+    psImage *mosaicVariances = NULL;      // The mosaic variances
 
     // Find the HDU
@@ -1051,8 +1051,8 @@
             }
         }
-        if (hdu->weights) {
-            mosaicWeights = psImageSubset(hdu->weights->data[0], bounds);
-            if (!mosaicWeights) {
-                psError(PS_ERR_UNKNOWN, false, "Unable to select weight pixels.\n");
+        if (hdu->variances) {
+            mosaicVariances = psImageSubset(hdu->variances->data[0], bounds);
+            if (!mosaicVariances) {
+                psError(PS_ERR_UNKNOWN, false, "Unable to select variance pixels.\n");
                 return false;
             }
@@ -1061,5 +1061,5 @@
         // Case 2 --- we need to mosaic by cut and paste
         psTrace("psModules.camera", 1, "Case 2 mosaicking: cut and paste.\n");
-        if (!chipMosaic(&mosaicImage, &mosaicMask, &mosaicWeights, &xBin, &yBin, source, targetCell, blank)) {
+        if (!chipMosaic(&mosaicImage, &mosaicMask, &mosaicVariances, &xBin, &yBin, source, targetCell, blank)) {
             psError(PS_ERR_UNKNOWN, false, "Unable to mosaic cells.\n");
             return false;
@@ -1094,5 +1094,5 @@
     newReadout->image  = mosaicImage;
     newReadout->mask   = mosaicMask;
-    newReadout->weight = mosaicWeights;
+    newReadout->variance = mosaicVariances;
     psFree(newReadout);                 // Drop reference
 
@@ -1262,5 +1262,5 @@
     psImage *mosaicImage   = NULL;      // The mosaic image
     psImage *mosaicMask    = NULL;      // The mosaic mask
-    psImage *mosaicWeights = NULL;      // The mosaic weights
+    psImage *mosaicVariances = NULL;      // The mosaic variances
 
     // Find the HDU
@@ -1275,11 +1275,11 @@
             mosaicMask = psImageSubset(hdu->masks->data[0], *fpaRegion);
         }
-        if (hdu->weights) {
-            mosaicWeights = psImageSubset(hdu->weights->data[0], *fpaRegion);
+        if (hdu->variances) {
+            mosaicVariances = psImageSubset(hdu->variances->data[0], *fpaRegion);
         }
     } else {
         // Case 2 --- we need to mosaic by cut and paste
         psTrace("psModules.camera", 1, "Case 2 mosaicking: cut and paste.\n");
-        if (!fpaMosaic(&mosaicImage, &mosaicMask, &mosaicWeights, &xBin, &yBin, source,
+        if (!fpaMosaic(&mosaicImage, &mosaicMask, &mosaicVariances, &xBin, &yBin, source,
                        targetChip, targetCell, blank)) {
             psError(PS_ERR_UNKNOWN, false, "Unable to mosaic chips.\n");
@@ -1338,5 +1338,5 @@
     newReadout->image  = mosaicImage;
     newReadout->mask   = mosaicMask;
-    newReadout->weight = mosaicWeights;
+    newReadout->variance = mosaicVariances;
     psFree(newReadout);                 // Drop reference
 
