Index: trunk/psModules/src/camera/pmFPARead.c
===================================================================
--- trunk/psModules/src/camera/pmFPARead.c	(revision 18140)
+++ trunk/psModules/src/camera/pmFPARead.c	(revision 18163)
@@ -82,5 +82,5 @@
 static bool cellNumReadouts(pmCell *cell,    // Cell of interest
                             psFits *fits,    // FITS file
-			    psDB *db
+                            pmConfig *config // Configuration
     )
 {
@@ -94,5 +94,5 @@
         return false;
     }
-    if (!pmCellReadHeader(cell, fits, db)) {
+    if (!pmCellReadHeader(cell, fits, config)) {
         psError(PS_ERR_IO, false, "Unable to read header for cell!\n");
         return false;
@@ -143,5 +143,5 @@
                                   int numScans, // Number of scans to read at a time
                                   fpaReadType type, // Type of image
-                                  psDB *db // Database handle for concepts
+                                  pmConfig *config // Configuration
     )
 {
@@ -153,5 +153,5 @@
 
     if (!pmConceptsReadCell(readout->parent, PM_CONCEPT_SOURCE_DEFAULTS | PM_CONCEPT_SOURCE_DATABASE,
-                            true, db)) {
+                            true, config)) {
         psError(PS_ERR_IO, false, "Failed to read concepts for cell.");
         return false;
@@ -209,5 +209,5 @@
                         int numScans,   // Number of scans to read at a time
                         fpaReadType type, // Type of image
-                        psDB *db        // Database handle for concepts
+                        pmConfig *config// Configuration
     )
 {
@@ -229,5 +229,5 @@
         return false;
     }
-    int naxis3 = cellNumReadouts(cell, fits, db); // Number of planes
+    int naxis3 = cellNumReadouts(cell, fits, config); // Number of planes
     if (z >= naxis3) {
         // No more to read
@@ -237,5 +237,5 @@
     int next;                           // Next position
     int last;                           // Last position
-    if (!readoutScanProperties(&next, &last, readout, numScans, type, db)) {
+    if (!readoutScanProperties(&next, &last, readout, numScans, type, config)) {
         psError(PS_ERR_UNKNOWN, false, "Unable to determine readout properties.");
         return false;
@@ -395,5 +395,5 @@
                              int overlap, // Number of scans (row/col) to overlap between scans
                              fpaReadType type, // Type of image
-                             psDB *db   // Database handle for concepts
+                             pmConfig *config   // Configuration
     )
 {
@@ -416,5 +416,5 @@
     }
 
-    int naxis3 = cellNumReadouts(cell, fits, db); // Number of image planes
+    int naxis3 = cellNumReadouts(cell, fits, config); // Number of image planes
     if (z >= naxis3) {
         psError(PS_ERR_IO, false, "Desired image plane (%d) exceeds available number (%d).",
@@ -425,5 +425,5 @@
     int next;                           // Next position
     int last;                           // Last position
-    if (!readoutScanProperties(&next, &last, readout, numScans, type, db)) {
+    if (!readoutScanProperties(&next, &last, readout, numScans, type, config)) {
         psError(PS_ERR_UNKNOWN, false, "Unable to determine readout properties.");
         return false;
@@ -532,5 +532,5 @@
 static bool cellRead(pmCell *cell,      // Cell into which to read
                      psFits *fits,      // FITS file from which to read
-                     psDB *db,          // Database handle, for concepts ingest
+                     pmConfig *config,  // Configuration
                      fpaReadType type   // Type to read
                     )
@@ -578,5 +578,5 @@
 
     // load in the concept information for this cell
-    if (!pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_DATABASE, true, db)) {
+    if (!pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_DATABASE, true, config)) {
         //psError(PS_ERR_UNKNOWN, false, "Failed to read concepts for cell");
         //return false;
@@ -653,5 +653,5 @@
 static bool chipRead(pmChip *chip,      // Chip into which to read
                      psFits *fits,      // FITS file from which to read
-                     psDB *db,          // Database handle, for concepts ingest
+                     pmConfig *config,  // Configuration
                      fpaReadType type   // Type to read
                     )
@@ -664,5 +664,5 @@
     for (int i = 0; i < cells->n; i++) {
         pmCell *cell = cells->data[i];  // The cell of interest
-        success |= cellRead(cell, fits, db, type);
+        success |= cellRead(cell, fits, config, type);
     }
     if (success) {
@@ -684,5 +684,5 @@
 static bool fpaRead(pmFPA *fpa,         // FPA into which to read
                     psFits *fits,       // FITS file from which to read
-                    psDB *db,           // Database handle, for concepts ingest
+                    pmConfig *config,   // Configuration
                     fpaReadType type    // Type to read
                    )
@@ -695,5 +695,5 @@
     for (int i = 0; i < chips->n; i++) {
         pmChip *chip = chips->data[i];  // The cell of interest
-        success |= chipRead(chip, fits, db, type);
+        success |= chipRead(chip, fits, config, type);
     }
     if (success) {
@@ -720,5 +720,5 @@
 // pmReadoutReadNext is maintained here (for now) to maintain backwards compatibility.
 // pmReadoutReadNext has been replaced by pmReadoutRead, pmReadoutReadChunk, pmReadoutMore
-bool pmReadoutReadNext(bool *status, pmReadout *readout, psFits *fits, int z, int numScans, psDB *db)
+bool pmReadoutReadNext(bool *status, pmReadout *readout, psFits *fits, int z, int numScans, pmConfig *config)
 {
     PS_ASSERT_PTR_NON_NULL(readout, false);
@@ -741,5 +741,5 @@
     }
 
-    if (!pmCellReadHeader(cell, fits, db)) {
+    if (!pmCellReadHeader(cell, fits, config)) {
         psError(PS_ERR_IO, false, "Unable to read header for cell!\n");
         return false;
@@ -896,13 +896,13 @@
 
 
-bool pmReadoutMore(pmReadout *readout, psFits *fits, int z, int numScans, psDB *db)
+bool pmReadoutMore(pmReadout *readout, psFits *fits, int z, int numScans, pmConfig *config)
 {
     PS_ASSERT_PTR_NON_NULL(readout, false);
     PS_ASSERT_FITS_NON_NULL(fits, false);
 
-    return readoutMore(readout, fits, z, numScans, FPA_READ_TYPE_IMAGE, db);
-}
-
-bool pmReadoutReadChunk(pmReadout *readout, psFits *fits, int z, int numScans, int overlap, psDB *db)
+    return readoutMore(readout, fits, z, numScans, FPA_READ_TYPE_IMAGE, config);
+}
+
+bool pmReadoutReadChunk(pmReadout *readout, psFits *fits, int z, int numScans, int overlap, pmConfig *config)
 {
     PS_ASSERT_PTR_NON_NULL(readout, false);
@@ -911,45 +911,45 @@
     PS_ASSERT_INT_NONNEGATIVE(numScans, false);
 
-    return readoutReadChunk(readout, fits, z, numScans, overlap, FPA_READ_TYPE_IMAGE, db);
-}
-
-bool pmReadoutRead(pmReadout *readout, psFits *fits, int z, psDB *db)
+    return readoutReadChunk(readout, fits, z, numScans, overlap, FPA_READ_TYPE_IMAGE, config);
+}
+
+bool pmReadoutRead(pmReadout *readout, psFits *fits, int z, pmConfig *config)
 {
     PS_ASSERT_PTR_NON_NULL(readout, false);
     PS_ASSERT_FITS_NON_NULL(fits, false);
 
-    return readoutReadChunk(readout, fits, z, 0, 0, FPA_READ_TYPE_IMAGE, db);
-}
-
-int pmCellNumReadouts(pmCell *cell, psFits *fits, psDB *db)
+    return readoutReadChunk(readout, fits, z, 0, 0, FPA_READ_TYPE_IMAGE, config);
+}
+
+int pmCellNumReadouts(pmCell *cell, psFits *fits, pmConfig *config)
 {
     PS_ASSERT_PTR_NON_NULL(cell, false);
     PS_ASSERT_FITS_NON_NULL(fits, false);
 
-    return cellNumReadouts(cell, fits, db);
-}
-
-bool pmCellRead(pmCell *cell, psFits *fits, psDB *db)
+    return cellNumReadouts(cell, fits, config);
+}
+
+bool pmCellRead(pmCell *cell, psFits *fits, pmConfig *config)
 {
     PS_ASSERT_PTR_NON_NULL(cell, false);
     PS_ASSERT_FITS_NON_NULL(fits, false);
 
-    return cellRead(cell, fits, db, FPA_READ_TYPE_IMAGE);
-}
-
-bool pmChipRead(pmChip *chip, psFits *fits, psDB *db)
+    return cellRead(cell, fits, config, FPA_READ_TYPE_IMAGE);
+}
+
+bool pmChipRead(pmChip *chip, psFits *fits, pmConfig *config)
 {
     PS_ASSERT_PTR_NON_NULL(chip, false);
     PS_ASSERT_FITS_NON_NULL(fits, false);
 
-    return chipRead(chip, fits, db, FPA_READ_TYPE_IMAGE);
-}
-
-bool pmFPARead(pmFPA *fpa, psFits *fits, psDB *db)
+    return chipRead(chip, fits, config, FPA_READ_TYPE_IMAGE);
+}
+
+bool pmFPARead(pmFPA *fpa, psFits *fits, pmConfig *config)
 {
     PS_ASSERT_PTR_NON_NULL(fpa, false);
     PS_ASSERT_FITS_NON_NULL(fits, false);
 
-    return fpaRead(fpa, fits, db, FPA_READ_TYPE_IMAGE);
+    return fpaRead(fpa, fits, config, FPA_READ_TYPE_IMAGE);
 }
 
@@ -959,13 +959,14 @@
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
-bool pmReadoutMoreMask(pmReadout *readout, psFits *fits, int z, int numScans, psDB *db)
+bool pmReadoutMoreMask(pmReadout *readout, psFits *fits, int z, int numScans, pmConfig *config)
 {
     PS_ASSERT_PTR_NON_NULL(readout, false);
     PS_ASSERT_FITS_NON_NULL(fits, false);
 
-    return readoutMore(readout, fits, z, numScans, FPA_READ_TYPE_MASK, db);
-}
-
-bool pmReadoutReadChunkMask(pmReadout *readout, psFits *fits, int z, int numScans, int overlap, psDB *db)
+    return readoutMore(readout, fits, z, numScans, FPA_READ_TYPE_MASK, config);
+}
+
+bool pmReadoutReadChunkMask(pmReadout *readout, psFits *fits, int z, int numScans, int overlap,
+                            pmConfig *config)
 {
     PS_ASSERT_PTR_NON_NULL(readout, false);
@@ -974,37 +975,37 @@
     PS_ASSERT_INT_NONNEGATIVE(numScans, false);
 
-    return readoutReadChunk(readout, fits, z, numScans, overlap, FPA_READ_TYPE_MASK, db);
-}
-
-bool pmReadoutReadMask(pmReadout *readout, psFits *fits, int z, psDB *db)
+    return readoutReadChunk(readout, fits, z, numScans, overlap, FPA_READ_TYPE_MASK, config);
+}
+
+bool pmReadoutReadMask(pmReadout *readout, psFits *fits, int z, pmConfig *config)
 {
     PS_ASSERT_PTR_NON_NULL(readout, false);
     PS_ASSERT_FITS_NON_NULL(fits, false);
 
-    return readoutReadChunk(readout, fits, z, 0, 0, FPA_READ_TYPE_MASK, db);
-}
-
-bool pmCellReadMask(pmCell *cell, psFits *fits, psDB *db)
+    return readoutReadChunk(readout, fits, z, 0, 0, FPA_READ_TYPE_MASK, config);
+}
+
+bool pmCellReadMask(pmCell *cell, psFits *fits, pmConfig *config)
 {
     PS_ASSERT_PTR_NON_NULL(cell, false);
     PS_ASSERT_FITS_NON_NULL(fits, false);
 
-    return cellRead(cell, fits, db, FPA_READ_TYPE_MASK);
-}
-
-bool pmChipReadMask(pmChip *chip, psFits *fits, psDB *db)
+    return cellRead(cell, fits, config, FPA_READ_TYPE_MASK);
+}
+
+bool pmChipReadMask(pmChip *chip, psFits *fits, pmConfig *config)
 {
     PS_ASSERT_PTR_NON_NULL(chip, false);
     PS_ASSERT_FITS_NON_NULL(fits, false);
 
-    return chipRead(chip, fits, db, FPA_READ_TYPE_MASK);
-}
-
-bool pmFPAReadMask(pmFPA *fpa, psFits *fits, psDB *db)
+    return chipRead(chip, fits, config, FPA_READ_TYPE_MASK);
+}
+
+bool pmFPAReadMask(pmFPA *fpa, psFits *fits, pmConfig *config)
 {
     PS_ASSERT_PTR_NON_NULL(fpa, false);
     PS_ASSERT_FITS_NON_NULL(fits, false);
 
-    return fpaRead(fpa, fits, db, FPA_READ_TYPE_MASK);
+    return fpaRead(fpa, fits, config, FPA_READ_TYPE_MASK);
 }
 
@@ -1013,13 +1014,14 @@
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
-bool pmReadoutMoreWeight(pmReadout *readout, psFits *fits, int z, int numScans, psDB *db)
+bool pmReadoutMoreWeight(pmReadout *readout, psFits *fits, int z, int numScans, pmConfig *config)
 {
     PS_ASSERT_PTR_NON_NULL(readout, false);
     PS_ASSERT_FITS_NON_NULL(fits, false);
 
-    return readoutMore(readout, fits, z, numScans, FPA_READ_TYPE_WEIGHT, db);
-}
-
-bool pmReadoutReadChunkWeight(pmReadout *readout, psFits *fits, int z, int numScans, int overlap, psDB *db)
+    return readoutMore(readout, fits, z, numScans, FPA_READ_TYPE_WEIGHT, config);
+}
+
+bool pmReadoutReadChunkWeight(pmReadout *readout, psFits *fits, int z, int numScans, int overlap,
+                              pmConfig *config)
 {
     PS_ASSERT_PTR_NON_NULL(readout, false);
@@ -1028,37 +1030,37 @@
     PS_ASSERT_INT_NONNEGATIVE(numScans, false);
 
-    return readoutReadChunk(readout, fits, z, numScans, overlap, FPA_READ_TYPE_WEIGHT, db);
-}
-
-bool pmReadoutReadWeight(pmReadout *readout, psFits *fits, int z, psDB *db)
+    return readoutReadChunk(readout, fits, z, numScans, overlap, FPA_READ_TYPE_WEIGHT, config);
+}
+
+bool pmReadoutReadWeight(pmReadout *readout, psFits *fits, int z, pmConfig *config)
 {
     PS_ASSERT_PTR_NON_NULL(readout, false);
     PS_ASSERT_FITS_NON_NULL(fits, false);
 
-    return readoutReadChunk(readout, fits, z, 0, 0, FPA_READ_TYPE_WEIGHT, db);
-}
-
-bool pmCellReadWeight(pmCell *cell, psFits *fits, psDB *db)
+    return readoutReadChunk(readout, fits, z, 0, 0, FPA_READ_TYPE_WEIGHT, config);
+}
+
+bool pmCellReadWeight(pmCell *cell, psFits *fits, pmConfig *config)
 {
     PS_ASSERT_PTR_NON_NULL(cell, false);
     PS_ASSERT_FITS_NON_NULL(fits, false);
 
-    return cellRead(cell, fits, db, FPA_READ_TYPE_WEIGHT);
-}
-
-bool pmChipReadWeight(pmChip *chip, psFits *fits, psDB *db)
+    return cellRead(cell, fits, config, FPA_READ_TYPE_WEIGHT);
+}
+
+bool pmChipReadWeight(pmChip *chip, psFits *fits, pmConfig *config)
 {
     PS_ASSERT_PTR_NON_NULL(chip, false);
     PS_ASSERT_FITS_NON_NULL(fits, false);
 
-    return chipRead(chip, fits, db, FPA_READ_TYPE_WEIGHT);
-}
-
-bool pmFPAReadWeight(pmFPA *fpa, psFits *fits, psDB *db)
+    return chipRead(chip, fits, config, FPA_READ_TYPE_WEIGHT);
+}
+
+bool pmFPAReadWeight(pmFPA *fpa, psFits *fits, pmConfig *config)
 {
     PS_ASSERT_PTR_NON_NULL(fpa, false);
     PS_ASSERT_FITS_NON_NULL(fits, false);
 
-    return fpaRead(fpa, fits, db, FPA_READ_TYPE_WEIGHT);
+    return fpaRead(fpa, fits, config, FPA_READ_TYPE_WEIGHT);
 }
 
@@ -1067,26 +1069,26 @@
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
-bool pmCellReadHeaderSet(pmCell *cell, psFits *fits, psDB *db)
+bool pmCellReadHeaderSet(pmCell *cell, psFits *fits, pmConfig *config)
 {
     PS_ASSERT_PTR_NON_NULL(cell, false);
     PS_ASSERT_FITS_NON_NULL(fits, false);
 
-    return cellRead(cell, fits, db, FPA_READ_TYPE_HEADER);
-}
-
-bool pmChipReadHeaderSet(pmChip *chip, psFits *fits, psDB *db)
+    return cellRead(cell, fits, config, FPA_READ_TYPE_HEADER);
+}
+
+bool pmChipReadHeaderSet(pmChip *chip, psFits *fits, pmConfig *config)
 {
     PS_ASSERT_PTR_NON_NULL(chip, false);
     PS_ASSERT_FITS_NON_NULL(fits, false);
 
-    return chipRead(chip, fits, db, FPA_READ_TYPE_HEADER);
-}
-
-bool pmFPAReadHeaderSet(pmFPA *fpa, psFits *fits, psDB *db)
+    return chipRead(chip, fits, config, FPA_READ_TYPE_HEADER);
+}
+
+bool pmFPAReadHeaderSet(pmFPA *fpa, psFits *fits, pmConfig *config)
 {
     PS_ASSERT_PTR_NON_NULL(fpa, false);
     PS_ASSERT_FITS_NON_NULL(fits, false);
 
-    return fpaRead(fpa, fits, db, FPA_READ_TYPE_HEADER);
+    return fpaRead(fpa, fits, config, FPA_READ_TYPE_HEADER);
 }
 
