Index: trunk/Ohana/src/opihi/dvo/avextract.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/avextract.c	(revision 30612)
+++ trunk/Ohana/src/opihi/dvo/avextract.c	(revision 31450)
@@ -5,5 +5,5 @@
   off_t i, j, n, m;
   int N, Npts, NPTS, last, next, state, Nfields, Nreturn, Ncstack, Nstack;
-  int Nsecfilt, mode, VERBOSE;
+  int Nsecfilt, mode, VERBOSE, needMeasures;
   char **cstack, name[1024];
   void *Signal;
@@ -101,4 +101,13 @@
   }
 
+  // check the requested fields : are all average/secfilt entries, or do we need measures?
+  needMeasures = FALSE;
+  for (i = 0; !needMeasures && (i < Nfields); i++) {
+    if (fields[i].magMode == MAG_NONE) continue;
+    if (fields[i].photcode == NULL) continue; // assert this?
+    if (fields[i].photcode[0].type == PHOT_REF) needMeasures = TRUE;
+    if (fields[i].photcode[0].type == PHOT_DEP) needMeasures = TRUE;
+  }
+
   // grab data from all selected sky regions
   Signal = signal (SIGINT, handle_interrupt);
@@ -107,5 +116,8 @@
     /* lock, load, unlock catalog */
     catalog.filename = skylist[0].filename[i];
-    catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF;
+    catalog.catflags = LOAD_AVES | LOAD_SECF;
+    if (needMeasures) {
+      catalog.catflags |= LOAD_MEAS;
+    }
     catalog.Nsecfilt = 0;
 
