Index: trunk/pois/src/poisCheckKernel.c
===================================================================
--- trunk/pois/src/poisCheckKernel.c	(revision 4700)
+++ trunk/pois/src/poisCheckKernel.c	(revision 6891)
@@ -4,6 +4,6 @@
 
 bool poisCheckKernel(const psVector *solution,// Kernel solution
-		     const psArray *kernels, // Kernel basis functions
-		     const poisConfig *config // Configuration
+                     const psArray *kernels, // Kernel basis functions
+                     const poisConfig *config // Configuration
     )
 {
@@ -13,38 +13,39 @@
     psVector *radKernel = psVectorAlloc((2*config->xKernel + 1) * (2*config->yKernel + 1), PS_TYPE_F32);
     psVector *radii = psVectorAlloc((2*config->xKernel + 1) * (2*config->yKernel + 1), PS_TYPE_F32); // Radius
+    radKernel->n = radii->n = (2*config->xKernel + 1) * (2*config->yKernel + 1);
     for (int i = 0; i < solution->n - 1; i++) {
-	poisKernelBasis *kernel = kernels->data[i]; // The kernel basis function
-	if (kernel->xOrder == 0 && kernel->yOrder == 0) {
-	    int u = kernel->u;		// x offset
-	    int v = kernel->v;		// y offset
-	    float distance = sqrtf((float)(u*u) + (float)(v*v)); // Distance from the centre
-	    radKernel->data.F32[i] = solution->data.F64[i];
-	    radii->data.F32[i] = distance;
-	}
+        poisKernelBasis *kernel = kernels->data[i]; // The kernel basis function
+        if (kernel->xOrder == 0 && kernel->yOrder == 0) {
+            int u = kernel->u;          // x offset
+            int v = kernel->v;          // y offset
+            float distance = sqrtf((float)(u*u) + (float)(v*v)); // Distance from the centre
+            radKernel->data.F32[i] = solution->data.F64[i];
+            radii->data.F32[i] = distance;
+        }
     }
 
     psVector *sortIndex = psVectorSortIndex(NULL, radii); // Indices from sort
-    float distance = 0.0;		// Distance from the centre that's being examined
-    float sum = 0.0;			// Sum of kernel for that distance
-    int num = 0;			// Number of pixels at that distance
+    float distance = 0.0;               // Distance from the centre that's being examined
+    float sum = 0.0;                    // Sum of kernel for that distance
+    int num = 0;                        // Number of pixels at that distance
     int centreIndex = sortIndex->data.U32[0]; // Index of the centre pixel
-    int numSuspect = 0;			// Number of radii considered suspect
+    int numSuspect = 0;                 // Number of radii considered suspect
     for (int i = 0; i < (2*config->xKernel + 1) * (2*config->yKernel + 1); i++) {
-	unsigned int index = sortIndex->data.U32[i];
-	if (radii->data.F32[index] != distance) {
-	    psTrace("pois.checkKernel", 7, "Radius: %f\tMean: %f\n", distance, sum/(float)num);
-	    if (fabs(distance*sum/(float)num) > radKernel->data.F32[centreIndex]) {
-		numSuspect++;
-	    }
-	    sum = 0.0;
-	    num = 0;
-	    distance = radii->data.F32[index];
-	}
-	sum += radKernel->data.F32[index];
-	num++;
+        unsigned int index = sortIndex->data.U32[i];
+        if (radii->data.F32[index] != distance) {
+            psTrace("pois.checkKernel", 7, "Radius: %f\tMean: %f\n", distance, sum/(float)num);
+            if (fabs(distance*sum/(float)num) > radKernel->data.F32[centreIndex]) {
+                numSuspect++;
+            }
+            sum = 0.0;
+            num = 0;
+            distance = radii->data.F32[index];
+        }
+        sum += radKernel->data.F32[index];
+        num++;
     }
     psTrace("pois.checkKernel", 7, "Radius: %f\tMean: %f\n", distance, sum/(float)num);
     if (fabs(distance*sum/(float)num) > radKernel->data.F32[centreIndex]) {
-	numSuspect++;
+        numSuspect++;
     }
 
@@ -56,6 +57,6 @@
 
     if (numSuspect > 0) {
-	psWarning("There is significant power at large radii.  The kernel may be bad.\n");
-	return false;
+        psWarning("There is significant power at large radii.  The kernel may be bad.\n");
+        return false;
     }
 
