Index: trunk/ppStack/src/ppStackMatch.c
===================================================================
--- trunk/ppStack/src/ppStackMatch.c	(revision 19172)
+++ trunk/ppStack/src/ppStackMatch.c	(revision 19196)
@@ -192,4 +192,16 @@
     }
 
+#ifdef TESTING
+        {
+            static int num = 0;         // Image counter
+            psString filename = NULL;   // Output filename
+            psStringAppend(&filename, "stack_kernel_%d.fits", num++);
+            psFits *fits = psFitsOpen(filename, "w"); // FITS file for subtraction kernel
+            psFree(filename);
+            pmReadoutWriteSubtractionKernels(output, fits);
+            psFitsClose(fits);
+        }
+#endif
+
     // Extract the regions and solutions used in the image matching
     // This stops them from being freed when we iterate back up the FPA
