Index: /trunk/Ohana/src/opihi/dvo/cmpread.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/cmpread.c	(revision 8647)
+++ /trunk/Ohana/src/opihi/dvo/cmpread.c	(revision 8648)
@@ -6,5 +6,5 @@
 int cmpread (int argc, char **argv) {
   
-  int i, field, extend, Nbytes, Nstars;
+  int i, field, Naxis, Nbytes, Nstars;
   double tR, tD;
   float value;
@@ -71,12 +71,7 @@
 
   /* read from FITS table or from text table */
-  extend = FALSE;
-  gfits_scan (&header, "EXTEND",  "%t", 1, &extend);
-  if (extend) {
-    gprint (GP_ERR, "reading from FITS cmp file %s\n", argv[2]);
-    Nbytes = gfits_matrix_size (&header);
-    fseek (f, Nbytes, SEEK_CUR); 
-    stars = cmpReadFits (f, &Nstars);
-  } else {
+  Naxis = 0;
+  gfits_scan (&header, "NAXIS",  "%d", 1, &Naxis);
+  if (Naxis == 2) {
     /* allocate space for stars */
     gprint (GP_ERR, "reading from TEXT cmp file %s\n", argv[2]);
@@ -86,4 +81,9 @@
     }
     stars = cmpReadText (f, &Nstars);
+  } else {
+    gprint (GP_ERR, "reading from FITS cmp file %s\n", argv[2]);
+    Nbytes = gfits_matrix_size (&header);
+    fseek (f, Nbytes, SEEK_CUR); 
+    stars = cmpReadFits (f, &Nstars);
   }
   fclose (f);
