Index: /trunk/Ohana/src/opihi/dvo/skycat.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/skycat.c	(revision 39353)
+++ /trunk/Ohana/src/opihi/dvo/skycat.c	(revision 39354)
@@ -44,4 +44,14 @@
   skylist = SkyListByRadius (sky, Depth, graphmode.coords.crval1, graphmode.coords.crval2, Radius);
   
+  HostTable *table = NULL;  
+  char *CATDIR = GetCATDIR();
+  if (HostTableExists (CATDIR, sky->hosts)) {
+    table = HostTableLoad (CATDIR, sky->hosts);
+    if (!table) {
+      gprint (GP_ERR, "ERROR: failure reading Host Table %s for parallel database %s\n", sky->hosts, CATDIR);
+      return FALSE;
+    }    
+  }
+
   if (VERBOSE) gprint (GP_ERR, "region: %6.2f - %6.2f, %6.2f - %6.2f\n", 
 			graphmode.coords.crval1 - Radius, graphmode.coords.crval1 + Radius, 
@@ -65,30 +75,40 @@
 
   for (i = 0; (i < Nregions) && !interrupt; i++) {
-    if (ShowAll || (stat (skylist[0].filename[i], &filestat) != -1)) {
-      if (VERBOSE) gprint (GP_ERR, "%3d %s %6.2f - %6.2f, %6.2f - %6.2f\n", i, regions[i][0].name, 
-			    regions[i][0].Rmin, regions[i][0].Rmax, regions[i][0].Dmin, regions[i][0].Dmax);
+    if (!ShowAll) {
+      char hostfile[1024];
+      if (table) {
+	int hostID = (regions[i][0].hostFlags & DATA_USE_BCK) ? regions[i][0].backupID : regions[i][0].hostID;
+	int index = table->index[hostID];
+	snprintf (hostfile, 1024, "%s/%s.cpt", table->hosts[index].pathname, regions[i][0].name);
+      } else {
+	strcpy (hostfile, skylist[0].filename[i]);
+      }
+      if (stat (hostfile, &filestat) == -1) continue;
+    }
 
-      leftside = -1;
-      RD_to_XYpic (&X[0], &Y[0], regions[i][0].Rmin, regions[i][0].Dmin, &graphmode.coords, Rmin, Rmax, Rmid, &leftside);
-      RD_to_XYpic (&X[1], &Y[1], regions[i][0].Rmin, regions[i][0].Dmax, &graphmode.coords, Rmin, Rmax, Rmid, &leftside);
-      RD_to_XYpic (&X[2], &Y[2], regions[i][0].Rmax, regions[i][0].Dmax, &graphmode.coords, Rmin, Rmax, Rmid, &leftside);
-      RD_to_XYpic (&X[3], &Y[3], regions[i][0].Rmax, regions[i][0].Dmin, &graphmode.coords, Rmin, Rmax, Rmid, &leftside);
-
-      Xvec.elements.Flt[Npts] = X[0];
-      Yvec.elements.Flt[Npts] = Y[0];
-      for (j = 1; j < 4; j++) {
-	Xvec.elements.Flt[Npts + j*2 - 0] = X[j];
-	Yvec.elements.Flt[Npts + j*2 - 0] = Y[j];
-	Xvec.elements.Flt[Npts + j*2 - 1] = X[j];
-	Yvec.elements.Flt[Npts + j*2 - 1] = Y[j];
-      }
-      Xvec.elements.Flt[Npts+7] = Xvec.elements.Flt[Npts];
-      Yvec.elements.Flt[Npts+7] = Yvec.elements.Flt[Npts];
-      Npts += 8;
-      if (Npts > NPTS - 1) {  /* this is OK because NPTS is made always a multiple of 8 */
-	NPTS += 200;
-	REALLOCATE (Xvec.elements.Flt, opihi_flt, NPTS);
-	REALLOCATE (Yvec.elements.Flt, opihi_flt, NPTS);
-      }
+    if (VERBOSE) gprint (GP_ERR, "%3d %s %6.2f - %6.2f, %6.2f - %6.2f\n", i, regions[i][0].name, 
+			 regions[i][0].Rmin, regions[i][0].Rmax, regions[i][0].Dmin, regions[i][0].Dmax);
+    
+    leftside = -1;
+    RD_to_XYpic (&X[0], &Y[0], regions[i][0].Rmin, regions[i][0].Dmin, &graphmode.coords, Rmin, Rmax, Rmid, &leftside);
+    RD_to_XYpic (&X[1], &Y[1], regions[i][0].Rmin, regions[i][0].Dmax, &graphmode.coords, Rmin, Rmax, Rmid, &leftside);
+    RD_to_XYpic (&X[2], &Y[2], regions[i][0].Rmax, regions[i][0].Dmax, &graphmode.coords, Rmin, Rmax, Rmid, &leftside);
+    RD_to_XYpic (&X[3], &Y[3], regions[i][0].Rmax, regions[i][0].Dmin, &graphmode.coords, Rmin, Rmax, Rmid, &leftside);
+    
+    Xvec.elements.Flt[Npts] = X[0];
+    Yvec.elements.Flt[Npts] = Y[0];
+    for (j = 1; j < 4; j++) {
+      Xvec.elements.Flt[Npts + j*2 - 0] = X[j];
+      Yvec.elements.Flt[Npts + j*2 - 0] = Y[j];
+      Xvec.elements.Flt[Npts + j*2 - 1] = X[j];
+      Yvec.elements.Flt[Npts + j*2 - 1] = Y[j];
+    }
+    Xvec.elements.Flt[Npts+7] = Xvec.elements.Flt[Npts];
+    Yvec.elements.Flt[Npts+7] = Yvec.elements.Flt[Npts];
+    Npts += 8;
+    if (Npts > NPTS - 1) {  /* this is OK because NPTS is made always a multiple of 8 */
+      NPTS += 200;
+      REALLOCATE (Xvec.elements.Flt, opihi_flt, NPTS);
+      REALLOCATE (Yvec.elements.Flt, opihi_flt, NPTS);
     }
   }
