Index: trunk/ppImage/src/ppImageDetrendPedestal.c
===================================================================
--- trunk/ppImage/src/ppImageDetrendPedestal.c	(revision 5858)
+++ trunk/ppImage/src/ppImageDetrendPedestal.c	(revision 6747)
@@ -1,3 +1,6 @@
-# include "ppImage.h"
+#include <stdio.h>
+#include "pslib.h"
+#include "psmodules.h"
+#include "ppImage.h"
 
 // XXX check on image overlaps, as well as image sizes
@@ -13,52 +16,52 @@
 
     if (options->doDark) {
-	// Dark time for input image
-	float inputTime = psMetadataLookupF32(NULL, input->concepts, "CELL.DARKTIME");
-	if (inputTime <= 0) {
-	    psErrorStackPrint(stderr, "DARKTIME for input image (%f) is non-positive.\n",
-			      inputTime);
-	    exit(EXIT_FAILURE);
-	}
+        // Dark time for input image
+        float inputTime = psMetadataLookupF32(NULL, input->concepts, "CELL.DARKTIME");
+        if (inputTime <= 0) {
+            psErrorStackPrint(stderr, "DARKTIME for input image (%f) is non-positive.\n",
+                              inputTime);
+            exit(EXIT_FAILURE);
+        }
 
-	if (inputTime != lastExptime) {
-	    // this will create a new pedestal if the input one is NULL
-	    // XXX EAM : this function had darkTime * inputTime, which is wrong, yes?
-	    if (pedestal == NULL) {
-		pedestal = pmReadoutAlloc (NULL);
-	    }
-	    pedestal->col0    = dark->col0;
-	    pedestal->row0    = dark->row0;
-	    pedestal->colBins = dark->colBins;
-	    pedestal->rowBins = dark->rowBins;
+        if (inputTime != lastExptime) {
+            // this will create a new pedestal if the input one is NULL
+            // XXX EAM : this function had darkTime * inputTime, which is wrong, yes?
+            if (pedestal == NULL) {
+                pedestal = pmReadoutAlloc (NULL);
+            }
+            pedestal->col0    = dark->col0;
+            pedestal->row0    = dark->row0;
+            pedestal->colBins = dark->colBins;
+            pedestal->rowBins = dark->rowBins;
 
-	    pedestal->image   = (psImage *) psBinaryOp(pedestal->image, dark->image, "*", psScalarAlloc(inputTime / darkTime, PS_TYPE_F32));
-	    reusePedestal = false;
-	    lastExptime = inputTime
-	}
+            pedestal->image   = (psImage *) psBinaryOp(pedestal->image, dark->image, "*", psScalarAlloc(inputTime / darkTime, PS_TYPE_F32));
+            reusePedestal = false;
+            lastExptime = inputTime
+        }
     }
 
     // no bias image, return dark pedestal or NULL
     if (!options->doBias) {
-	return pedestal;
+        return pedestal;
     }
 
     // no dark image, return bias pedestal, or reuse
     if (!options->doDark) {
-	if (!pedestal) {
-	    pedestal = psMemIncrRefCounter(bias);
-	}
-	return pedestal;
+        if (!pedestal) {
+            pedestal = psMemIncrRefCounter(bias);
+        }
+        return pedestal;
     }
 
     if (reusePedestal) {
-	return pedestal;
+        return pedestal;
     }
 
     if (bias->image->numRows != dark->image->numRows ||
-	bias->image->numCols != dark->image->numCols) {
-	psError(PS_ERR_IO, true, "Bias and dark images have different dimensions: %dx%d vs %dx%d\n", 
-		bias->image->numCols, bias->image->numRows,
-		dark->image->numCols, dark->image->numRows);
-	exit(EXIT_FAILURE);
+        bias->image->numCols != dark->image->numCols) {
+        psError(PS_ERR_IO, true, "Bias and dark images have different dimensions: %dx%d vs %dx%d\n",
+                bias->image->numCols, bias->image->numRows,
+                dark->image->numCols, dark->image->numRows);
+        exit(EXIT_FAILURE);
     }
 
@@ -71,4 +74,4 @@
 
 // creates a new pedestal image for this readout
-// if the current exptime is the same as the last exptime, 
+// if the current exptime is the same as the last exptime,
 // reuses the supplied pedestal
