Index: trunk/psModules/src/camera/pmFPAfileFitsIO.c
===================================================================
--- trunk/psModules/src/camera/pmFPAfileFitsIO.c	(revision 18139)
+++ trunk/psModules/src/camera/pmFPAfileFitsIO.c	(revision 18163)
@@ -166,8 +166,8 @@
 static bool fpaViewReadFitsImage(const pmFPAview *view, // FPA view, specifying the level of interest
                                  pmFPAfile *file, // FPA file of interest
-				 psDB *db, 
-                                 bool (*fpaReadFunc)(pmFPA*, psFits*, psDB*), // Function to read FPA
-                                 bool (*chipReadFunc)(pmChip*, psFits*, psDB*), // Function to read chip
-                                 bool (*cellReadFunc)(pmCell*, psFits*, psDB*) // Function to read cell
+                                 pmConfig *config, // Configuration
+                                 bool (*fpaReadFunc)(pmFPA*, psFits*, pmConfig*), // Function to read FPA
+                                 bool (*chipReadFunc)(pmChip*, psFits*, pmConfig*), // Function to read chip
+                                 bool (*cellReadFunc)(pmCell*, psFits*, pmConfig*) // Function to read cell
                                 )
 {
@@ -179,5 +179,5 @@
 
     if (view->chip == -1) {
-        return fpaReadFunc(fpa, fits, db);
+        return fpaReadFunc(fpa, fits, config);
     }
 
@@ -189,5 +189,5 @@
 
     if (view->cell == -1) {
-        return chipReadFunc(chip, fits, db);
+        return chipReadFunc(chip, fits, config);
     }
 
@@ -199,5 +199,5 @@
 
     if (view->readout == -1) {
-        return cellReadFunc(cell, fits, db);
+        return cellReadFunc(cell, fits, config);
     }
     psError(PS_ERR_UNKNOWN, true, "Bad view: %d,%d", view->chip, view->cell);
@@ -215,5 +215,5 @@
 
     if (view->nRows == 0) {
-        pmReadoutRead (readout, fits, db);
+        pmReadoutRead (readout, fits, config);
     } else {
         pmReadoutReadSegment (readout, fits, view->nRows, view->iRows, NULL, NULL);
@@ -228,5 +228,5 @@
     PS_ASSERT_PTR_NON_NULL(view, false);
     PS_ASSERT_PTR_NON_NULL(file, false);
-    return fpaViewReadFitsImage(view, file, config->database, pmFPARead, pmChipRead, pmCellRead);
+    return fpaViewReadFitsImage(view, file, config, pmFPARead, pmChipRead, pmCellRead);
 }
 
@@ -235,5 +235,5 @@
     PS_ASSERT_PTR_NON_NULL(view, false);
     PS_ASSERT_PTR_NON_NULL(file, false);
-    return fpaViewReadFitsImage(view, file, config->database, pmFPAReadMask, pmChipReadMask, pmCellReadMask);
+    return fpaViewReadFitsImage(view, file, config, pmFPAReadMask, pmChipReadMask, pmCellReadMask);
 }
 
@@ -242,5 +242,5 @@
     PS_ASSERT_PTR_NON_NULL(view, false);
     PS_ASSERT_PTR_NON_NULL(file, false);
-    return fpaViewReadFitsImage(view, file, config->database, pmFPAReadWeight, pmChipReadWeight, pmCellReadWeight);
+    return fpaViewReadFitsImage(view, file, config, pmFPAReadWeight, pmChipReadWeight, pmCellReadWeight);
 }
 
@@ -249,5 +249,5 @@
     PS_ASSERT_PTR_NON_NULL(view, false);
     PS_ASSERT_PTR_NON_NULL(file, false);
-    return fpaViewReadFitsImage(view, file, config->database, pmFPAReadDark, pmChipReadDark, pmCellReadDark);
+    return fpaViewReadFitsImage(view, file, config, pmFPAReadDark, pmChipReadDark, pmCellReadDark);
 }
 
@@ -256,5 +256,5 @@
     PS_ASSERT_PTR_NON_NULL(view, false);
     PS_ASSERT_PTR_NON_NULL(file, false);
-    return fpaViewReadFitsImage(view, file, config->database, pmFPAReadHeaderSet, pmChipReadHeaderSet, pmCellReadHeaderSet);
+    return fpaViewReadFitsImage(view, file, config, pmFPAReadHeaderSet, pmChipReadHeaderSet, pmCellReadHeaderSet);
 }
 
@@ -267,8 +267,8 @@
 static bool fpaViewWriteFitsImage(const pmFPAview *view, // FPA view, specifying the level of interest
                                   pmFPAfile *file, // FPA file of interest
-                                  const pmConfig *config, // Configuration
-                                  bool (*fpaWriteFunc)(pmFPA*, psFits*, psDB*, bool, bool), // Func for FPA
-                                  bool (*chipWriteFunc)(pmChip*, psFits*, psDB*, bool, bool), // Func for chip
-                                  bool (*cellWriteFunc)(pmCell*, psFits*, psDB*, bool) // Func for cell
+                                  pmConfig *config, // Configuration
+                                  bool (*fpaWriteFunc)(pmFPA*, psFits*, pmConfig*, bool, bool), // Func FPA
+                                  bool (*chipWriteFunc)(pmChip*, psFits*, pmConfig*, bool, bool),// Func chip
+                                  bool (*cellWriteFunc)(pmCell*, psFits*, pmConfig*, bool) // Func cell
                                  )
 {
@@ -283,5 +283,5 @@
     switch (pmFPAviewLevel(view)) {
     case PM_FPA_LEVEL_FPA: {
-            bool success = fpaWriteFunc(fpa, fits, NULL, false, true);
+            bool success = fpaWriteFunc(fpa, fits, config, false, true);
             psFree(fpa);
             return success;
@@ -289,5 +289,5 @@
     case PM_FPA_LEVEL_CHIP: {
             pmChip *chip = pmFPAviewThisChip(view, fpa); // Chip of interest
-            bool success = chipWriteFunc(chip, fits, NULL, false, true);
+            bool success = chipWriteFunc(chip, fits, config, false, true);
             psFree(fpa);
             return success;
@@ -295,5 +295,5 @@
     case PM_FPA_LEVEL_CELL: {
             pmCell *cell = pmFPAviewThisCell(view, fpa); // Cell of interest
-            bool success = cellWriteFunc(cell, fits, NULL, false);
+            bool success = cellWriteFunc(cell, fits, config, false);
             psFree(fpa);
             return success;
@@ -327,5 +327,5 @@
 }
 
-bool pmFPAviewWriteFitsImage(const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
+bool pmFPAviewWriteFitsImage(const pmFPAview *view, pmFPAfile *file, pmConfig *config)
 {
     PS_ASSERT_PTR_NON_NULL(view, false);
@@ -334,5 +334,5 @@
 }
 
-bool pmFPAviewWriteFitsMask(const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
+bool pmFPAviewWriteFitsMask(const pmFPAview *view, pmFPAfile *file, pmConfig *config)
 {
     PS_ASSERT_PTR_NON_NULL(view, false);
@@ -341,5 +341,5 @@
 }
 
-bool pmFPAviewWriteFitsWeight(const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
+bool pmFPAviewWriteFitsWeight(const pmFPAview *view, pmFPAfile *file, pmConfig *config)
 {
     PS_ASSERT_PTR_NON_NULL(view, false);
@@ -348,5 +348,5 @@
 }
 
-bool pmFPAviewWriteFitsDark(const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
+bool pmFPAviewWriteFitsDark(const pmFPAview *view, pmFPAfile *file, pmConfig *config)
 {
     PS_ASSERT_PTR_NON_NULL(view, false);
