Index: /trunk/Ohana/src/misc/Makefile
===================================================================
--- /trunk/Ohana/src/misc/Makefile	(revision 9606)
+++ /trunk/Ohana/src/misc/Makefile	(revision 9607)
@@ -72,5 +72,5 @@
 
 install:
-	for i in $(PROGRAMS); do make $$i.install; done
+	for i in $(PROGRAMS); do make $$i.install || exit; done
 
 clean:
Index: /trunk/Ohana/src/misc/src/ftable.c
===================================================================
--- /trunk/Ohana/src/misc/src/ftable.c	(revision 9606)
+++ /trunk/Ohana/src/misc/src/ftable.c	(revision 9607)
@@ -160,6 +160,6 @@
 
   FILE *f;
-  int Nx, Ny, extend, Nbytes;
-  char extname[82];
+  int i, Naxis, Nelem, Ncomp, extend, Nbytes, status;
+  char extname[82], exttype[82], axisname[32];
   Header header;
 
@@ -170,26 +170,72 @@
   }
 
-  if (!gfits_fread_header (f, &header)) {
-    fprintf (stderr, "can't read header from %s\n", file);
-    exit (1);
-  }
-
-  extend = FALSE;
-  gfits_scan (&header, "EXTEND", "%t", 1, &extend);
-  if (!extend) {
-    fprintf (stderr, "no extensions listed in file\n");
-  }
-
-  Nbytes = gfits_matrix_size (&header);
-  fseek (f, Nbytes, SEEK_CUR);
-
+  /* 
+     if (!gfits_fread_header (f, &header)) {
+     fprintf (stderr, "can't read header from %s\n", file);
+     exit (1);
+     }
+     Nbytes = gfits_matrix_size (&header);
+     fseek (f, Nbytes, SEEK_CUR);
+  */
+
+  fprintf (stdout, "%-30s %-15s NAXIS NAXIS(i)...\n", "extname", "datatype"); 
+
+  Ncomp = 0;
   while (gfits_fread_header (f, &header)) {
-    gfits_scan (&header, "EXTNAME", "%s", 1, extname);
-    gfits_scan (&header, "NAXIS1",  "%d", 1, &Nx);
-    gfits_scan (&header, "NAXIS2",  "%d", 1, &Ny);
-    fprintf (stdout, "%-30s %6d %6d\n", extname, Nx, Ny);
+    /* extract the EXTNAME for this component (set to PHU for 0th component) */
+    status = gfits_scan (&header, "EXTNAME", "%s", 1, extname);
+    if (!status) {
+      if (Ncomp == 0) {
+	strcpy (extname, "PHU");
+      } else {
+	strcpy (extname, "UNKNOWN");
+      }
+    }
+    fprintf (stdout, "%-30s ", extname);
+
+    /* extract the datatype for this component (IMAGE for 0th component) */
+    if (Ncomp == 0) {
+      strcpy (exttype, "IMAGE");
+    } else {
+      status = gfits_scan (&header, "XTENSION", "%s", 1, exttype);
+      if (!status) {
+	strcpy (exttype, "UNKNOWN");
+      }
+    }
+    fprintf (stdout, "%-15s ", exttype);
+
+    /* extract the rank of the component */
+    status = gfits_scan (&header, "NAXIS",  "%d", 1, &Naxis);
+    if (!status) {
+      fprintf (stderr, "component %d is missing Naxis!\n", Ncomp);
+      Ncomp ++;
+      continue;
+    }
+    fprintf (stdout, " %4d", Naxis);
+
+    /* extract the individual axes */
+    for (i = 0; i < Naxis; i++) {
+      sprintf (axisname, "NAXIS%d", i+1);
+      status = gfits_scan (&header, axisname,  "%d", 1, &Nelem);
+      if (!status) {
+	fprintf (stderr, "missing %s\n", axisname);
+      }
+      fprintf (stdout, " %7d", Nelem);
+    }
+    fprintf (stdout, "\n");
+
+    /* are extensions identified? (we will scan for them anyway) */
+    if (Ncomp == 0) {
+      extend = FALSE;
+      gfits_scan (&header, "EXTEND", "%t", 1, &extend);
+      if (!extend) {
+	fprintf (stderr, "no extensions listed in file\n");
+      }
+    }
 
     Nbytes = gfits_matrix_size (&header);
     fseek (f, Nbytes, SEEK_CUR);
+
+    Ncomp ++;
   }
   fclose (f);
