Index: /branches/dvo-mods-2007-02/Ohana/src/addstar/src/gstars.c
===================================================================
--- /branches/dvo-mods-2007-02/Ohana/src/addstar/src/gstars.c	(revision 12269)
+++ /branches/dvo-mods-2007-02/Ohana/src/addstar/src/gstars.c	(revision 12270)
@@ -176,4 +176,21 @@
       }
   }
+  // some old format files did not write EXTTYPE.  they have a single table in the first
+  // extension matched to the header in the PHU
+  if (Nimage == 0) {
+      extsize[0] = headers[0][0].size + gfits_matrix_size (headers[0]);
+      extsize[1] = headers[1][0].size + gfits_matrix_size (headers[1]);
+      gfits_scan (headers[1], "EXTNAME", "%s", 1, tmpword);
+      if (!strcmp (tmpword, "SMPFILE")) {
+	  extdata[Nimage] = strcreate (tmpword);
+	  exttype[Nimage] = strcreate ("SMPDATA");
+	  exthead[Nimage] = strcreate ("PHU");
+	  extnum_head[Nimage] = 0;
+	  extnum_data[Nimage] = 1;
+	  Nimage = 1;
+      }
+  }
+  if (Nimage == 0) Shutdown ("no object data in file");
+    
   if (VERBOSE) fprintf (stderr, "file %s has %d headers, including %d images\n", file[0], Nheader, Nimage);
 
@@ -185,5 +202,6 @@
       ReadImageHeader (headers[Nhead], &image[i], 0);
 
-      if (!strcmp(exthead[i], "PHU")) continue;
+      // this is an error we should not encounter
+      if (!strcmp(extdata[i], "PHU")) Shutdown ("error in data segment: PHU cannot be table");
 
       // advance the pointer to the start of the corresponding table block
