Index: trunk/Ohana/src/dvosplit/src/dvosplit.c
===================================================================
--- trunk/Ohana/src/dvosplit/src/dvosplit.c	(revision 15721)
+++ trunk/Ohana/src/dvosplit/src/dvosplit.c	(revision 15722)
@@ -4,11 +4,20 @@
 int main (int argc, char **argv) {
 
-  // USAGE: dvosplit (outlevel) [-catalog (name)] [-region RA RA DEC DEC]
+  // USAGE: dvosplit (outlevel) [-region RA RA DEC DEC]
 
   // the output catalog needs to inherit the SKY_DEPTH of the input catalog. 
   // if the CATDIR/SkyTable.fits is not found, assume the HST layout (old default)
+
+  // load the sky table for the existing database
   sky = SkyTableLoadOptimal (CATDIR, NULL, NULL, SKY_DEPTH_HST, VERBOSE);
   SkyTableSetFilenames (sky, CATDIR, "cpt");
-  skylist = SkyListByPatch (sky, -1, &REGION);
+
+  // XXX I should just be copying the input sky and setting the output names on that
+  // load the sky table for the existing database, generate output names
+  outsky = SkyTableLoadOptimal (CATDIR, NULL, NULL, SKY_DEPTH_HST, VERBOSE);
+  SkyTableSetFilenames (outsky, OUTDIR, "cpt");
+
+  // get the list of populated regions
+  skylist  = SkyListByPatch (sky, -1, &REGION);
   
   for (i = 0; i < skylist[0].Nregions; i++) {
@@ -17,4 +26,7 @@
     // if (current level >  out level) skip: cannot currently merge catalogs
     // if (current level == out level) skip: no action is needed
+    if (skylist[0].regions[i][0].depth >= OUT_DEPTH) continue;
+
+    outlist = SkyListByPatch (outsky, OUT_DEPTH, skylist[0].regions[i]);
 
     // set the parameters which guide catalog open/load/create
@@ -23,8 +35,6 @@
     incatalog.catflags = LOAD_NONE;
 
-    // XXX how do I open and not read the entire catalog?
-
     // an error exit status here is a significant error
-    if (!dvo_catalog_open (&incatalog, skylist[0].regions[i], VERBOSE, "rp")) {
+    if (!dvo_catalog_open (&incatalog, skylist[0].regions[i], VERBOSE, "r")) {
       fprintf (stderr, "ERROR: failure to open catalog file %s\n", incatalog.filename);
       exit (2);
