Index: trunk/psModules/src/camera/pmFPAfileFitsIO.c
===================================================================
--- trunk/psModules/src/camera/pmFPAfileFitsIO.c	(revision 17911)
+++ trunk/psModules/src/camera/pmFPAfileFitsIO.c	(revision 18139)
@@ -166,4 +166,5 @@
 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
@@ -178,5 +179,5 @@
 
     if (view->chip == -1) {
-        return fpaReadFunc(fpa, fits, NULL);
+        return fpaReadFunc(fpa, fits, db);
     }
 
@@ -188,5 +189,5 @@
 
     if (view->cell == -1) {
-        return chipReadFunc(chip, fits, NULL);
+        return chipReadFunc(chip, fits, db);
     }
 
@@ -198,5 +199,5 @@
 
     if (view->readout == -1) {
-        return cellReadFunc(cell, fits, NULL);
+        return cellReadFunc(cell, fits, db);
     }
     psError(PS_ERR_UNKNOWN, true, "Bad view: %d,%d", view->chip, view->cell);
@@ -214,5 +215,5 @@
 
     if (view->nRows == 0) {
-        pmReadoutRead (readout, fits, NULL);
+        pmReadoutRead (readout, fits, db);
     } else {
         pmReadoutReadSegment (readout, fits, view->nRows, view->iRows, NULL, NULL);
@@ -223,37 +224,37 @@
 
 
-bool pmFPAviewReadFitsImage(const pmFPAview *view, pmFPAfile *file)
-{
-    PS_ASSERT_PTR_NON_NULL(view, false);
-    PS_ASSERT_PTR_NON_NULL(file, false);
-    return fpaViewReadFitsImage(view, file, pmFPARead, pmChipRead, pmCellRead);
-}
-
-bool pmFPAviewReadFitsMask(const pmFPAview *view, pmFPAfile *file)
-{
-    PS_ASSERT_PTR_NON_NULL(view, false);
-    PS_ASSERT_PTR_NON_NULL(file, false);
-    return fpaViewReadFitsImage(view, file, pmFPAReadMask, pmChipReadMask, pmCellReadMask);
-}
-
-bool pmFPAviewReadFitsWeight(const pmFPAview *view, pmFPAfile *file)
-{
-    PS_ASSERT_PTR_NON_NULL(view, false);
-    PS_ASSERT_PTR_NON_NULL(file, false);
-    return fpaViewReadFitsImage(view, file, pmFPAReadWeight, pmChipReadWeight, pmCellReadWeight);
-}
-
-bool pmFPAviewReadFitsDark(const pmFPAview *view, pmFPAfile *file)
-{
-    PS_ASSERT_PTR_NON_NULL(view, false);
-    PS_ASSERT_PTR_NON_NULL(file, false);
-    return fpaViewReadFitsImage(view, file, pmFPAReadDark, pmChipReadDark, pmCellReadDark);
-}
-
-bool pmFPAviewReadFitsHeaderSet(const pmFPAview *view, pmFPAfile *file)
-{
-    PS_ASSERT_PTR_NON_NULL(view, false);
-    PS_ASSERT_PTR_NON_NULL(file, false);
-    return fpaViewReadFitsImage(view, file, pmFPAReadHeaderSet, pmChipReadHeaderSet, pmCellReadHeaderSet);
+bool pmFPAviewReadFitsImage(const pmFPAview *view, pmFPAfile *file, pmConfig *config)
+{
+    PS_ASSERT_PTR_NON_NULL(view, false);
+    PS_ASSERT_PTR_NON_NULL(file, false);
+    return fpaViewReadFitsImage(view, file, config->database, pmFPARead, pmChipRead, pmCellRead);
+}
+
+bool pmFPAviewReadFitsMask(const pmFPAview *view, pmFPAfile *file, pmConfig *config)
+{
+    PS_ASSERT_PTR_NON_NULL(view, false);
+    PS_ASSERT_PTR_NON_NULL(file, false);
+    return fpaViewReadFitsImage(view, file, config->database, pmFPAReadMask, pmChipReadMask, pmCellReadMask);
+}
+
+bool pmFPAviewReadFitsWeight(const pmFPAview *view, pmFPAfile *file, pmConfig *config)
+{
+    PS_ASSERT_PTR_NON_NULL(view, false);
+    PS_ASSERT_PTR_NON_NULL(file, false);
+    return fpaViewReadFitsImage(view, file, config->database, pmFPAReadWeight, pmChipReadWeight, pmCellReadWeight);
+}
+
+bool pmFPAviewReadFitsDark(const pmFPAview *view, pmFPAfile *file, pmConfig *config)
+{
+    PS_ASSERT_PTR_NON_NULL(view, false);
+    PS_ASSERT_PTR_NON_NULL(file, false);
+    return fpaViewReadFitsImage(view, file, config->database, pmFPAReadDark, pmChipReadDark, pmCellReadDark);
+}
+
+bool pmFPAviewReadFitsHeaderSet(const pmFPAview *view, pmFPAfile *file, pmConfig *config)
+{
+    PS_ASSERT_PTR_NON_NULL(view, false);
+    PS_ASSERT_PTR_NON_NULL(file, false);
+    return fpaViewReadFitsImage(view, file, config->database, pmFPAReadHeaderSet, pmChipReadHeaderSet, pmCellReadHeaderSet);
 }
 
