Index: trunk/Ohana/src/opihi/dvo/dbExtractMeasures.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/dbExtractMeasures.c	(revision 13479)
+++ trunk/Ohana/src/opihi/dvo/dbExtractMeasures.c	(revision 14191)
@@ -22,6 +22,10 @@
 
   switch (field->ID) {
-    // XXX not sure how to apply the photcode here....
     case MEAS_MAG: /* magnitudes are already determined above */
+      // if user has requested a photcode, supply the value only if we match (else NO_MAG)
+      if ((field->photcode->type != PHOT_MAG) && 
+	  (measure[0].photcode != field->photcode->code)) {
+	  break;
+      }
       switch (field->magMode) {
 	case MAG_INST:
