Index: /trunk/psModules/src/camera/pmFPAMaskWeight.c
===================================================================
--- /trunk/psModules/src/camera/pmFPAMaskWeight.c	(revision 10239)
+++ /trunk/psModules/src/camera/pmFPAMaskWeight.c	(revision 10240)
@@ -207,11 +207,17 @@
     }
 
-    // Set weight image to the variance in ADU = f/g + rn^2
-    psImage *image = readout->image;    // The image pixels
-    readout->weight = (psImage*)psBinaryOp(readout->weight, image, "/", psScalarAlloc(gain, PS_TYPE_F32));
-
-    // a negative weight is non-sensical. if the image value drops below 1, the weight must be 1.
-    readout->weight = (psImage*)psUnaryOp(readout->weight, readout->weight, "abs");
-    readout->weight = (psImage*)psBinaryOp(readout->weight, readout->weight, "max", psScalarAlloc(1, PS_TYPE_F32));
+    if (gain > 0.0) {
+        // Set weight image to the variance in ADU = f/g + rn^2
+        psImage *image = readout->image;    // The image pixels
+        readout->weight = (psImage*)psBinaryOp(readout->weight, image, "/", psScalarAlloc(gain, PS_TYPE_F32));
+
+        // a negative weight is non-sensical. if the image value drops below 1, the weight must be 1.
+        readout->weight = (psImage*)psUnaryOp(readout->weight, readout->weight, "abs");
+        readout->weight = (psImage*)psBinaryOp(readout->weight, readout->weight, "max",
+                                               psScalarAlloc(1, PS_TYPE_F32));
+    } else {
+        // Gain is negative or zero --- just use the read noise
+        psImageInit(readout->weight, 0.0);
+    }
 
     readout->weight = (psImage*)psBinaryOp(readout->weight, readout->weight, "+",
