Index: /branches/eam_branches/ipp-20230313/Ohana/src/libdvo/src/dvo_photcode_utils.c
===================================================================
--- /branches/eam_branches/ipp-20230313/Ohana/src/libdvo/src/dvo_photcode_utils.c	(revision 42690)
+++ /branches/eam_branches/ipp-20230313/Ohana/src/libdvo/src/dvo_photcode_utils.c	(revision 42691)
@@ -1,3 +1,10 @@
 # include <dvo.h>
+
+/* the photcode table includes a number of SEC types, photcodes->Nsecfilt
+   hashNsec[code] returns the number in the sequence 0 - Nsecfilt for a given SEC code
+*/
+
+// these APIs originally just matched by number of the code, but they should
+// match by the *name* of the photcode (e.g., g = g)
 
 // Create a map between the secfilt values from one photcode table to another
@@ -11,20 +18,17 @@
   // loop over entries in the input table
   for (i = 0; i < NsecfiltIn; i++) {
-    int code  = input[0].codeNsec[i];
+    int inseq  = input[0].codeNsec[i];
+    myAssert (inseq > -1, "invalid SEC");
+    int incode   = input[0].hashcode[inseq];
     int entry = -1;
     // find the matching entry in the output table
     for (j = 0; j < NsecfiltOut; j++) {
-      int outcode = output[0].codeNsec[j];
-      if (code == outcode) {
-	 entry = j;
-	 break;
-      }
+      int outseq = output[0].codeNsec[j];
+      myAssert (outseq > -1, "invalid SEC");
+      int outcode   = output[0].hashcode[outseq];
+      if (strcmp (input[0].code[incode].name, output[0].code[outcode].name)) continue;
+      entry = j;
+      break;
     }
-    // if (entry == -1) {
-    //   // entry is missing fail (no printfs in this file)
-    //   free(map);
-    //   return(FALSE);
-    // }
-
     // if entry is still -1, we will skip this one (not map into the output db)
     map[i] = entry;
