Index: trunk/psphot/src/psphot.h
===================================================================
--- trunk/psphot/src/psphot.h	(revision 23161)
+++ trunk/psphot/src/psphot.h	(revision 23167)
@@ -19,4 +19,5 @@
 psString        psphotVersionLong(void);
 bool            psphotVersionHeader(psMetadata *header);
+bool            psphotVersionHeaderFull(psMetadata *header);
 
 bool            psphotModelTest (pmConfig *config, const pmFPAview *view, psMetadata *recipe);
Index: trunk/psphot/src/psphotImageLoop.c
===================================================================
--- trunk/psphot/src/psphotImageLoop.c	(revision 23161)
+++ trunk/psphot/src/psphotImageLoop.c	(revision 23167)
@@ -26,4 +26,5 @@
 
     pmFPAview *view = pmFPAviewAlloc (0);
+    pmHDU *lastHDU = NULL;              // Last HDU updated
 
     // files associated with the science image
@@ -64,4 +65,13 @@
                 psLogMsg ("psphot", 6, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
                 if (! readout->data_exists) { continue; }
+
+                // Update the header
+                {
+                    pmHDU *hdu = pmHDUGetHighest(input->fpa, chip, cell);
+                    if (hdu && hdu != lastHDU) {
+                        psphotVersionHeaderFull(hdu->header);
+                        lastHDU = hdu;
+                    }
+                }
 
                 // run the actual photometry analysis on this chip/cell/readout
Index: trunk/psphot/src/psphotVersion.c
===================================================================
--- trunk/psphot/src/psphotVersion.c	(revision 23161)
+++ trunk/psphot/src/psphotVersion.c	(revision 23167)
@@ -75,2 +75,23 @@
     return true;
 }
+
+
+bool psphotVersionHeaderFull(psMetadata *header)
+{
+    PS_ASSERT_METADATA_NON_NULL(header, false);
+
+    psTime *time = psTimeGetNow(PS_TIME_TAI); // The time now
+    psString timeString = psTimeToISO(time); // The time in an ISO string
+    psFree(time);
+    psString history = NULL;               // History string
+    psStringAppend(&history, "ppImage at %s", timeString);
+    psFree(timeString);
+    psMetadataAddStr(header, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, NULL, history);
+    psFree(history);
+
+    psLibVersionHeader(header);
+    psModulesVersionHeader(header);
+    psphotVersionHeader(header);
+
+    return true;
+}
