Index: trunk/psphot/src/psphotOutput.c
===================================================================
--- trunk/psphot/src/psphotOutput.c	(revision 11313)
+++ trunk/psphot/src/psphotOutput.c	(revision 11382)
@@ -73,4 +73,23 @@
     }
     fclose (f);
+    return true;
+}
+
+bool psphotAddPhotcode (psMetadata *recipe, pmConfig *config, pmFPAview *view) {
+
+    bool status;
+
+    pmFPAfile *input = psMetadataLookupPtr (&status, config->files, "PSPHOT.INPUT");
+    assert (status);
+
+    // determine PHOTCODE from fpa & view, overwrite in recipe
+    // XXX test this:
+    char *photcode = pmConceptsPhotcodeForView (config, input, view);
+    assert (photcode);
+
+    psMetadataAddStr (recipe, PS_LIST_TAIL, "PHOTCODE", PS_META_REPLACE, "photcode from FPA concepts", photcode);
+    psLogMsg ("psphot", 3, "PHOTCODE is %s", photcode);
+
+    psFree (photcode);
     return true;
 }
