Index: /trunk/psModules/src/camera/pmFPAfile.c
===================================================================
--- /trunk/psModules/src/camera/pmFPAfile.c	(revision 11103)
+++ /trunk/psModules/src/camera/pmFPAfile.c	(revision 11104)
@@ -254,11 +254,7 @@
     if (strstr (newName, "{FILTER.ID}") != NULL) {
         if (file->fpa != NULL) {
-            char *filterName = psMetadataLookupStr (NULL, file->fpa->concepts, "FPA.FILTER");
-            psMetadata *filterTable = psMetadataLookupPtr (NULL, file->camera, "FILTER.ID");
-            if (filterName && *filterName && filterTable) {
-                char *ID = psMetadataLookupStr (NULL, filterTable, filterName);
-                if (ID && *ID) {
-                    psStringSubstitute(&newName, ID, "{FILTER.ID}");
-                }
+            char *filterID = pmConceptsFilterIDfromConcept ("FPA.FILTER", file->fpa->concepts, file->camera);
+            if (filterID && *filterID) {
+                psStringSubstitute(&newName, filterID, "{FILTER.ID}");
             }
         }
Index: /trunk/psModules/src/concepts/pmConceptsPhotcode.c
===================================================================
--- /trunk/psModules/src/concepts/pmConceptsPhotcode.c	(revision 11103)
+++ /trunk/psModules/src/concepts/pmConceptsPhotcode.c	(revision 11104)
@@ -40,2 +40,21 @@
     return photcode;
 }
+
+char *pmConceptsFilterIDfromConcept (char *concept, psMetadata *concepts, psMetadata *camera)
+{
+
+    bool status;
+
+    char *filterName = psMetadataLookupStr (&status, concepts, concept);
+    if (!status)
+        psAbort ("psModules", "missing concept %s", concept);
+    psMetadata *filterTable = psMetadataLookupPtr (&status, camera, "FILTER.ID");
+    if (!status)
+        psAbort ("ppImage", "missing FILTER.ID table");
+    char *filter = psMetadataLookupStr (&status, filterTable, filterName);
+    if (!status)
+        psAbort ("ppImage", "FILTER %s not found in FILTER.ID table", filterName);
+
+    return filter;
+}
+
Index: /trunk/psModules/src/concepts/pmConceptsPhotcode.h
===================================================================
--- /trunk/psModules/src/concepts/pmConceptsPhotcode.h	(revision 11103)
+++ /trunk/psModules/src/concepts/pmConceptsPhotcode.h	(revision 11104)
@@ -7,6 +7,6 @@
 /// @author Eugene Magnier, IfA
 ///
-/// @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
-/// @date $Date: 2006-10-16 22:03:56 $
+/// @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
+/// @date $Date: 2007-01-15 21:59:31 $
 ///
 /// Copyright 2005-2006 Institute for Astronomy, University of Hawaii
@@ -27,4 +27,5 @@
 /// the PHASE2 recipe.  Interpolation using the usual syntax (e.g., "{CHIP.NAME}") is permitted.
 psString pmConceptsPhotcodeForView(pmConfig *config, pmFPAfile *file, pmFPAview *view);
+char *pmConceptsFilterIDfromConcept (char *concept, psMetadata *concepts, psMetadata *camera);
 
 # endif
