Index: branches/pap/ppSub/src/ppSubDefineOutput.c
===================================================================
--- branches/pap/ppSub/src/ppSubDefineOutput.c	(revision 23704)
+++ branches/pap/ppSub/src/ppSubDefineOutput.c	(revision 23711)
@@ -29,9 +29,10 @@
     pmCell *outCell = pmFPAfileThisCell(config->files, view, name); // Output cell
     pmFPA *outFPA = outCell->parent->parent; // Output FPA
-    pmHDU *outHDU = outFPA->hdu; // Output HDU
+    pmHDU *outHDU = outFPA->hdu;        // Output HDU
     if (!outHDU->header) {
         outHDU->header = psMetadataAlloc();
     }
 
+    // The output readout may already be present if we read in the convolution kernel
     pmReadout *outRO = NULL;            // Output readout
     if (outCell->readouts && outCell->readouts->n > 0 && outCell->readouts->data[0]) {
@@ -41,5 +42,5 @@
     }
 
-    // convolved input images
+    // Convolved input images
     pmReadout *inConv = pmFPAfileThisReadout(config->files, view, "PPSUB.INPUT.CONV"); // Input readout
     pmReadout *refConv = pmFPAfileThisReadout(config->files, view, "PPSUB.REF.CONV"); // Reference readout
@@ -63,4 +64,14 @@
                      kernels->description);
 
+    // Add additional data to the header
+    pmFPAfile *refFile = psMetadataLookupPtr(NULL, config->files, "PPSUB.REF"); // Reference file
+    pmFPAfile *inFile = psMetadataLookupPtr(NULL, config->files, "PPSUB.INPUT"); // Input file
+    psMetadataAddStr(outHDU->header, PS_LIST_TAIL, "PPSUB.REFERENCE", 0,
+                     "Subtraction reference", refFile->filename);
+    psMetadataAddStr(outHDU->header, PS_LIST_TAIL, "PPSUB.INPUT", 0,
+                     "Subtraction input", inFile->filename);
+    ppSubVersionHeader(outHDU->header);
+
+
     outRO->analysis = psMetadataCopy(outRO->analysis, analysis);
 
