Index: /trunk/ppStack/src/ppStackLoop.c
===================================================================
--- /trunk/ppStack/src/ppStackLoop.c	(revision 18167)
+++ /trunk/ppStack/src/ppStackLoop.c	(revision 18168)
@@ -431,9 +431,9 @@
 
                 if (!pmReadoutReadChunk(readout, imageFits->data[i], 0, numScans, overlap,
-                                        config->database) ||
+                                        config) ||
                     !pmReadoutReadChunkMask(readout, maskFits->data[i], 0, numScans, overlap,
-                                            config->database) ||
+                                            config) ||
                     !pmReadoutReadChunkWeight(readout, weightFits->data[i], 0, numScans, overlap,
-                                              config->database)) {
+                                              config)) {
                     psError(PS_ERR_IO, false, "Unable to read chunk %d for file %d", numChunk, i);
                     psFree(readouts);
@@ -474,7 +474,7 @@
                     continue;
                 }
-                more &= pmReadoutMore(readout, imageFits->data[i], 0, numScans, config->database);
-                more &= pmReadoutMoreMask(readout, maskFits->data[i], 0, numScans, config->database);
-                more &= pmReadoutMoreWeight(readout, weightFits->data[i], 0, numScans, config->database);
+                more &= pmReadoutMore(readout, imageFits->data[i], 0, numScans, config);
+                more &= pmReadoutMoreMask(readout, maskFits->data[i], 0, numScans, config);
+                more &= pmReadoutMoreWeight(readout, weightFits->data[i], 0, numScans, config);
             }
         }
@@ -554,8 +554,8 @@
                 assert(readout);
 
-                if (!pmReadoutReadChunk(readout, imageFits->data[i], 0, numScans, 0, config->database) ||
-                    !pmReadoutReadChunkMask(readout, maskFits->data[i], 0, numScans, 0, config->database) ||
+                if (!pmReadoutReadChunk(readout, imageFits->data[i], 0, numScans, 0, config) ||
+                    !pmReadoutReadChunkMask(readout, maskFits->data[i], 0, numScans, 0, config) ||
                     !pmReadoutReadChunkWeight(readout, weightFits->data[i], 0, numScans, 0,
-                                              config->database)) {
+                                              config)) {
                     psError(PS_ERR_IO, false, "Unable to read chunk %d for file %d", numChunk, i);
                     psFree(readouts);
@@ -597,7 +597,7 @@
                     continue;
                 }
-                more &= pmReadoutMore(readout, imageFits->data[i], 0, numScans, config->database);
-                more &= pmReadoutMoreMask(readout, maskFits->data[i], 0, numScans, config->database);
-                more &= pmReadoutMoreWeight(readout, weightFits->data[i], 0, numScans, config->database);
+                more &= pmReadoutMore(readout, imageFits->data[i], 0, numScans, config);
+                more &= pmReadoutMoreMask(readout, maskFits->data[i], 0, numScans, config);
+                more &= pmReadoutMoreWeight(readout, weightFits->data[i], 0, numScans, config);
             }
         }
Index: /trunk/ppStats/src/ppStats.h
===================================================================
--- /trunk/ppStats/src/ppStats.h	(revision 18167)
+++ /trunk/ppStats/src/ppStats.h	(revision 18168)
@@ -14,5 +14,5 @@
     bool doStats;                       // Do pixel statistics?
     bool fileLevel;                     // Output file level?
-    pmFPAview *fileView;		// View to analyse
+    pmFPAview *fileView;                // View to analyse
 
     psList *headers;                    // Headers to read
@@ -30,26 +30,26 @@
 ppStatsData *ppStatsDataAlloc(void);
 
-/// Perform the ppStats steps on the given FPA (optionally for specified view) 
+/// Perform the ppStats steps on the given FPA (optionally for specified view)
 psMetadata *ppStatsFPA(psMetadata *out,
-		       pmFPA *fpa,         // FPA for which to get statistics
-		       pmFPAview *view,    // View for analysis
-		       psMaskType maskVal, // Value to mask
-		       pmConfig *config    // Configuration
+                       pmFPA *fpa,         // FPA for which to get statistics
+                       pmFPAview *view,    // View for analysis
+                       psMaskType maskVal, // Value to mask
+                       pmConfig *config    // Configuration
     );
 
 psExit ppStatsChip(psMetadata *fpaResults, // Metadata holding the fpa results
-		   pmChip *chip,     // Chip for which to get statistics
-		   psFits *fits,     // FITS file handle
-		   pmFPAview *view,  // View for analysis
-		   ppStatsData *data,// The data
-		   const pmConfig *config // Configuration
+                   pmChip *chip,     // Chip for which to get statistics
+                   psFits *fits,     // FITS file handle
+                   pmFPAview *view,  // View for analysis
+                   ppStatsData *data,// The data
+                   pmConfig *config // Configuration
     );
 
 psExit ppStatsCell(psMetadata *chipResults, // Metadata holding the chip results
-		   pmCell *cell,     // Cell for which to get statistics
-		   psFits *fits,     // FITS file handle
-		   pmFPAview *view,  // View for analysis
-		   ppStatsData *data,// The data
-		   const pmConfig *config // Configuration
+                   pmCell *cell,     // Cell for which to get statistics
+                   psFits *fits,     // FITS file handle
+                   pmFPAview *view,  // View for analysis
+                   ppStatsData *data,// The data
+                   pmConfig *config  // Configuration
     );
 
@@ -64,16 +64,16 @@
 // measure only the pixel-related statistics (stats, summary)
 psMetadata *ppStatsPixels(psMetadata *out,
-			  pmFPA *fpa,         // FPA for which to get statistics
-			  pmFPAview *view,    // View for analysis
-			  psMaskType maskVal, // Value to mask
-			  pmConfig *config    // Configuration
+                          pmFPA *fpa,         // FPA for which to get statistics
+                          pmFPAview *view,    // View for analysis
+                          psMaskType maskVal, // Value to mask
+                          pmConfig *config    // Configuration
     );
 
 // measure only the non-pixel-related statistics (headers, concepts)
 psMetadata *ppStatsMetadata(psMetadata *out,
-			    pmFPA *fpa,         // FPA for which to get statistics
-			    pmFPAview *view,    // View for analysis
-			    psMaskType maskVal, // Value to mask
-			    pmConfig *config    // Configuration
+                            pmFPA *fpa,         // FPA for which to get statistics
+                            pmFPAview *view,    // View for analysis
+                            psMaskType maskVal, // Value to mask
+                            pmConfig *config    // Configuration
     );
 
@@ -81,5 +81,5 @@
 psMetadata *ppStatsLoop(psExit *result,
                         ppStatsData *data, // The data
-                        const pmConfig *config // Configuration
+                        pmConfig *config // Configuration
     );
 
@@ -101,29 +101,29 @@
 
 void p_ppStatsGetMetadata(psMetadata *target, // Target for metadata
-			  psMetadata *source, // Source for metadata
-			  psList *list    // List containing keywords
+                          psMetadata *source, // Source for metadata
+                          psList *list    // List containing keywords
     );
 
 void p_ppStatsGetAnalysis(psMetadata *target, // Output Target for metadata
-			  psList *headers,    // List containing desired keywords
-			  psMetadata *source, // Input Source for metadata
-			  psList *list        // List containing analysis blocks
+                          psList *headers,    // List containing desired keywords
+                          psMetadata *source, // Input Source for metadata
+                          psList *list        // List containing analysis blocks
     );
 
 bool p_ppStatsDoThis(psList *toDoList,    // List of things to do
-		     const char *this     // The name of "this"
+                     const char *this     // The name of "this"
     );
 
 void p_ppStatsAddToHierarchy(psMetadata *source, // Source to add
-			     psMetadata *target, // Target to which to add
-			     const char *name, // Name of source
-			     const char *comment // Comment for source
+                             psMetadata *target, // Target to which to add
+                             const char *name, // Name of source
+                             const char *comment // Comment for source
     );
 
 psExit ppStatsReadout(psMetadata *cellResults, // Metadata holding the chip results
-		      pmReadout *readout,	// Cell for which to get statistics
-		      int nReadout,	// readout number
-		      ppStatsData *data,	// The data
-		      const pmConfig *config // Configuration
+                      pmReadout *readout,       // Cell for which to get statistics
+                      int nReadout,     // readout number
+                      ppStatsData *data,        // The data
+                      const pmConfig *config // Configuration
     );
 
Index: /trunk/ppStats/src/ppStatsCell.c
===================================================================
--- /trunk/ppStats/src/ppStatsCell.c	(revision 18167)
+++ /trunk/ppStats/src/ppStatsCell.c	(revision 18168)
@@ -6,5 +6,5 @@
                    pmFPAview *view,  // View for analysis
                    ppStatsData *data,   // The data
-                   const pmConfig *config // Configuration
+                   pmConfig *config // Configuration
     )
 {
@@ -49,5 +49,5 @@
         // extract from existing headers
         if (cell->hdu) {
-            if (fits && !pmCellReadHeader(cell, fits, config->database)) {
+            if (fits && !pmCellReadHeader(cell, fits, config)) {
                 psError (PS_ERR_IO, false, "trouble reading cell header\n");
                 psFree(cellResults);
@@ -65,10 +65,10 @@
     // Extract Concept values
     if (psListLength(data->concepts) > 0) {
-        if (fits && cell->hdu && !pmCellReadHeader(cell, fits, config->database)) {
+        if (fits && cell->hdu && !pmCellReadHeader(cell, fits, config)) {
             psError (PS_ERR_IO, false, "trouble reading cell header\n");
             psFree(cellResults);
             return PS_EXIT_DATA_ERROR;
         }
-        pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_ALL, false, config->database);
+        pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_ALL, false, config);
         p_ppStatsGetMetadata(cellResults, cell->concepts, data->concepts);
     }
@@ -77,5 +77,5 @@
     if (data->doStats || psListLength(data->summary)) {
         // Read the image pixel data
-        if (fits && !pmCellRead(cell, fits, config->database)) {
+        if (fits && !pmCellRead(cell, fits, config)) {
             psError (PS_ERR_IO, false, "trouble reading cell data\n");
             psFree(cellResults);
Index: /trunk/ppStats/src/ppStatsChip.c
===================================================================
--- /trunk/ppStats/src/ppStatsChip.c	(revision 18167)
+++ /trunk/ppStats/src/ppStatsChip.c	(revision 18168)
@@ -2,9 +2,9 @@
 
 psExit ppStatsChip(psMetadata *fpaResults, // Metadata holding the fpa results
-		   pmChip *chip,     // Chip for which to get statistics
-		   psFits *fits,     // FITS file handle
-		   pmFPAview *view,  // View for analysis
-		   ppStatsData *data,// The data
-		   const pmConfig *config // Configuration
+                   pmChip *chip,     // Chip for which to get statistics
+                   psFits *fits,     // FITS file handle
+                   pmFPAview *view,  // View for analysis
+                   ppStatsData *data,// The data
+                   pmConfig *config // Configuration
     )
 {
@@ -22,5 +22,5 @@
     }
     if (!chip->file_exists && !chip->data_exists) {
-	return PS_EXIT_SUCCESS;
+        return PS_EXIT_SUCCESS;
     }
 
@@ -36,28 +36,28 @@
     // Extract Header values
     if (psListLength(data->headers)) {
-	// extract from existing headers
-	if (chip->hdu) {
-	    if (fits && !pmChipReadHeader(chip, fits, config->database)) {
-		psError (PS_ERR_IO, false, "trouble reading chip header\n");
-		psFree(chipResults);
-		return PS_EXIT_DATA_ERROR;
-	    }
-	    pmHDU *hdu = chip->hdu;     // HDU for headers
-	    p_ppStatsGetMetadata(chipResults, hdu->header, data->headers);
-	}
-	// extract from data->analysis output MD entries
-	if (psListLength(data->analysis)) {
-	    p_ppStatsGetAnalysis (chipResults, data->headers, chip->analysis, data->analysis);
-	}
+        // extract from existing headers
+        if (chip->hdu) {
+            if (fits && !pmChipReadHeader(chip, fits, config)) {
+                psError (PS_ERR_IO, false, "trouble reading chip header\n");
+                psFree(chipResults);
+                return PS_EXIT_DATA_ERROR;
+            }
+            pmHDU *hdu = chip->hdu;     // HDU for headers
+            p_ppStatsGetMetadata(chipResults, hdu->header, data->headers);
+        }
+        // extract from data->analysis output MD entries
+        if (psListLength(data->analysis)) {
+            p_ppStatsGetAnalysis (chipResults, data->headers, chip->analysis, data->analysis);
+        }
     }
 
     // Extract Concept values
     if (psListLength(data->concepts) > 0) {
-        if (fits && chip->hdu && !pmChipReadHeader(chip, fits, config->database)) {
+        if (fits && chip->hdu && !pmChipReadHeader(chip, fits, config)) {
             psError (PS_ERR_IO, false, "trouble reading chip header\n");
             psFree(chipResults);
             return PS_EXIT_DATA_ERROR;
         }
-        pmConceptsReadChip(chip, PM_CONCEPT_SOURCE_ALL, false, false, config->database);
+        pmConceptsReadChip(chip, PM_CONCEPT_SOURCE_ALL, false, false, config);
         p_ppStatsGetMetadata(chipResults, chip->concepts, data->concepts);
     }
@@ -73,5 +73,5 @@
     // Iterate over cells (if view->cell is set, skip all others)
     for (int i = 0; i < cells->n; i++) {
-	if ((view->cell >= 0) && (i != view->cell)) continue; 
+        if ((view->cell >= 0) && (i != view->cell)) continue;
         pmCell *cell = cells->data[i];  // Cell of interest
         psExit result = ppStatsCell(chipResults, cell, fits, view, data, config);
Index: /trunk/ppStats/src/ppStatsLoop.c
===================================================================
--- /trunk/ppStats/src/ppStatsLoop.c	(revision 18167)
+++ /trunk/ppStats/src/ppStatsLoop.c	(revision 18168)
@@ -3,5 +3,5 @@
 psMetadata *ppStatsLoop(psExit *result,
                         ppStatsData *data, // The data
-                        const pmConfig *config // Configuration
+                        pmConfig *config // Configuration
     )
 {
