Index: trunk/psModules/src/detrend/pmShutterCorrection.c
===================================================================
--- trunk/psModules/src/detrend/pmShutterCorrection.c	(revision 21183)
+++ trunk/psModules/src/detrend/pmShutterCorrection.c	(revision 21363)
@@ -383,5 +383,5 @@
     psArray *images = psArrayAlloc(num);// Array of images
     psArray *masks = NULL; // Array of masks
-    psArray *weights = NULL; // Array of weights
+    psArray *variances = NULL; // Array of variances
     psVector *exptimes = psVectorAlloc(num, PS_TYPE_F32); // Vector of exposure times
 
@@ -392,7 +392,7 @@
             masks = psArrayAlloc(num);
         }
-        if (readout->weight)
+        if (readout->variance)
         {
-            weights = psArrayAlloc(num);
+            variances = psArrayAlloc(num);
         }
     }
@@ -472,24 +472,24 @@
         }
 
-        psImage *weight = readout->weight; // Weight map of interest
-        if (weight) {
-            if (!weights) {
-                psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Not all readouts have weights.\n");
+        psImage *variance = readout->variance; // Variance map of interest
+        if (variance) {
+            if (!variances) {
+                psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Not all readouts have variances.\n");
                 goto MEASURE_ERROR;
             }
-            weights->data[i] = psMemIncrRefCounter(weight);
-
-            if (weight->type.type != PS_TYPE_F32) {
-                psError(PS_ERR_BAD_PARAMETER_TYPE, true, "Bad type for weights: %x\n", weight->type.type);
+            variances->data[i] = psMemIncrRefCounter(variance);
+
+            if (variance->type.type != PS_TYPE_F32) {
+                psError(PS_ERR_BAD_PARAMETER_TYPE, true, "Bad type for variances: %x\n", variance->type.type);
                 goto MEASURE_ERROR;
             }
-            if (weight->numRows != numRows || weight->numCols != numCols) {
+            if (variance->numRows != numRows || variance->numCols != numCols) {
                 psError(PS_ERR_BAD_PARAMETER_SIZE, true,
-                        "Weight sizes don't match: %dx%d vs %dx%d\n", weight->numCols, weight->numRows,
+                        "Variance sizes don't match: %dx%d vs %dx%d\n", variance->numCols, variance->numRows,
                         numCols, numRows);
                 goto MEASURE_ERROR;
             }
-        } else if (weights) {
-            psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Not all readouts have weights.\n");
+        } else if (variances) {
+            psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Not all readouts have variances.\n");
             goto MEASURE_ERROR;
         }
@@ -566,12 +566,12 @@
     psTrace("psModules.detrend", 3, "Mean reference value: %f\n", meanRef);
 
-    // Check the weights
-    if (weights && nIter > 1) {
-        for (int i = 0; i < weights->n && nIter > 1; i++) {
-            psImage *weight = weights->data[i]; // Weight image
-            if (!weight) {
-                // We don't have weights, so no realistic errors: turn off iteration
+    // Check the variances
+    if (variances && nIter > 1) {
+        for (int i = 0; i < variances->n && nIter > 1; i++) {
+            psImage *variance = variances->data[i]; // Variance image
+            if (!variance) {
+                // We don't have variances, so no realistic errors: turn off iteration
                 if (nIter > 0) {
-                    psWarning("Not all images have weights --- turning iteration off.\n");
+                    psWarning("Not all images have variances --- turning iteration off.\n");
                 }
                 nIter = 1;
@@ -594,7 +594,7 @@
                     mask->data.PS_TYPE_VECTOR_MASK_DATA[i] = (maskImage->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & maskVal);
                 }
-                psImage *weight;        // Weight image
-                if (weights && (weight = weights->data[i])) {
-                    errors->data.F32[i] = sqrtf(weight->data.F32[y][x]) * refs->data.F32[i];
+                psImage *variance;        // Variance image
+                if (variances && (variance = variances->data[i])) {
+                    errors->data.F32[i] = sqrtf(variance->data.F32[y][x]) * refs->data.F32[i];
                 } else {
                     errors->data.F32[i] = sqrtf(image->data.F32[y][x]) * refs->data.F32[i];
@@ -645,5 +645,5 @@
     psFree(images);
     psFree(masks);
-    psFree(weights);
+    psFree(variances);
     psFree(refs);
     psFree(regions);
@@ -878,8 +878,8 @@
         PS_ASSERT_IMAGE_SIZE(readout->mask, data->numCols, data->numRows, NULL);
     }
-    if (readout->weight) {
-        PS_ASSERT_IMAGE_NON_NULL(readout->weight, NULL);
-        PS_ASSERT_IMAGE_TYPE(readout->weight, PS_TYPE_F32, NULL);
-        PS_ASSERT_IMAGE_SIZE(readout->weight, data->numCols, data->numRows, NULL);
+    if (readout->variance) {
+        PS_ASSERT_IMAGE_NON_NULL(readout->variance, NULL);
+        PS_ASSERT_IMAGE_TYPE(readout->variance, PS_TYPE_F32, NULL);
+        PS_ASSERT_IMAGE_SIZE(readout->variance, data->numCols, data->numRows, NULL);
     }
 
@@ -1133,6 +1133,6 @@
                     mask->data.PS_TYPE_VECTOR_MASK_DATA[r] = (readout->mask->data.PS_TYPE_IMAGE_MASK_DATA[yIn][xIn] & maskVal);
                 }
-                if (readout->weight) {
-                    errors->data.F32[r] = sqrtf(readout->weight->data.F32[yIn][xIn]) * ref;
+                if (readout->variance) {
+                    errors->data.F32[r] = sqrtf(readout->variance->data.F32[yIn][xIn]) * ref;
                 } else {
                     // XXX guess that the input data is Poisson distributed; if we go negative, force high
