Index: trunk/psModules/src/camera/pmFPAMaskWeight.c
===================================================================
--- trunk/psModules/src/camera/pmFPAMaskWeight.c	(revision 10245)
+++ trunk/psModules/src/camera/pmFPAMaskWeight.c	(revision 10247)
@@ -188,5 +188,5 @@
 }
 
-bool pmReadoutSetWeight(pmReadout *readout)
+bool pmReadoutSetWeight(pmReadout *readout, bool poisson)
 {
     PS_ASSERT_PTR_NON_NULL(readout, false);
@@ -207,5 +207,5 @@
     }
 
-    if (gain > 0.0) {
+    if (poisson) {
         // Set weight image to the variance in ADU = f/g + rn^2
         psImage *image = readout->image;    // The image pixels
@@ -217,5 +217,5 @@
                                                psScalarAlloc(1, PS_TYPE_F32));
     } else {
-        // Gain is negative or zero --- just use the read noise
+        // Just use the read noise
         if (!readout->weight) {
             readout->weight = psImageAlloc(readout->image->numCols, readout->image->numRows, PS_TYPE_F32);
@@ -230,5 +230,5 @@
 }
 
-bool pmReadoutGenerateWeight(pmReadout *readout)
+bool pmReadoutGenerateWeight(pmReadout *readout, bool poisson)
 {
     PS_ASSERT_PTR_NON_NULL(readout, false);
@@ -273,8 +273,8 @@
     }
 
-    return pmReadoutSetWeight(readout);
-}
-
-bool pmReadoutGenerateMaskWeight(pmReadout *readout)
+    return pmReadoutSetWeight(readout, poisson);
+}
+
+bool pmReadoutGenerateMaskWeight(pmReadout *readout, bool poisson)
 {
     PS_ASSERT_PTR_NON_NULL(readout, false);
@@ -283,10 +283,10 @@
 
     success |= pmReadoutGenerateMask(readout);
-    success |= pmReadoutGenerateWeight(readout);
+    success |= pmReadoutGenerateWeight(readout, poisson);
 
     return success;
 }
 
-bool pmCellGenerateMaskWeight(pmCell *cell)
+bool pmCellGenerateMaskWeight(pmCell *cell, bool poisson)
 {
     PS_ASSERT_PTR_NON_NULL(cell, false);
@@ -296,5 +296,5 @@
     for (int i = 0; i < readouts->n; i++) {
         pmReadout *readout = readouts->data[i]; // The readout
-        pmReadoutGenerateMaskWeight(readout);
+        pmReadoutGenerateMaskWeight(readout, poisson);
     }
 
