Index: trunk/psModules/src/camera/pmFPAWrite.h
===================================================================
--- trunk/psModules/src/camera/pmFPAWrite.h	(revision 21279)
+++ trunk/psModules/src/camera/pmFPAWrite.h	(revision 21363)
@@ -4,6 +4,7 @@
  * @author Paul Price, IfA
  *
- * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
- * @date $Date: 2009-02-04 02:39:36 $
+ * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
+ * @date $Date: 2009-02-06 02:31:24 $
+ *
  * Copyright 2005-2006 Institute for Astronomy, University of Hawaii
  */
@@ -24,5 +25,5 @@
                         psFits *fits,   ///<  FITS file to which to write
                         int z           ///<  Image plane to write
-                       );
+    );
 
 /// Write a cell to a FITS file
@@ -36,5 +37,5 @@
                  pmConfig *config,      ///<  Configuration
                  bool blank             ///<  Write a blank PHU?
-                );
+    );
 
 /// Write a chip to a FITS file
@@ -49,5 +50,5 @@
                  bool blank,            ///<  Write a blank PHU?
                  bool recurse           ///<  Recurse to lower levels?
-                );
+    );
 
 /// Write an FPA to a FITS file
@@ -62,5 +63,5 @@
                 bool blank,             ///<  Write a blank PHU?
                 bool recurse            ///<  Recurse to lower levels?
-               );
+    );
 
 /// Write a cell mask to a FITS file
@@ -74,5 +75,5 @@
                      pmConfig *config,  ///<  Configuration
                      bool blank         ///<  Write a blank PHU?
-                    );
+    );
 
 /// Write a chip mask to a FITS file
@@ -88,5 +89,5 @@
                      bool blank,        ///<  Write a blank PHU?
                      bool recurse       ///<  Recurse to lower levels?
-                    );
+    );
 
 /// Write an FPA mask to a FITS file
@@ -102,45 +103,45 @@
                     bool blank,         ///<  Write a blank PHU?
                     bool recurse        ///<  Recurse to lower levels?
-                   );
+    );
 
-/// Write a cell weight to a FITS file
+/// Write a cell variance to a FITS file
 ///
-/// Generates CELL.TRIMSEC, CELL.BIASSEC and the HDU weight pixels if required.  A blank (i.e., image-less
+/// Generates CELL.TRIMSEC, CELL.BIASSEC and the HDU variance pixels if required.  A blank (i.e., image-less
 /// header) is written only if specifically requested.  Writes the concepts to the various locations, and then
-/// the HDU weight to the FITS file.  This function should be called at the beginning of the output cell loop
-/// with blank=true in order to produce the correct file structure.
-bool pmCellWriteWeight(pmCell *cell,    ///<  Cell to write
-                       psFits *fits,    ///<  FITS file to which to write
-                       pmConfig *config, ///<  Configuration
-                       bool blank       ///<  Write a blank PHU?
-                      );
+/// the HDU variance to the FITS file.  This function should be called at the beginning of the output cell
+/// loop with blank=true in order to produce the correct file structure.
+bool pmCellWriteVariance(pmCell *cell,    ///<  Cell to write
+                         psFits *fits,    ///<  FITS file to which to write
+                         pmConfig *config, ///<  Configuration
+                         bool blank       ///<  Write a blank PHU?
+    );
 
-/// Write a chip weight to a FITS file
+/// Write a chip variance to a FITS file
 ///
-/// Generates CELL.TRIMSEC, CELL.BIASSEC and the HDU weight pixels if required.  A blank (i.e., image-less
+/// Generates CELL.TRIMSEC, CELL.BIASSEC and the HDU variance pixels if required.  A blank (i.e., image-less
 /// header) is written only if specifically requested.  Writes the concepts to the various locations, and then
-/// the HDU weight to the FITS file, optionally recursing to lower levels.  This function should be called at
-/// the beginning of the output chip loop with blank=true and recurse=false in order to produce the correct
+/// the HDU variance to the FITS file, optionally recursing to lower levels.  This function should be called
+/// at the beginning of the output chip loop with blank=true and recurse=false in order to produce the correct
 /// file structure.
-bool pmChipWriteWeight(pmChip *chip,    ///<  Chip to write
-                       psFits *fits,    ///<  FITS file to which to write
-                       pmConfig *config, ///<  Configuration
-                       bool blank,      ///<  Write a blank PHU?
-                       bool recurse     ///<  Recurse to lower levels?
-                      );
+bool pmChipWriteVariance(pmChip *chip,    ///<  Chip to write
+                         psFits *fits,    ///<  FITS file to which to write
+                         pmConfig *config, ///<  Configuration
+                         bool blank,      ///<  Write a blank PHU?
+                         bool recurse     ///<  Recurse to lower levels?
+    );
 
-/// Write an FPA weight to a FITS file
+/// Write an FPA variance to a FITS file
 ///
-/// Generates CELL.TRIMSEC, CELL.BIASSEC and the HDU weight pixels if required.  A blank (i.e., image-less
+/// Generates CELL.TRIMSEC, CELL.BIASSEC and the HDU variance pixels if required.  A blank (i.e., image-less
 /// header) is written only if specifically requested.  Writes the concepts to the various locations, and then
-/// the HDU weight to the FITS file, optionally recursing to lower levels.  This function should be called at
-/// the beginning of the output FPA loop with blank=true and recurse=false in order to produce the correct
+/// the HDU variance to the FITS file, optionally recursing to lower levels.  This function should be called
+/// at the beginning of the output FPA loop with blank=true and recurse=false in order to produce the correct
 /// file structure.
-bool pmFPAWriteWeight(pmFPA *fpa,       ///<  FPA to write
-                      psFits *fits,     ///<  FITS file to which to write
-                      pmConfig *config, ///<  Configuration
-                      bool blank,       ///<  Write a blank PHU?
-                      bool recurse      ///<  Recurse to lower levels?
-                     );
+bool pmFPAWriteVariance(pmFPA *fpa,       ///<  FPA to write
+                        psFits *fits,     ///<  FITS file to which to write
+                        pmConfig *config, ///<  Configuration
+                        bool blank,       ///<  Write a blank PHU?
+                        bool recurse      ///<  Recurse to lower levels?
+    );
 
 
@@ -153,15 +154,31 @@
                      const pmCell *cell, ///< Cell containing FITS table in the analysis metadata
                      const char *name   ///< Name for the table data, and the extension name
-                    );
+    );
 
 int pmChipWriteTable(psFits *fits,      ///< FITS file to which to write
                      const pmChip *chip, ///< Chip containing cells with tables to write
                      const char *name   ///< Name for the table data, and the extension name
-                    );
+    );
 
 int pmFPAWriteTable(psFits *fits,       ///< FITS file to which to write
                     const pmFPA *fpa,   ///< FPA containing cells with tables to write
                     const char *name    ///< Name for the table data, and the extension name
-                   );
+    );
+
+/// Write covariance matrix to a FITS file
+///
+/// The covariance matrices for a cell are written to an independent extension, named after the chip and cell
+/// name.
+bool pmCellWriteCovariance(psFits *fits,///< FITS file to which to write
+                           const pmCell *cell ///< Cell for which to write covariance
+    );
+
+bool pmChipWriteCovariance(psFits *fits,///< FITS file to which to write
+                           const pmChip *chip ///< Chip for which to write covariance
+    );
+
+bool pmFPAWriteCovariance(psFits *fits,///< FITS file to which to write
+                          const pmFPA *fpa ///< FPA for which to write covariance
+    );
 
 // Update the header before writing to be consistent
