Index: /branches/eam_branches/ipp-20130306/Ohana/src/opihi/dvo/mextract.c
===================================================================
--- /branches/eam_branches/ipp-20130306/Ohana/src/opihi/dvo/mextract.c	(revision 35243)
+++ /branches/eam_branches/ipp-20130306/Ohana/src/opihi/dvo/mextract.c	(revision 35244)
@@ -1,3 +1,21 @@
 # include "dvoshell.h"
+
+int field_needs_images (dbField *field) {
+  // the image subset table requires imageID for all fields
+
+    if (!MEASURE_HAS_XCCD) {
+      // I'm keeping this code because it gives a way of handling dvo dbs that don't have
+      // measure.xccd if we need it
+      if (field->ID == MEAS_XCCD) return TRUE; // full astrometry per chip (120 bytes!)
+      if (field->ID == MEAS_YCCD) return TRUE; // full astrometry per chip (120 bytes!)
+    }
+    if (field->ID == MEAS_XMOSAIC) 	  return TRUE; // crval1,2 only
+    if (field->ID == MEAS_YMOSAIC) 	  return TRUE; // crval1,2 only
+    if (field->ID == MEAS_EXTERN_ID)      return TRUE; // externID
+    if (field->ID == MEAS_FLAT)           return TRUE; // Mcal
+    if (field->ID == MEAS_CENTER_OFFSET)  return TRUE; // 0.5*NX, 0.5*NY
+    if (field->ID == MEAS_EXPNAME_AS_INT) return TRUE; // expname (or as int)
+    return FALSE;
+}
 
 int mextract (int argc, char **argv) {
@@ -5,5 +23,5 @@
   off_t i, j, k, m; // used for counter averages and measures
   int n, N, Npts, NPTS, last, next, state, Nfields, Nreturn, Ncstack, Nstack;
-  int Nsecfilt, VERBOSE, loadImages, mosaicMode;
+  int Nsecfilt, VERBOSE, loadImages;
   char **cstack, name[1024];
   dbValue *values;
@@ -121,19 +139,8 @@
   // load image data if needed (for fields listed below)
   loadImages = FALSE;
-  mosaicMode = FALSE;
   for (i = 0; !loadImages && (i < Nfields); i++) {
-    if (!MEASURE_HAS_XCCD) {
-      // I'm keeping this code because it gives a way of handling dvo dbs that don't have
-      // measure.xccd if we need it
-      if (fields[i].ID == MEAS_XCCD) loadImages = TRUE;
-      if (fields[i].ID == MEAS_YCCD) loadImages = TRUE;
-    }
-    if (fields[i].ID == MEAS_XMOSAIC) 	    loadImages = mosaicMode = TRUE;
-    if (fields[i].ID == MEAS_YMOSAIC) 	    loadImages = mosaicMode = TRUE;
-    if (fields[i].ID == MEAS_EXTERN_ID)     loadImages = mosaicMode = TRUE;
-    if (fields[i].ID == MEAS_FLAT)          loadImages = mosaicMode = TRUE;
-    if (fields[i].ID == MEAS_CENTER_OFFSET) loadImages = mosaicMode = TRUE;
-  }
-  if (loadImages && !SetImageSelection (mosaicMode, selection)) goto escape;
+    loadImages = field_needs_images (&fields[i]);
+  }
+  if (loadImages && !SetImageSelection (TRUE, selection)) goto escape;
 
   /* create storage vector */
Index: /branches/eam_branches/ipp-20130306/Ohana/src/opihi/dvo/mmatch.c
===================================================================
--- /branches/eam_branches/ipp-20130306/Ohana/src/opihi/dvo/mmatch.c	(revision 35243)
+++ /branches/eam_branches/ipp-20130306/Ohana/src/opihi/dvo/mmatch.c	(revision 35244)
@@ -1,3 +1,4 @@
 # include "dvoshell.h"
+int field_needs_images (dbField *field);
 
 /* This function uses the 'find_match' algorithm to select the objects of interest.
@@ -164,17 +165,6 @@
   // load image data if needed (for fields listed below)
   int loadImages = FALSE;
-  int mosaicMode = FALSE;
   for (i = 0; !loadImages && (i < Nfields); i++) {
-    if (!MEASURE_HAS_XCCD) {
-      // I'm keeping this code because it gives a way of handling dvo dbs that don't have
-      // measure.xccd if we need it
-      if (fields[i].ID == MEAS_XCCD) loadImages = TRUE;
-      if (fields[i].ID == MEAS_YCCD) loadImages = TRUE;
-    }
-    if (fields[i].ID == MEAS_XMOSAIC) 	    loadImages = mosaicMode = TRUE;
-    if (fields[i].ID == MEAS_YMOSAIC) 	    loadImages = mosaicMode = TRUE;
-    if (fields[i].ID == MEAS_EXTERN_ID)     loadImages = mosaicMode = TRUE;
-    if (fields[i].ID == MEAS_FLAT)          loadImages = mosaicMode = TRUE;
-    if (fields[i].ID == MEAS_CENTER_OFFSET) loadImages = mosaicMode = TRUE;
+    loadImages = field_needs_images (&fields[i]);
   }
 
@@ -183,5 +173,5 @@
   selection.useDisplay = FALSE;
   selection.useSkyregion = FALSE;
-  if (loadImages && !SetImageSelection (mosaicMode, &selection)) goto escape;
+  if (loadImages && !SetImageSelection (TRUE, &selection)) goto escape;
 
   /* load regions which contain all supplied RA,DEC coordinates */
Index: /branches/eam_branches/ipp-20130306/Ohana/src/opihi/dvo/mmextract.c
===================================================================
--- /branches/eam_branches/ipp-20130306/Ohana/src/opihi/dvo/mmextract.c	(revision 35243)
+++ /branches/eam_branches/ipp-20130306/Ohana/src/opihi/dvo/mmextract.c	(revision 35244)
@@ -1,3 +1,4 @@
 # include "dvoshell.h"
+int field_needs_images (dbField *field);
 
 int mmextract (int argc, char **argv) {
@@ -7,5 +8,5 @@
   int Nfields, Nreturn, Nreturn_base, Ncstack1, Ncstack2, Nstack1, Nstack2;
   int Nwhere, Iwhere, Nmatch, Imatch, NTABLE, Nt1, Nt2, n1, n2;
-  int Nsecfilt, VERBOSE, loadImages, mosaicMode;
+  int Nsecfilt, VERBOSE, loadImages;
   char **cstack1, **cstack2, name1[1024], name2[1024];
   dbValue *values, **table1, **table2;
@@ -137,12 +138,8 @@
   // load image data if needed (for fields listed below)
   loadImages = FALSE;
-  mosaicMode = FALSE;
   for (i = 0; !loadImages && (i < Nfields); i++) {
-    if (fields[i].ID == MEAS_XCCD) loadImages = TRUE;
-    if (fields[i].ID == MEAS_YCCD) loadImages = TRUE;
-    if (fields[i].ID == MEAS_XMOSAIC) loadImages = mosaicMode = TRUE;
-    if (fields[i].ID == MEAS_YMOSAIC) loadImages = mosaicMode = TRUE;
-  }
-  if (loadImages && !SetImageSelection (mosaicMode, selection)) goto escape;
+    loadImages = field_needs_images (&fields[i]);
+  }
+  if (loadImages && !SetImageSelection (TRUE, selection)) goto escape;
 
   /* create storage vector */
