Index: trunk/Ohana/src/opihi/dvo2/skydbsearch.c
===================================================================
--- trunk/Ohana/src/opihi/dvo2/skydbsearch.c	(revision 5438)
+++ trunk/Ohana/src/opihi/dvo2/skydbsearch.c	(revision 5439)
@@ -181,195 +181,4 @@
 }
 
-SkyRegion *SkyBuildTable (SkyRegion *seed, int Nseed, int level, int depth) {
-
-  /* given a table of Rmin, Dmin, Rmax, Dmax, name, at level 3, generate
-     all higher levels and 'depth' extra levels */
-
-  /* levels:
-     0 - fullsky.cpt
-     1 - n????.cpt, s????.cpt
-     2 - r????.cpt
-     3 - ????.cpt
-     4 - ????.??.cpt
-  */
-  
-  SkyRegion *db;
-
-  /* allocate at least 30 for levels 0 & 1 */
-  NREGION = 100;
-  ALLOCATE (db, SkyRegion, NREGION);
-
-  /* full sky */
-  strcpy (region[0].name, "fullsky.cpt");
-  region[0].Rmin =   0; region[0].Rmax = 360;
-  region[0].Dmin = -90; region[0].Dmax =  90;
-  region[0].depth = 0;
-  region[0].child = FALSE;
-  N = 1;
-
-  region[0].childS = N;
-  /* north dec bands */
-  for (dec = 0; dec < 90; dec += 7.5) {
-    sprintf (region[N].name, "n%04d.cpt", (int) 100*dec);
-    region[N].Rmin =   0; region[N].Rmax = 360;
-    region[N].Dmin = dec; region[N].Dmax = dec + 7.5;
-    region[N].depth = 1;
-    region[N].child = FALSE;
-    N++;
-  }
-  /* south dec bands */
-  for (dec = 0; dec > -90; dec -= 7.5) {
-    sprintf (region[N].name, "s%04d.cpt", (int) 100*dec);
-    region[N].Rmin =   0;       region[N].Rmax = 360;
-    region[N].Dmin = dec - 7.5; region[N].Dmax = dec;
-    region[N].depth = 1;
-    region[N].child = FALSE;
-    N++;
-  }
-  region[0].childE = N;
-
-  /* subdivide dec bands based on seed */
-  Rnumber = 0;
-  childS = region[0].childS;
-  childE = region[0].childE;
-  for (i = childS; i < childE; i++) {
-
-    Nnew = 0;
-    NNEW = 100;
-    ALLOCATE (new, SkyRegion, NNEW);
-
-    for (j = 0; j < Nseed; j++) {
-      /* skip seeds outside of parent bound */
-      if (seed[j].Rmin > region[i].Rmax) continue;
-      if (seed[j].Rmax < region[i].Rmin) continue;
-      if (seed[j].Dmin > region[i].Dmax) continue;
-      if (seed[j].Dmax < region[i].Dmin) continue;
-      
-      for (k = 0; k < Nnew; k++) {
-	if ((seed[j].Rmin == new[k].Rmin) && 
-	    (seed[j].Rmax == new[k].Rmax)) { 
-	  goto next_seed;
-	}
-	if ((seed[j].Rmin == new[k].Rmin) ^^ 
-	    (seed[j].Rmax != new[k].Rmax)) { 
-	  fprintf (stderr, "inconsistent blocks in seed file\n");
-	  return (NULL);
-	}
-      }	
-      /* new region spans full DEC band.  */
-      new[Nnew].Dmin = region[i].Dmin;
-      new[Nnew].Dmax = region[i].Dmax;
-      
-      Ntall = (region[i].Dmax - region[i].Dmin) / (seed[j].Dmax - seed[j].Dmin);
-      
-      /* fi
-
-      new[Nnew].Rmin = seed[j].Rmin;
-      new[Nnew].Rmax = seed[j].Rmax;
-      new[Nnew].depth = 2;
-      new[Nnew].child = FALSE;
-      strncpy (root, region[i].name, 5); root[5] = 0;
-      sprintf (new[Nnew].name, "%s/r%04d.cpt", root, Rnumber);
-      Rnumber ++;      
-      Nnew ++;
-      if (Nnew == NNEW) {
-	NNEW += 100;
-	REALLOCATE (new, SkyRegion, NNEW);
-      }
-    next_seed:
-    }
-    /* update db list */
-    region[i].childS = N;
-    region[i].childE = N + Nnew;
-    NREGION = N + Nnew + 100;
-    REALLOCATE (db, SkyRegion, NREGION);
-    memcpy (&region[N], new, Nnew*sizeof(SkyRegion));
-    free (new);
-    N += Nnew;
-  }
-
-  /* subdivide ra strips based on seed */
-  childS = region[region[0].childS].childS;
-  childE = region[region[0].childE - 1].childE;
-  nextS = N;
-  for (i = childS; i < childE; i++) {
-
-    Nnew = 0;
-    NNEW = 100;
-    ALLOCATE (new, SkyRegion, NNEW);
-
-    for (j = 0; j < Nseed; j++) {
-      if (seed[j].Rmin > region[i].Rmax) continue;
-      if (seed[j].Rmax < region[i].Rmin) continue;
-      if (seed[j].Dmin > region[i].Dmax) continue;
-      if (seed[j].Dmax < region[i].Dmin) continue;
-      
-      for (k = 0; k < Nnew; k++) {
-	if ((seed[j].Dmin == new[k].Dmin) && 
-	    (seed[j].Dmax == new[k].Dmax)) { 
-	  goto next_seed;
-	}
-	if ((seed[j].Dmin == new[k].Dmin) ^^ 
-	    (seed[j].Dmax != new[k].Dmax)) { 
-	  fprintf (stderr, "inconsistent blocks in seed file\n");
-	  return (NULL);
-	}
-      }	
-      new[Nnew].Dmin = seed[j].Dmin;
-      new[Nnew].Dmax = seed[j].Dmax;
-      new[Nnew].Rmin = region[i].Rmin;
-      new[Nnew].Rmax = region[i].Rmax;
-      new[Nnew].depth = 3;
-      new[Nnew].child = FALSE;
-      strcpy (new[Nnew].name, seed[j].name);
-      Nnew ++;
-      if (Nnew == NNEW) {
-	NNEW += 100;
-	REALLOCATE (new, SkyRegion, NNEW);
-      }
-    next_seed:
-    }
-    
-    /* update db list */
-    region[i].childS = N;
-    region[i].childE = N + Nnew;
-    NREGION = N + Nnew + 100;
-    REALLOCATE (db, SkyRegion, NREGION);
-    memcpy (&region[N], new, Nnew*sizeof(SkyRegion));
-    free (new);
-    N += Nnew;
-  }
-  nextE = N;
-
-  /* subdivide entries once more */
-  childS = nextS;
-  childE = nextE;
-  for (i = childS; i < childE; i++) {
-    Rnumber = 0;
-    region[i].childS = N;
-    dDec = (region[i].Dmax - region[i].Dmin) / 5.0;
-    dRa  = (region[i].Rmax - region[i].Rmin) / 5.0;
-    for (nx = 0; nx < 5; nx++) {
-      for (ny = 0; ny < 5; ny++) {
-	region[N].Dmin = region[i].Dmin + dDec * (nx + 0);
-	region[N].Dmax = region[i].Dmax + dDec * (nx + 1);
-	region[N].Rmin = region[i].Rmin + dDec * (nx + 0);
-	region[N].Rmax = region[i].Rmax + dDec * (nx + 1);
-	region[N].depth = 3;
-	region[N].child = FALSE;
-	strncpy (root, region[i].name, 10); root[10] = 0;
-	sprintf (region[N].name, "%s.%02d.cpt", root, Rnumber);
-	Rnumber ++;
-	N ++;
-	if (N == NREGION) {
-	  NREGION += 100;
-	  REALLOCATE (new, SkyRegion, NREGION);
-	}
-      }
-    }
-  }
-
-}
-
 /* region is pointer to entry in db */
 SkyRegion *SkyExtend (SkyRegion *db, SkyRegion *region) {
