Index: trunk/psModules/src/detrend/pmDark.c
===================================================================
--- trunk/psModules/src/detrend/pmDark.c	(revision 18132)
+++ trunk/psModules/src/detrend/pmDark.c	(revision 18163)
@@ -25,5 +25,5 @@
 // Look up the value of an ordinate in a readout
 static bool ordinateLookup(float *value, // Value of ordinate, to return
-			   bool *inRange, // is value within min : max range?
+                           bool *inRange, // is value within min : max range?
                            const char *name, // Name of ordinate (concept name)
                            bool scale,  // Scale the value?
@@ -70,5 +70,5 @@
         if (*value < min || *value > max) {
             psWarning("Value of concept %s (%f) outside range (%f:%f)", name, *value, min, max);
-	    *inRange = false;
+            *inRange = false;
         }
         *value = 2.0 * (*value - min) / (max - min) - 1.0;
@@ -175,5 +175,5 @@
                 continue;
             }
-	    if (!inRange) {
+            if (!inRange) {
                 roMask->data.U8[j] = 0xff;
                 val->data.F32[i] = NAN;
@@ -282,20 +282,20 @@
                     mask->data.PS_TYPE_MASK_DATA[r] = readout->mask->data.PS_TYPE_MASK_DATA[yIn][xIn];
                 }
-	    
-            }
-
-	    // XXX test
-	    if (0 && (i == 377) && (j == 80)) {
-		FILE *f = fopen ("test.dat", "w");	
-		for (int r = 0; r < inputs->n; r++) { 
-		    fprintf (f, "%d %d  %d  ", i, j, mask->data.U8[r]);
-		    psVector *value = values->data[r];
-		    for (int tmpj = 0; tmpj < value->n; tmpj++) {
-			fprintf (f, "%f ", value->data.F32[tmpj]);
-		    }
-		    fprintf (f, "%f\n", pixels->data.F32[r]);
-		}
-		fclose (f);
-	    }
+
+            }
+
+            // XXX test
+            if (0 && (i == 377) && (j == 80)) {
+                FILE *f = fopen ("test.dat", "w");
+                for (int r = 0; r < inputs->n; r++) {
+                    fprintf (f, "%d %d  %d  ", i, j, mask->data.U8[r]);
+                    psVector *value = values->data[r];
+                    for (int tmpj = 0; tmpj < value->n; tmpj++) {
+                        fprintf (f, "%f ", value->data.F32[tmpj]);
+                    }
+                    fprintf (f, "%f\n", pixels->data.F32[r]);
+                }
+                fclose (f);
+            }
 
             if (!psPolynomialMDClipFit(poly, pixels, NULL, mask, maskVal, values, iter, rej)) {
@@ -426,10 +426,10 @@
 }
 
-bool pmFPAWriteDark(pmFPA *fpa, psFits *fits, psDB *db, bool blank, bool recurse)
+bool pmFPAWriteDark(pmFPA *fpa, psFits *fits, pmConfig *config, bool blank, bool recurse)
 {
     PS_ASSERT_PTR_NON_NULL(fpa, false);
     PS_ASSERT_FITS_NON_NULL(fits, false);
 
-    if (!pmFPAWrite(fpa, fits, db, blank, recurse)) {
+    if (!pmFPAWrite(fpa, fits, config, blank, recurse)) {
         psError(PS_ERR_IO, false, "Unable to write FPA dark images");
         return false;
@@ -481,10 +481,10 @@
 }
 
-bool pmChipWriteDark(pmChip *chip, psFits *fits, psDB *db, bool blank, bool recurse)
+bool pmChipWriteDark(pmChip *chip, psFits *fits, pmConfig *config, bool blank, bool recurse)
 {
     PS_ASSERT_PTR_NON_NULL(chip, false);
     PS_ASSERT_FITS_NON_NULL(fits, false);
 
-    if (!pmChipWrite(chip, fits, db, blank, recurse)) {
+    if (!pmChipWrite(chip, fits, config, blank, recurse)) {
         psError(PS_ERR_IO, false, "Unable to write chip dark images");
         return false;
@@ -532,5 +532,5 @@
 }
 
-bool pmCellWriteDark(pmCell *cell, psFits *fits, psDB *db, bool blank)
+bool pmCellWriteDark(pmCell *cell, psFits *fits, pmConfig *config, bool blank)
 {
     PS_ASSERT_PTR_NON_NULL(cell, false);
@@ -538,5 +538,5 @@
 
     // Allow the usual pmFPAWrite functions to handle the heavy lifting for the images
-    if (!pmCellWrite(cell, fits, db, blank)) {
+    if (!pmCellWrite(cell, fits, config, blank)) {
         psError(PS_ERR_UNKNOWN, false, "Unable to write dark cell.");
         return false;
@@ -623,10 +623,10 @@
 
 
-bool pmFPAReadDark(pmFPA *fpa, psFits *fits, psDB *db)
+bool pmFPAReadDark(pmFPA *fpa, psFits *fits, pmConfig *config)
 {
     PS_ASSERT_PTR_NON_NULL(fpa, false);
     PS_ASSERT_FITS_NON_NULL(fits, false);
 
-    if (!pmFPARead(fpa, fits, db)) {
+    if (!pmFPARead(fpa, fits, config)) {
         psError(PS_ERR_UNKNOWN, false, "Unable to read dark FPA.");
         return false;
@@ -658,10 +658,10 @@
 }
 
-bool pmChipReadDark(pmChip *chip, psFits *fits, psDB *db)
+bool pmChipReadDark(pmChip *chip, psFits *fits, pmConfig *config)
 {
     PS_ASSERT_PTR_NON_NULL(chip, false);
     PS_ASSERT_FITS_NON_NULL(fits, false);
 
-    if (!pmChipRead(chip, fits, db)) {
+    if (!pmChipRead(chip, fits, config)) {
         psError(PS_ERR_UNKNOWN, false, "Unable to read dark chip.");
         return false;
@@ -690,5 +690,5 @@
 
 
-bool pmCellReadDark(pmCell *cell, psFits *fits, psDB *db)
+bool pmCellReadDark(pmCell *cell, psFits *fits, pmConfig *config)
 {
     PS_ASSERT_PTR_NON_NULL(cell, false);
@@ -696,5 +696,5 @@
 
     // Allow the usual pmFPARead functions to handle the heavy lifting for the images
-    if (!pmCellRead(cell, fits, db)) {
+    if (!pmCellRead(cell, fits, config)) {
         psError(PS_ERR_UNKNOWN, false, "Unable to read dark cell.");
         return false;
Index: trunk/psModules/src/detrend/pmDark.h
===================================================================
--- trunk/psModules/src/detrend/pmDark.h	(revision 18132)
+++ trunk/psModules/src/detrend/pmDark.h	(revision 18163)
@@ -5,4 +5,5 @@
 #include <pmHDU.h>
 #include <pmFPA.h>
+#include <pmConfig.h>
 
 #define PM_DARK_ANALYSIS_ORDINATES "DARK.ORDINATES" // Name for dark ordinates in the cell analysis metadata
@@ -45,5 +46,5 @@
 bool pmFPAWriteDark(pmFPA *fpa,         // FPA to write
                     psFits *fits,       // FITS file to which to write
-                    psDB *db,           // Database, for concepts
+                    pmConfig *config,   // Configuration
                     bool blank,         // Write a blank only?
                     bool recurse        // Recurse to lower levels?
@@ -53,5 +54,5 @@
 bool pmChipWriteDark(pmChip *chip,      // Chip to write
                      psFits *fits,      // FITS file to which to write
-                     psDB *db,          // Database, for concepts
+                     pmConfig *config,  // Configuration
                      bool blank,        // Write a blank only?
                      bool recurse       // Recurse to lower levels?
@@ -61,5 +62,5 @@
 bool pmCellWriteDark(pmCell *cell,      // Cell containing dark information
                      psFits *fits,      // FITS file to which to write
-                     psDB *db,          // Database, for concepts
+                     pmConfig *config,  // Configuration
                      bool blank         // Write a blank only?
     );
@@ -68,5 +69,5 @@
 bool pmFPAReadDark(pmFPA *fpa,          // FPA for which to read
                    psFits *fits,        // FITS file to read
-                   psDB *db             // Database, for concepts
+                   pmConfig *config     // Configuration
     );
 
@@ -74,5 +75,5 @@
 bool pmChipReadDark(pmChip *chip,       // Chip for which to read
                     psFits *fits,       // FITS file to read
-                    psDB *db            // Database, for concepts
+                    pmConfig *config    // Configuration
     );
 
@@ -80,5 +81,5 @@
 bool pmCellReadDark(pmCell *cell,       // Cell for which to read
                     psFits *fits,       // FITS file to read
-                    psDB *db            // Database, for concepts
+                    pmConfig *config    // Configuration
     );
 
