Index: /trunk/psModules/src/camera/pmFPAMaskWeight.c
===================================================================
--- /trunk/psModules/src/camera/pmFPAMaskWeight.c	(revision 10246)
+++ /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);
     }
 
Index: /trunk/psModules/src/camera/pmFPAMaskWeight.h
===================================================================
--- /trunk/psModules/src/camera/pmFPAMaskWeight.h	(revision 10246)
+++ /trunk/psModules/src/camera/pmFPAMaskWeight.h	(revision 10247)
@@ -8,6 +8,6 @@
 /// @author Eugene Magnier, IfA
 ///
-/// @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
-/// @date $Date: 2006-10-17 02:21:03 $
+/// @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
+/// @date $Date: 2006-11-29 01:26:14 $
 ///
 /// Copyright 2005-2006 Institute for Astronomy, University of Hawaii
@@ -47,5 +47,6 @@
 /// temporary --- it is not added to the HDU.  This is intended for when the user is iterating using
 /// pmReadoutReadNext, in which case the HDU can't be generated.
-bool pmReadoutSetWeight(pmReadout *readout ///< Readout for which to set weight
+bool pmReadoutSetWeight(pmReadout *readout, ///< Readout for which to set weight
+                        bool poisson    ///< Use poisson weights (in addition to read noise)?
                        );
 
@@ -62,5 +63,6 @@
 /// (CELL.GAIN) and read noise (CELL.READNOISE).  The weight map that is produced within the readout is
 /// suitable for output (complete with HDU entry).  This is intended for most operations.
-bool pmReadoutGenerateWeight(pmReadout *readout ///< Readout for which to generate weight
+bool pmReadoutGenerateWeight(pmReadout *readout, ///< Readout for which to generate weight
+                             bool poisson    ///< Use poisson weights (in addition to read noise)?
                             );
 
@@ -68,5 +70,6 @@
 ///
 /// Calls pmReadoutGenerateMask and pmReadoutGenerateWeight for the readout
-bool pmReadoutGenerateMaskWeight(pmReadout *readout ///< Readout for which to generate mask and weights
+bool pmReadoutGenerateMaskWeight(pmReadout *readout, ///< Readout for which to generate mask and weights
+                                 bool poisson    ///< Use poisson weights (in addition to read noise)?
                                 );
 
@@ -74,5 +77,6 @@
 ///
 /// Calls pmReadoutGenerateMaskWeight for each readout within the cell.
-bool pmCellGenerateMaskWeight(pmCell *cell ///< Cell for which to generate mask and weights
+bool pmCellGenerateMaskWeight(pmCell *cell, ///< Cell for which to generate mask and weights
+                              bool poisson    ///< Use poisson weights (in addition to read noise)?
                              );
 
