Index: trunk/Ohana/src/addstar/src/UpdateDatabase_Image.c
===================================================================
--- trunk/Ohana/src/addstar/src/UpdateDatabase_Image.c	(revision 38470)
+++ trunk/Ohana/src/addstar/src/UpdateDatabase_Image.c	(revision 38471)
@@ -43,7 +43,8 @@
 
     // set the parameters which guide catalog open/load/create
+    dvo_catalog_init (&catalog, TRUE);
+    catalog.filename  = skylist[0].filename[i];
     catalog.catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
     catalog.catmode   = dvo_catalog_catmode (CATMODE);      // set the default catmode from config data
-    catalog.filename  = skylist[0].filename[i];
     catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
     catalog.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
Index: trunk/Ohana/src/addstar/src/UpdateDatabase_Refcat.c
===================================================================
--- trunk/Ohana/src/addstar/src/UpdateDatabase_Refcat.c	(revision 38470)
+++ trunk/Ohana/src/addstar/src/UpdateDatabase_Refcat.c	(revision 38471)
@@ -32,4 +32,5 @@
 
     // set the parameters which guide catalog open/load/create
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename  = skylist[0].filename[i];
     catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
Index: trunk/Ohana/src/addstar/src/UpdateDatabase_Reflist.c
===================================================================
--- trunk/Ohana/src/addstar/src/UpdateDatabase_Reflist.c	(revision 38470)
+++ trunk/Ohana/src/addstar/src/UpdateDatabase_Reflist.c	(revision 38471)
@@ -32,4 +32,5 @@
 
     // set the parameters which guide catalog open/load/create
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename  = skylist[0].filename[i];
     catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
Index: trunk/Ohana/src/addstar/src/addstar.c
===================================================================
--- trunk/Ohana/src/addstar/src/addstar.c	(revision 38470)
+++ trunk/Ohana/src/addstar/src/addstar.c	(revision 38471)
@@ -104,4 +104,5 @@
 
     // set the parameters which guide catalog open/load/create
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename    = skylist[0].filename[i];
     catalog.catmode     = dvo_catalog_catmode (CATMODE);         // set the default catmode from config data
Index: trunk/Ohana/src/addstar/src/load2mass_as_rawdata.c
===================================================================
--- trunk/Ohana/src/addstar/src/load2mass_as_rawdata.c	(revision 38470)
+++ trunk/Ohana/src/addstar/src/load2mass_as_rawdata.c	(revision 38471)
@@ -178,4 +178,5 @@
 
 	// now we have all of the loaded stars in this catalog
+	dvo_catalog_init (&catalog, TRUE);
 	catalog.filename = skylist[0].filename[0];
 	catalog.catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
Index: trunk/Ohana/src/addstar/src/loadICRF_catalog.c
===================================================================
--- trunk/Ohana/src/addstar/src/loadICRF_catalog.c	(revision 38470)
+++ trunk/Ohana/src/addstar/src/loadICRF_catalog.c	(revision 38471)
@@ -7,4 +7,5 @@
 
   // now we have all of the loaded stars in this catalog
+  dvo_catalog_init (&catalog, TRUE);
   catalog.filename = filename;
   catalog.catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
Index: trunk/Ohana/src/addstar/src/loadstarpar_catalog.c
===================================================================
--- trunk/Ohana/src/addstar/src/loadstarpar_catalog.c	(revision 38470)
+++ trunk/Ohana/src/addstar/src/loadstarpar_catalog.c	(revision 38471)
@@ -7,4 +7,5 @@
 
   // now we have all of the loaded stars in this catalog
+  dvo_catalog_init (&catalog, TRUE);
   catalog.filename = filename;
   catalog.catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
Index: trunk/Ohana/src/addstar/src/loadsupercos_rawdata.c
===================================================================
--- trunk/Ohana/src/addstar/src/loadsupercos_rawdata.c	(revision 38470)
+++ trunk/Ohana/src/addstar/src/loadsupercos_rawdata.c	(revision 38471)
@@ -168,4 +168,5 @@
 
 	// now we have all of the loaded stars in this catalog
+	dvo_catalog_init (&catalog, TRUE);
 	catalog.filename = skylist[0].filename[0];
 	catalog.catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
Index: trunk/Ohana/src/addstar/src/loadtycho_rawdata.c
===================================================================
--- trunk/Ohana/src/addstar/src/loadtycho_rawdata.c	(revision 38470)
+++ trunk/Ohana/src/addstar/src/loadtycho_rawdata.c	(revision 38471)
@@ -128,4 +128,5 @@
 
       // now we have all of the loaded stars in this catalog
+      dvo_catalog_init (&catalog, TRUE);
       catalog.filename = skylist[0].filename[0];
       catalog.catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
Index: trunk/Ohana/src/addstar/src/loadwise_prelim_rawdata.c
===================================================================
--- trunk/Ohana/src/addstar/src/loadwise_prelim_rawdata.c	(revision 38470)
+++ trunk/Ohana/src/addstar/src/loadwise_prelim_rawdata.c	(revision 38471)
@@ -183,4 +183,5 @@
 
 	// now we have all of the loaded stars in this catalog
+	dvo_catalog_init (&catalog, TRUE);
 	catalog.filename = skylist[0].filename[0];
 	catalog.catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
Index: trunk/Ohana/src/addstar/src/loadwise_rawdata.c
===================================================================
--- trunk/Ohana/src/addstar/src/loadwise_rawdata.c	(revision 38470)
+++ trunk/Ohana/src/addstar/src/loadwise_rawdata.c	(revision 38471)
@@ -185,4 +185,5 @@
 
 	// now we have all of the loaded stars in this catalog
+	dvo_catalog_init (&catalog, TRUE);
 	catalog.filename = skylist[0].filename[0];
 	catalog.catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
Index: trunk/Ohana/src/addstar/src/resort_threaded.c
===================================================================
--- trunk/Ohana/src/addstar/src/resort_threaded.c	(revision 38470)
+++ trunk/Ohana/src/addstar/src/resort_threaded.c	(revision 38471)
@@ -40,4 +40,6 @@
     char hostfile[1024];
     snprintf (hostfile, 1024, "%s/%s.cpt", HOSTDIR, threadData->region->name);
+
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename  = HOST_ID ? hostfile : threadData->filename;
 
Index: trunk/Ohana/src/addstar/src/resort_unthreaded.c
===================================================================
--- trunk/Ohana/src/addstar/src/resort_unthreaded.c	(revision 38470)
+++ trunk/Ohana/src/addstar/src/resort_unthreaded.c	(revision 38471)
@@ -18,4 +18,6 @@
     char hostfile[1024];
     snprintf (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name);
+
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename  = HOST_ID ? hostfile : skylist[0].filename[i];
 
Index: trunk/Ohana/src/addstar/src/sedstar.c
===================================================================
--- trunk/Ohana/src/addstar/src/sedstar.c	(revision 38470)
+++ trunk/Ohana/src/addstar/src/sedstar.c	(revision 38471)
@@ -25,4 +25,5 @@
 
   for (i = 0; i < skylist[0].Nregions; i++) {
+    dvo_catalog_init (&incatalog, TRUE);
     incatalog.filename = skylist[0].filename[i];
     incatalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_SECFILT;
Index: trunk/Ohana/src/addstar/test/relphot.flatcorr.dvo
===================================================================
--- trunk/Ohana/src/addstar/test/relphot.flatcorr.dvo	(revision 38470)
+++ trunk/Ohana/src/addstar/test/relphot.flatcorr.dvo	(revision 38471)
@@ -194,5 +194,5 @@
 
   # run relphot on the db and check that the images now match the expected values
-  tapEXEC relphot -images g,r -v -region 9.5 10.5 19.5 20.5 -D CATDIR $catdir -D STAR_TOOFEW 1 -D SIGMA_LIM 0.07 -statmode WT_MEAN -cloud-limit 0.5 -D IMAGE_OFFSET 0.5 -update -synthphot_zpts $fileroot.synthzpts.fits
+  tapEXEC relphot -images g,r -v -region 9.5 10.5 19.5 20.5 -D CATDIR $catdir -D STAR_TOOFEW 1 -D SIGMA_LIM 0.07 -statmode WT_MEAN -cloud-limit 0.5 -D IMAGE_OFFSET 0.5 -update -synthphot-zpts $fileroot.synthzpts.fits
   for i 0 mjd_uc[]
     ckexposure $catdir mjd_uc[$i] zpt_uc[$i] exptime_uc[$i] airmass_uc[$i] $filt_uc:$i relphot_uc
Index: trunk/Ohana/src/checkastro/src/load_catalogs.c
===================================================================
--- trunk/Ohana/src/checkastro/src/load_catalogs.c	(revision 38470)
+++ trunk/Ohana/src/checkastro/src/load_catalogs.c	(revision 38471)
@@ -30,4 +30,6 @@
     char hostfile[1024];
     snprintf (hostfile, 1024, "%s/%s.cpt", hostpath, skylist[0].regions[i]->name);
+
+    dvo_catalog_init (pcatalog, TRUE);
     pcatalog->filename = hostID ? hostfile : skylist[0].filename[i];
 
Index: trunk/Ohana/src/delstar/src/delete_duplicate_images.c
===================================================================
--- trunk/Ohana/src/delstar/src/delete_duplicate_images.c	(revision 38470)
+++ trunk/Ohana/src/delstar/src/delete_duplicate_images.c	(revision 38471)
@@ -108,4 +108,6 @@
     char hostfile[1024];
     snprintf (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name);
+
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename  = HOST_ID ? hostfile : skylist[0].filename[i];
     catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
Index: trunk/Ohana/src/delstar/src/delete_duplicate_measures.c
===================================================================
--- trunk/Ohana/src/delstar/src/delete_duplicate_measures.c	(revision 38470)
+++ trunk/Ohana/src/delstar/src/delete_duplicate_measures.c	(revision 38471)
@@ -43,4 +43,6 @@
     char hostfile[1024];
     snprintf (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name);
+
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename  = HOST_ID ? hostfile : skylist[0].filename[i];
     catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
Index: trunk/Ohana/src/delstar/src/delete_fix_LAP.c
===================================================================
--- trunk/Ohana/src/delstar/src/delete_fix_LAP.c	(revision 38470)
+++ trunk/Ohana/src/delstar/src/delete_fix_LAP.c	(revision 38471)
@@ -41,4 +41,6 @@
     char hostfile[1024];
     snprintf (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name);
+
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename  = HOST_ID ? hostfile : skylist[0].filename[i];
     catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
Index: trunk/Ohana/src/delstar/src/delete_fix_LAP_edges.c
===================================================================
--- trunk/Ohana/src/delstar/src/delete_fix_LAP_edges.c	(revision 38470)
+++ trunk/Ohana/src/delstar/src/delete_fix_LAP_edges.c	(revision 38471)
@@ -49,4 +49,6 @@
     char hostfile[1024];
     snprintf (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name);
+
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename  = HOST_ID ? hostfile : skylist[0].filename[i];
     catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
Index: trunk/Ohana/src/delstar/src/delete_fix_LAP_edges_delete.c
===================================================================
--- trunk/Ohana/src/delstar/src/delete_fix_LAP_edges_delete.c	(revision 38470)
+++ trunk/Ohana/src/delstar/src/delete_fix_LAP_edges_delete.c	(revision 38471)
@@ -89,4 +89,6 @@
     char hostfile[1024];
     snprintf (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name);
+
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename  = HOST_ID ? hostfile : skylist[0].filename[i];
     catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
Index: trunk/Ohana/src/delstar/src/delete_imagefile.c
===================================================================
--- trunk/Ohana/src/delstar/src/delete_imagefile.c	(revision 38470)
+++ trunk/Ohana/src/delstar/src/delete_imagefile.c	(revision 38471)
@@ -24,4 +24,6 @@
 
     if (VERBOSE) fprintf (stderr, "deleting from %s\n", sky[0].filename[i]);
+
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename = sky[0].filename[i];  /* don't free region before catalog! */
     catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
Index: trunk/Ohana/src/delstar/src/delete_imagename.c
===================================================================
--- trunk/Ohana/src/delstar/src/delete_imagename.c	(revision 38470)
+++ trunk/Ohana/src/delstar/src/delete_imagename.c	(revision 38471)
@@ -39,4 +39,5 @@
     for (i = 0; i < skylist[0].Nregions; i++) {
       if (VERBOSE) fprintf (stderr, "deleting from %s\n", skylist[0].filename[i]);
+      dvo_catalog_init (&catalog, TRUE);
       catalog.filename = skylist[0].filename[i];  /* don't free region before catalog! */
       catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
Index: trunk/Ohana/src/delstar/src/delete_photcodes.c
===================================================================
--- trunk/Ohana/src/delstar/src/delete_photcodes.c	(revision 38470)
+++ trunk/Ohana/src/delstar/src/delete_photcodes.c	(revision 38471)
@@ -39,4 +39,6 @@
     char hostfile[1024];
     snprintf (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name);
+
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename  = HOST_ID ? hostfile : skylist[0].filename[i];
     catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
Index: trunk/Ohana/src/delstar/src/delete_photcodes_single.c
===================================================================
--- trunk/Ohana/src/delstar/src/delete_photcodes_single.c	(revision 38470)
+++ trunk/Ohana/src/delstar/src/delete_photcodes_single.c	(revision 38471)
@@ -8,4 +8,5 @@
   PhotCode **photcodes = ParsePhotcodeList (PHOTCODE_LIST, &Nphotcodes, FALSE);
 
+  dvo_catalog_init (&catalog, TRUE);
   catalog.filename  = cptname;
   catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
Index: trunk/Ohana/src/delstar/src/delete_times.c
===================================================================
--- trunk/Ohana/src/delstar/src/delete_times.c	(revision 38470)
+++ trunk/Ohana/src/delstar/src/delete_times.c	(revision 38471)
@@ -60,4 +60,5 @@
   for (i = 0; i < skylist[0].Nregions; i++) {
     if (VERBOSE) fprintf (stderr, "deleting from %s\n", skylist[0].filename[i]);
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename = skylist[0].filename[i];  /* don't free region before catalog! */
     catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
Index: trunk/Ohana/src/dvolens/src/update_objects.c
===================================================================
--- trunk/Ohana/src/dvolens/src/update_objects.c	(revision 38470)
+++ trunk/Ohana/src/dvolens/src/update_objects.c	(revision 38471)
@@ -49,4 +49,6 @@
     char hostfile[1024];
     snprintf (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name);
+
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename = HOST_ID ? hostfile : skylist[0].filename[i];
 
Index: trunk/Ohana/src/dvomerge/src/LoadCatalog.c
===================================================================
--- trunk/Ohana/src/dvomerge/src/LoadCatalog.c	(revision 38470)
+++ trunk/Ohana/src/dvomerge/src/LoadCatalog.c	(revision 38471)
@@ -3,18 +3,19 @@
 int LoadCatalog (Catalog *catalog, SkyRegion *region, char *filename, char *mode, int Nsecfilt) {
 
-    // set the parameters which guide catalog open/load/create
-    catalog[0].filename  = filename;
-    catalog[0].Nsecfilt  = Nsecfilt;
+  // set the parameters which guide catalog open/load/create
+  dvo_catalog_init (catalog, TRUE);
+  catalog[0].filename  = filename;
+  catalog[0].Nsecfilt  = Nsecfilt;
 
-    // always load all of the data (if any exists)
-    catalog[0].catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT | DVO_LOAD_LENSING | DVO_LOAD_LENSOBJ | DVO_LOAD_STARPAR | DVO_LOAD_GALPHOT;
-
-    catalog[0].catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
-    catalog[0].catmode   = dvo_catalog_catmode (CATMODE);      // set the default catmode from config data
-
-    if (!dvo_catalog_open (catalog, region, VERBOSE, mode)) {
-	fprintf (stderr, "ERROR: failure to open catalog file %s\n", filename);
-	exit (2);
-    }
-    return (TRUE);
+  // always load all of the data (if any exists)
+  catalog[0].catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT | DVO_LOAD_LENSING | DVO_LOAD_LENSOBJ | DVO_LOAD_STARPAR | DVO_LOAD_GALPHOT;
+  
+  catalog[0].catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
+  catalog[0].catmode   = dvo_catalog_catmode (CATMODE);      // set the default catmode from config data
+  
+  if (!dvo_catalog_open (catalog, region, VERBOSE, mode)) {
+    fprintf (stderr, "ERROR: failure to open catalog file %s\n", filename);
+    exit (2);
+  }
+  return (TRUE);
 }
Index: trunk/Ohana/src/dvomerge/src/dvosecfilt_catalogs.c
===================================================================
--- trunk/Ohana/src/dvomerge/src/dvosecfilt_catalogs.c	(revision 38470)
+++ trunk/Ohana/src/dvomerge/src/dvosecfilt_catalogs.c	(revision 38471)
@@ -35,4 +35,6 @@
     char hostfile[1024];
     snprintf (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist->regions[i]->name);
+
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename  = HOST_ID ? hostfile : skylist->filename[i];
 
Index: trunk/Ohana/src/dvomerge/src/dvoverify_utils.c
===================================================================
--- trunk/Ohana/src/dvomerge/src/dvoverify_utils.c	(revision 38470)
+++ trunk/Ohana/src/dvomerge/src/dvoverify_utils.c	(revision 38471)
@@ -175,7 +175,6 @@
 
   // set the parameters which guide catalog open/load/create
+    dvo_catalog_init (&catalog, TRUE);
   catalog.filename  = filename;
-  catalog.catformat = DVO_FORMAT_UNDEF; // read-only,do not set the catformat
-  catalog.catmode   = DVO_MODE_UNDEF; // read-only, do not set the catmode
   catalog.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_LENSING | DVO_LOAD_LENSOBJ;
   catalog.Nsecfilt  = 0;
Index: trunk/Ohana/src/dvopsps/src/insert_FWobjects_dvopsps.c
===================================================================
--- trunk/Ohana/src/dvopsps/src/insert_FWobjects_dvopsps.c	(revision 38470)
+++ trunk/Ohana/src/dvopsps/src/insert_FWobjects_dvopsps.c	(revision 38471)
@@ -50,7 +50,6 @@
 
     // set up the basic catalog info
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename  = HOST_ID ? localFilename : skylist[0].filename[i];
-    catalog.catformat = DVO_FORMAT_UNDEF; // not needed since we skip empty catalogs
-    catalog.catmode   = DVO_MODE_UNDEF;	  // not needed since we skip empty catalogs
     catalog.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_SECFILT | DVO_LOAD_LENSOBJ;
     catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
Index: trunk/Ohana/src/dvopsps/src/insert_detections_dvopsps.c
===================================================================
--- trunk/Ohana/src/dvopsps/src/insert_detections_dvopsps.c	(revision 38470)
+++ trunk/Ohana/src/dvopsps/src/insert_detections_dvopsps.c	(revision 38471)
@@ -62,7 +62,6 @@
 
     // set up the basic catalog info
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename  = HOST_ID ? localFilename : skylist[0].filename[i];
-    catalog.catformat = DVO_FORMAT_UNDEF; // not needed since we skip empty catalogs
-    catalog.catmode   = DVO_MODE_UNDEF;	  // not needed since we skip empty catalogs
     catalog.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_SECFILT;
     catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
Index: trunk/Ohana/src/dvopsps/src/insert_diffobj_dvopsps.c
===================================================================
--- trunk/Ohana/src/dvopsps/src/insert_diffobj_dvopsps.c	(revision 38470)
+++ trunk/Ohana/src/dvopsps/src/insert_diffobj_dvopsps.c	(revision 38471)
@@ -50,7 +50,6 @@
 
     // set up the basic catalog info
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename  = HOST_ID ? localFilename : skylist[0].filename[i];
-    catalog.catformat = DVO_FORMAT_UNDEF; // not needed since we skip empty catalogs
-    catalog.catmode   = DVO_MODE_UNDEF;	  // not needed since we skip empty catalogs
     catalog.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_SECFILT;
     catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
Index: trunk/Ohana/src/dvopsps/src/insert_objects_dvopsps.c
===================================================================
--- trunk/Ohana/src/dvopsps/src/insert_objects_dvopsps.c	(revision 38470)
+++ trunk/Ohana/src/dvopsps/src/insert_objects_dvopsps.c	(revision 38471)
@@ -50,4 +50,5 @@
 
     // set up the basic catalog info
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename  = HOST_ID ? localFilename : skylist[0].filename[i];
     catalog.catformat = DVO_FORMAT_UNDEF; // not needed since we skip empty catalogs
Index: trunk/Ohana/src/dvosplit/src/dvosplit.c
===================================================================
--- trunk/Ohana/src/dvosplit/src/dvosplit.c	(revision 38470)
+++ trunk/Ohana/src/dvosplit/src/dvosplit.c	(revision 38471)
@@ -78,4 +78,5 @@
 
     // set the parameters which guide catalog open/load/create
+    dvo_catalog_init (&incatalog, TRUE);
     incatalog.filename = skylist[0].filename[i];
     incatalog.Nsecfilt = GetPhotcodeNsecfilt ();
Index: trunk/Ohana/src/dvosplit/src/open_output_catalogs.c
===================================================================
--- trunk/Ohana/src/dvosplit/src/open_output_catalogs.c	(revision 38470)
+++ trunk/Ohana/src/dvosplit/src/open_output_catalogs.c	(revision 38471)
@@ -12,4 +12,5 @@
     
     // set the parameters which guide catalog open/load/create
+    dvo_catalog_init (&outcatalogs[i], TRUE);
     outcatalogs[i].filename  = outlist[0].filename[i];
     outcatalogs[i].Nsecfilt  = GetPhotcodeNsecfilt ();
Index: trunk/Ohana/src/fakeastro/src/fakeastro_2mass.c
===================================================================
--- trunk/Ohana/src/fakeastro/src/fakeastro_2mass.c	(revision 38470)
+++ trunk/Ohana/src/fakeastro/src/fakeastro_2mass.c	(revision 38471)
@@ -18,4 +18,5 @@
 
     // set the parameters which guide catalog open/load/create
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename  = skylist[0].filename[i];
     catalog.catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
Index: trunk/Ohana/src/fakeastro/src/fakestar_catalog.c
===================================================================
--- trunk/Ohana/src/fakeastro/src/fakestar_catalog.c	(revision 38470)
+++ trunk/Ohana/src/fakeastro/src/fakestar_catalog.c	(revision 38471)
@@ -6,4 +6,5 @@
 
   // now we have all of the loaded stars in this catalog
+  dvo_catalog_init (&catalog, TRUE);
   catalog.filename = filename;
   catalog.catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
Index: trunk/Ohana/src/fakeastro/src/load_fake_stars.c
===================================================================
--- trunk/Ohana/src/fakeastro/src/load_fake_stars.c	(revision 38470)
+++ trunk/Ohana/src/fakeastro/src/load_fake_stars.c	(revision 38471)
@@ -12,4 +12,5 @@
 
     // set the parameters which guide catalog open/load/create
+    dvo_catalog_init (&catalog[i], TRUE);
     catalog[i].filename  = skylist[0].filename[i];
     catalog[i].catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
Index: trunk/Ohana/src/fakeastro/src/save_fake_stars.c
===================================================================
--- trunk/Ohana/src/fakeastro/src/save_fake_stars.c	(revision 38470)
+++ trunk/Ohana/src/fakeastro/src/save_fake_stars.c	(revision 38471)
@@ -20,4 +20,5 @@
 
     // set the parameters which guide catalog open/load/create
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename  = skylist[0].filename[i];
     catalog.catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
Index: trunk/Ohana/src/gastro/src/getptolemy.c
===================================================================
--- trunk/Ohana/src/gastro/src/getptolemy.c	(revision 38470)
+++ trunk/Ohana/src/gastro/src/getptolemy.c	(revision 38471)
@@ -25,4 +25,6 @@
   for (i = 0; i <skylist[0].Nregions; i++) {
     // set the parameters which guide catalog open/load/create
+
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename  = skylist[0].filename[i];
     catalog.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE;
Index: trunk/Ohana/src/gastro2/src/getptolemy.c
===================================================================
--- trunk/Ohana/src/gastro2/src/getptolemy.c	(revision 38470)
+++ trunk/Ohana/src/gastro2/src/getptolemy.c	(revision 38471)
@@ -27,4 +27,5 @@
   for (i = 0; i < skylist[0].Nregions; i++) {
     // set the parameters which guide catalog open/load/create
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename  = skylist[0].filename[i];
     catalog.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE;
Index: trunk/Ohana/src/getstar/src/getstar.c
===================================================================
--- trunk/Ohana/src/getstar/src/getstar.c	(revision 38470)
+++ trunk/Ohana/src/getstar/src/getstar.c	(revision 38471)
@@ -24,4 +24,6 @@
 
   // create an output catalog with the desired name and format options
+  dvo_catalog_init (&output, TRUE);
+
   dvo_catalog_init (&output, TRUE);
   output.filename  = OUTPUT;
@@ -61,4 +63,5 @@
       for (i = 0; i < skylist[0].Nregions; i++) {
 	// set the parameters which guide catalog open/load/create
+	dvo_catalog_init (&catalog, TRUE);
 	catalog.filename = skylist[0].filename[i];
 	catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
@@ -93,4 +96,5 @@
       for (i = 0; i < skylist[0].Nregions; i++) {
 	// set the parameters which guide catalog open/load/create
+	dvo_catalog_init (&catalog, TRUE);
 	catalog.filename = skylist[0].filename[i];
 	catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
Index: trunk/Ohana/src/libdvo/src/dvo_util.c
===================================================================
--- trunk/Ohana/src/libdvo/src/dvo_util.c	(revision 38470)
+++ trunk/Ohana/src/libdvo/src/dvo_util.c	(revision 38471)
@@ -206,4 +206,6 @@
       /* lock, load, unlock catalog */
       Catalog catalog;
+
+      dvo_catalog_init (&catalog, TRUE);
       catalog.filename = skylist->filename[reg];
       catalog.catflags = GetMeasures ? DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_SECFILT : DVO_LOAD_AVERAGE | DVO_LOAD_SECFILT;
Index: trunk/Ohana/src/libfits/table/F_compress_T.c
===================================================================
--- trunk/Ohana/src/libfits/table/F_compress_T.c	(revision 38470)
+++ trunk/Ohana/src/libfits/table/F_compress_T.c	(revision 38471)
@@ -34,4 +34,6 @@
 
 void gfits_compress_timing () {
+  return;
+
   fprintf (stderr, "cmp times: %f %f %f\n", timeSum1, timeSum2, timeSum3);
   fprintf (stderr, "cmp times: %f %f %f %f %f\n", timeSum2a, timeSum2b, timeSum2c, timeSum2d, timeSum2e);
Index: trunk/Ohana/src/libfits/table/F_uncompress_T.c
===================================================================
--- trunk/Ohana/src/libfits/table/F_uncompress_T.c	(revision 38470)
+++ trunk/Ohana/src/libfits/table/F_uncompress_T.c	(revision 38471)
@@ -58,4 +58,6 @@
 
 void gfits_uncompress_timing () {
+  return;
+
   fprintf (stderr, "unc times: %f %f %f\n", timeSum1, timeSum2, timeSum3);
   fprintf (stderr, "unc times: %f %f %f %f %f %f\n", timeSum2a, timeSum2b, timeSum2c, timeSum2d, timeSum2e, timeSum2f);
Index: trunk/Ohana/src/markrock/src/markrock.c
===================================================================
--- trunk/Ohana/src/markrock/src/markrock.c	(revision 38470)
+++ trunk/Ohana/src/markrock/src/markrock.c	(revision 38471)
@@ -36,4 +36,5 @@
   if (!check_file_access (RockCat, TRUE, TRUE, TRUE)) exit (1);
 
+  dvo_catalog_init (&catalog, TRUE);
   catalog.filename = argv[1];
   catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
Index: trunk/Ohana/src/markstar/src/markstar.c
===================================================================
--- trunk/Ohana/src/markstar/src/markstar.c	(revision 38470)
+++ trunk/Ohana/src/markstar/src/markstar.c	(revision 38471)
@@ -40,4 +40,5 @@
   dvo_image_lock (&db, ImageCat, 3600.0, LCK_XCLD);
 
+  dvo_catalog_init (&catalog, TRUE);
   catalog.filename = argv[1];
   catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
Index: trunk/Ohana/src/mosastro/src/getptolemy.c
===================================================================
--- trunk/Ohana/src/mosastro/src/getptolemy.c	(revision 38470)
+++ trunk/Ohana/src/mosastro/src/getptolemy.c	(revision 38471)
@@ -25,4 +25,5 @@
   for (i = 0; i <skylist[0].Nregions; i++) {
     // set the parameters which guide catalog open/load/create
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename  = skylist[0].filename[i];
     catalog.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE;
Index: trunk/Ohana/src/opihi/dvo/avextract.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/avextract.c	(revision 38470)
+++ trunk/Ohana/src/opihi/dvo/avextract.c	(revision 38471)
@@ -184,4 +184,6 @@
     }
     snprintf (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name);
+
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename = (HOST_ID || PARALLEL_LOCAL) ? hostfile : skylist[0].filename[i];
     catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_SECFILT;
Index: trunk/Ohana/src/opihi/dvo/avmatch.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/avmatch.c	(revision 38470)
+++ trunk/Ohana/src/opihi/dvo/avmatch.c	(revision 38471)
@@ -189,7 +189,9 @@
     char hostfile[1024];
     snprintf (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name);
+
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename = HOST_ID ? hostfile : skylist[0].filename[i];
     catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_SECFILT;
-    catalog.catflags |= needMeasure ? DVO_LOAD_MEASURE    : DVO_SKIP_MEASURE;
+    catalog.catflags |= needMeasure ? DVO_LOAD_MEASURE : DVO_SKIP_MEASURE;
     catalog.catflags |= needLensobj ? DVO_LOAD_LENSOBJ : DVO_SKIP_LENSOBJ;
     catalog.catflags |= needStarpar ? DVO_LOAD_STARPAR : DVO_SKIP_STARPAR;
Index: trunk/Ohana/src/opihi/dvo/calextract.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/calextract.c	(revision 38470)
+++ trunk/Ohana/src/opihi/dvo/calextract.c	(revision 38471)
@@ -60,4 +60,5 @@
 
     /* lock, load, unlock catalog */
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename = skylist[0].filename[Nr];
     catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_SECFILT;
Index: trunk/Ohana/src/opihi/dvo/calmextract.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/calmextract.c	(revision 38470)
+++ trunk/Ohana/src/opihi/dvo/calmextract.c	(revision 38471)
@@ -73,4 +73,5 @@
 
     /* lock, load, unlock catalog */
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename = skylist[0].filename[Nr];
     catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_SECFILT;
Index: trunk/Ohana/src/opihi/dvo/catalog.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/catalog.c	(revision 38470)
+++ trunk/Ohana/src/opihi/dvo/catalog.c	(revision 38471)
@@ -314,4 +314,5 @@
       
       /* lock, load, unlock catalog */
+      dvo_catalog_init (&catalog, TRUE);
       catalog.filename = filename;
       catalog.catflags = DVO_LOAD_AVERAGE;
Index: trunk/Ohana/src/opihi/dvo/ccd.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/ccd.c	(revision 38470)
+++ trunk/Ohana/src/opihi/dvo/ccd.c	(revision 38471)
@@ -68,4 +68,5 @@
   for (k = 0; (k < skylist[0].Nregions) && !interrupt; k++) {
     /* lock, load, unlock catalog */
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename = skylist[0].filename[k];
     catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_SECFILT;
Index: trunk/Ohana/src/opihi/dvo/cmatch.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/cmatch.c	(revision 38470)
+++ trunk/Ohana/src/opihi/dvo/cmatch.c	(revision 38471)
@@ -28,4 +28,5 @@
 
   /* load data from the photometry database file */
+  dvo_catalog_init (&catalog1, TRUE);
   catalog1.filename = filename;
   catalog1.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_SECFILT;
Index: trunk/Ohana/src/opihi/dvo/cmd.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/cmd.c	(revision 38470)
+++ trunk/Ohana/src/opihi/dvo/cmd.c	(revision 38471)
@@ -67,4 +67,5 @@
   for (j = 0; (j < skylist[0].Nregions) && !interrupt; j++) {
     /* lock, load, unlock catalog */
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename = skylist[0].filename[j];
     catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_SECFILT;
Index: trunk/Ohana/src/opihi/dvo/ddmags.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/ddmags.c	(revision 38470)
+++ trunk/Ohana/src/opihi/dvo/ddmags.c	(revision 38471)
@@ -65,4 +65,5 @@
   for (k = 0; k < skylist[0].Nregions; k++) {
     /* lock, load, unlock catalog */
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename = skylist[0].filename[k];
     catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_SECFILT;
Index: trunk/Ohana/src/opihi/dvo/dmagmeas.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/dmagmeas.c	(revision 38470)
+++ trunk/Ohana/src/opihi/dvo/dmagmeas.c	(revision 38471)
@@ -65,4 +65,5 @@
   for (j = 0; j < skylist[0].Nregions; j++) {
     /* lock, load, unlock catalog */
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename = skylist[0].filename[j];
     catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_SECFILT;
Index: trunk/Ohana/src/opihi/dvo/dmt.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/dmt.c	(revision 38470)
+++ trunk/Ohana/src/opihi/dvo/dmt.c	(revision 38471)
@@ -76,4 +76,5 @@
   for (k = 0; k < skylist[0].Nregions; k++) {
     /* lock, load, unlock catalog */
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename = skylist[0].filename[k];
     catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_SECFILT;
Index: trunk/Ohana/src/opihi/dvo/fitcolors.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/fitcolors.c	(revision 38470)
+++ trunk/Ohana/src/opihi/dvo/fitcolors.c	(revision 38471)
@@ -161,4 +161,5 @@
   for (k = 0; k < skylist[0].Nregions; k++) {
     /* lock, load, unlock catalog */
+    dvo_catalog_init (&catalog[k], TRUE);
     catalog[k].filename = skylist[0].filename[k];
     catalog[k].catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_SECFILT;
Index: trunk/Ohana/src/opihi/dvo/fitsed.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/fitsed.c	(revision 38470)
+++ trunk/Ohana/src/opihi/dvo/fitsed.c	(revision 38471)
@@ -187,4 +187,5 @@
   for (k = 0; k < skylist[0].Nregions; k++) {
     /* lock, load, unlock catalog */
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename = skylist[0].filename[k];
     catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_SECFILT;
Index: trunk/Ohana/src/opihi/dvo/gstar.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/gstar.c	(revision 38470)
+++ trunk/Ohana/src/opihi/dvo/gstar.c	(revision 38471)
@@ -233,4 +233,6 @@
   }
 
+  dvo_catalog_init (&catalog, TRUE);
+
   HostTable *table = NULL;  
   if (PARALLEL) {
Index: trunk/Ohana/src/opihi/dvo/imdata.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/imdata.c	(revision 38470)
+++ trunk/Ohana/src/opihi/dvo/imdata.c	(revision 38471)
@@ -135,4 +135,5 @@
 
     /* get file name and open */
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename = skylist[0].filename[j];
     catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_SECFILT;
Index: trunk/Ohana/src/opihi/dvo/lcurve.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/lcurve.c	(revision 38470)
+++ trunk/Ohana/src/opihi/dvo/lcurve.c	(revision 38471)
@@ -75,4 +75,5 @@
 
   /* set filename, read in header */
+  dvo_catalog_init (&catalog, TRUE);
   catalog.filename = skylist[0].filename[0];
   catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE;
Index: trunk/Ohana/src/opihi/dvo/lightcurve.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/lightcurve.c	(revision 38470)
+++ trunk/Ohana/src/opihi/dvo/lightcurve.c	(revision 38471)
@@ -58,4 +58,5 @@
 
   /* set filename, read in header */
+  dvo_catalog_init (&catalog, TRUE);
   catalog.filename = skylist[0].filename[0];
   catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_SECFILT;
Index: trunk/Ohana/src/opihi/dvo/mextract.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/mextract.c	(revision 38470)
+++ trunk/Ohana/src/opihi/dvo/mextract.c	(revision 38471)
@@ -230,4 +230,6 @@
     char hostfile[1024];
     snprintf (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name);
+
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename = HOST_ID ? hostfile : skylist[0].filename[i];
     catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_SECFILT;
Index: trunk/Ohana/src/opihi/dvo/mmatch.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/mmatch.c	(revision 38470)
+++ trunk/Ohana/src/opihi/dvo/mmatch.c	(revision 38471)
@@ -247,4 +247,5 @@
     char hostfile[1024];
     snprintf (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name);
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename = HOST_ID ? hostfile : skylist[0].filename[i];
     catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_SECFILT | DVO_LOAD_MEASURE;
Index: trunk/Ohana/src/opihi/dvo/mmextract.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/mmextract.c	(revision 38470)
+++ trunk/Ohana/src/opihi/dvo/mmextract.c	(revision 38471)
@@ -182,4 +182,5 @@
   for (i = 0; (i < skylist[0].Nregions) && !interrupt; i++) {
     /* lock, load, unlock catalog */
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename = skylist[0].filename[i];
     catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_SECFILT;
Index: trunk/Ohana/src/opihi/dvo/objectcoverage.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/objectcoverage.c	(revision 38470)
+++ trunk/Ohana/src/opihi/dvo/objectcoverage.c	(revision 38471)
@@ -183,4 +183,5 @@
   for (k = 0; (k < skylist[0].Nregions) && !interrupt; k++) {
     /* lock, load, unlock catalog */
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename = skylist[0].filename[k];
     catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_SECFILT;
Index: trunk/Ohana/src/opihi/dvo/paverage.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/paverage.c	(revision 38470)
+++ trunk/Ohana/src/opihi/dvo/paverage.c	(revision 38471)
@@ -104,4 +104,5 @@
   Nloaded = 0;
   for (j = 0; (j < skylist[0].Nregions) && !interrupt; j++) {
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename = skylist[0].filename[j];
     catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_SECFILT;
Index: trunk/Ohana/src/opihi/dvo/pmeasure.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/pmeasure.c	(revision 38470)
+++ trunk/Ohana/src/opihi/dvo/pmeasure.c	(revision 38471)
@@ -177,4 +177,5 @@
   Nloaded = 0;
   for (j = 0; (j < skylist[0].Nregions) && !interrupt; j++) {
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename = skylist[0].filename[j];
     catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE;
Index: trunk/Ohana/src/opihi/dvo/subpix.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/subpix.c	(revision 38470)
+++ trunk/Ohana/src/opihi/dvo/subpix.c	(revision 38471)
@@ -39,4 +39,5 @@
 
   /* lock, load, unlock catalog */
+  dvo_catalog_init (&catalog, TRUE);
   catalog.filename = skylist[0].filename[0];
   catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE;
Index: trunk/Ohana/src/photdbc/src/photdbc_catalogs.c
===================================================================
--- trunk/Ohana/src/photdbc/src/photdbc_catalogs.c	(revision 38470)
+++ trunk/Ohana/src/photdbc/src/photdbc_catalogs.c	(revision 38471)
@@ -22,4 +22,6 @@
     char hostfile[DVO_MAX_PATH];
     snprintf (hostfile, DVO_MAX_PATH, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name);
+
+    dvo_catalog_init (&incatalog, TRUE);
     incatalog.filename  = hostID ? hostfile : skylist[0].filename[i];
     incatalog.Nsecfilt = GetPhotcodeNsecfilt ();
Index: trunk/Ohana/src/relastro/src/UpdateObjectOffsets.c
===================================================================
--- trunk/Ohana/src/relastro/src/UpdateObjectOffsets.c	(revision 38470)
+++ trunk/Ohana/src/relastro/src/UpdateObjectOffsets.c	(revision 38471)
@@ -29,4 +29,6 @@
     char hostfile[1024];
     snprintf (hostfile, 1024, "%s/%s.cpt", hostpath, skylist[0].regions[i]->name);
+
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename = hostID ? hostfile : skylist[0].filename[i];
 
Index: trunk/Ohana/src/relastro/src/high_speed_catalogs.c
===================================================================
--- trunk/Ohana/src/relastro/src/high_speed_catalogs.c	(revision 38470)
+++ trunk/Ohana/src/relastro/src/high_speed_catalogs.c	(revision 38471)
@@ -28,4 +28,6 @@
     char hostfile[1024];
     snprintf (hostfile, 1024, "%s/%s.cpt", hostpath, skylist[0].regions[i]->name);
+
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename  = hostID ? hostfile : skylist[0].filename[i];
     catalog.catformat = dvo_catalog_catformat (CATFORMAT);    // set the default catformat from config data
Index: trunk/Ohana/src/relastro/src/hpm_catalogs.c
===================================================================
--- trunk/Ohana/src/relastro/src/hpm_catalogs.c	(revision 38470)
+++ trunk/Ohana/src/relastro/src/hpm_catalogs.c	(revision 38471)
@@ -26,4 +26,6 @@
     char hostfile[1024];
     snprintf (hostfile, 1024, "%s/%s.cpt", hostpath, skylist[0].regions[i]->name);
+
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename  = hostID ? hostfile : skylist[0].filename[i];
     catalog.catformat = dvo_catalog_catformat (CATFORMAT);    // set the default catformat from config data
Index: trunk/Ohana/src/relastro/src/load_catalogs.c
===================================================================
--- trunk/Ohana/src/relastro/src/load_catalogs.c	(revision 38470)
+++ trunk/Ohana/src/relastro/src/load_catalogs.c	(revision 38471)
@@ -35,4 +35,6 @@
     char hostfile[1024];
     snprintf (hostfile, 1024, "%s/%s.cpt", hostpath, skylist[0].regions[i]->name);
+
+    dvo_catalog_init (pcatalog, TRUE);
     pcatalog->filename = hostID ? hostfile : skylist[0].filename[i];
 
Index: trunk/Ohana/src/relastro/src/relastro_objects.c
===================================================================
--- trunk/Ohana/src/relastro/src/relastro_objects.c	(revision 38470)
+++ trunk/Ohana/src/relastro/src/relastro_objects.c	(revision 38471)
@@ -39,4 +39,6 @@
     char hostfile[1024];
     snprintf (hostfile, 1024, "%s/%s.cpt", hostpath, skylist[0].regions[i]->name);
+
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename  = hostID ? hostfile : skylist[0].filename[i];
 
Index: trunk/Ohana/src/relphot/src/load_catalogs.c
===================================================================
--- trunk/Ohana/src/relphot/src/load_catalogs.c	(revision 38470)
+++ trunk/Ohana/src/relphot/src/load_catalogs.c	(revision 38471)
@@ -42,11 +42,8 @@
     char hostfile[1024];
     snprintf (hostfile, 1024, "%s/%s.cpt", hostpath, skylist[0].regions[i]->name);
+    dvo_catalog_init (&tcatalog, TRUE);
     tcatalog.filename    = hostID ? hostfile : skylist[0].filename[i];
     tcatalog.catflags    = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_SECFILT;    // don't need to load all data at this point
     tcatalog.Nsecfilt    = GetPhotcodeNsecfilt ();               // set the desired number in case we need to create the catalog
-
-    // tcatalog.catformat   = dvo_catalog_catformat (CATFORMAT);    // set the default catformat from config data
-    // tcatalog.catmode     = dvo_catalog_catmode (CATMODE);        // set the default catmode from config data
-    // tcatalog.catcompress = dvo_catalog_catcompress (CATCOMPRESS); // set the default catcompress from config data
 
     if (!dvo_catalog_open (&tcatalog, skylist[0].regions[i], VERBOSE2, "r")) {
Index: trunk/Ohana/src/relphot/src/reload_catalogs.c
===================================================================
--- trunk/Ohana/src/relphot/src/reload_catalogs.c	(revision 38470)
+++ trunk/Ohana/src/relphot/src/reload_catalogs.c	(revision 38471)
@@ -49,4 +49,6 @@
     char hostfile[1024];
     snprintf (hostfile, 1024, "%s/%s.cpt", hostpath, skylist[0].regions[i]->name);
+
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename = hostID ? hostfile : skylist[0].filename[i];
 
@@ -59,7 +61,4 @@
     TIMESTAMP(time1);
 
-    // catalog.catformat   = dvo_catalog_catformat (CATFORMAT);    // set the default catformat from config data
-    // catalog.catmode     = dvo_catalog_catmode (CATMODE);        // set the default catmode from config data
-    // catalog.catcompress = dvo_catalog_catcompress (CATCOMPRESS); // set the default catcompress from config data
     catalog.catflags    = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
     catalog.Nsecfilt    = GetPhotcodeNsecfilt ();               // set the desired number in case we need to create the catalog
Index: trunk/Ohana/src/relphot/src/relphot_objects.c
===================================================================
--- trunk/Ohana/src/relphot/src/relphot_objects.c	(revision 38470)
+++ trunk/Ohana/src/relphot/src/relphot_objects.c	(revision 38471)
@@ -42,8 +42,7 @@
     char hostfile[1024];
     snprintf (hostfile, 1024, "%s/%s.cpt", hostpath, skylist[0].regions[i]->name);
+
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename    = hostID ? hostfile : skylist[0].filename[i];
-    // catalog.catformat   = dvo_catalog_catformat (CATFORMAT);    // set the default catformat from config data
-    // catalog.catmode     = dvo_catalog_catmode (CATMODE);        // set the default catmode from config data
-    // catalog.catcompress = dvo_catalog_catcompress (CATCOMPRESS); // set the default catcompress from config data
     catalog.catflags    = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
     catalog.Nsecfilt    = GetPhotcodeNsecfilt ();
Index: trunk/Ohana/src/relphot/src/relphot_synthphot.c
===================================================================
--- trunk/Ohana/src/relphot/src/relphot_synthphot.c	(revision 38470)
+++ trunk/Ohana/src/relphot/src/relphot_synthphot.c	(revision 38471)
@@ -41,8 +41,7 @@
     char hostfile[1024];
     snprintf (hostfile, 1024, "%s/%s.cpt", hostpath, skylist[0].regions[i]->name);
+
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename    = hostID ? hostfile : skylist[0].filename[i];
-    // catalog.catformat   = dvo_catalog_catformat (CATFORMAT);    // set the default catformat from config data
-    // catalog.catmode     = dvo_catalog_catmode (CATMODE);        // set the default catmode from config data
-    // catalog.catcompress = dvo_catalog_catcompress (CATCOMPRESS); // set the default catcompress from config data
     catalog.catflags    = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_SECFILT;
     catalog.Nsecfilt    = GetPhotcodeNsecfilt ();
Index: trunk/Ohana/src/relphot/src/setMrelCatalog.c
===================================================================
--- trunk/Ohana/src/relphot/src/setMrelCatalog.c	(revision 38470)
+++ trunk/Ohana/src/relphot/src/setMrelCatalog.c	(revision 38471)
@@ -128,5 +128,6 @@
 
     // these bits should not be set unless we use them in this pass
-    measure[k].dbFlags &= ~(ID_MEAS_PHOTOM_PSF | ID_MEAS_PHOTOM_APER | ID_MEAS_PHOTOM_KRON);
+    // (note that we can only un-set them in the final pass when we actually have measure, not just measureT
+    if (measure) measure[k].dbFlags &= ~(ID_MEAS_PHOTOM_PSF | ID_MEAS_PHOTOM_APER | ID_MEAS_PHOTOM_KRON);
 
     // skip measurements that do not have a valid photcode (raise exception?)
Index: trunk/Ohana/src/uniphot/src/update_dvo_ckids.c
===================================================================
--- trunk/Ohana/src/uniphot/src/update_dvo_ckids.c	(revision 38470)
+++ trunk/Ohana/src/uniphot/src/update_dvo_ckids.c	(revision 38471)
@@ -43,7 +43,6 @@
 
     // set up the basic catalog info
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename  = HOST_ID ? localFilename : skylist[0].filename[i];
-    catalog.catformat = DVO_FORMAT_UNDEF; // not needed since we skip empty catalogs
-    catalog.catmode   = DVO_MODE_UNDEF;	  // not needed since we skip empty catalogs
     catalog.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
     catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
Index: trunk/Ohana/src/uniphot/src/update_dvo_fiximids.c
===================================================================
--- trunk/Ohana/src/uniphot/src/update_dvo_fiximids.c	(revision 38470)
+++ trunk/Ohana/src/uniphot/src/update_dvo_fiximids.c	(revision 38471)
@@ -38,7 +38,6 @@
 
     // set up the basic catalog info
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename  = HOST_ID ? localFilename : skylist[0].filename[i];
-    catalog.catformat = DVO_FORMAT_UNDEF; // not needed since we skip empty catalogs
-    catalog.catmode   = DVO_MODE_UNDEF;	  // not needed since we skip empty catalogs
     catalog.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
     catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
Index: trunk/Ohana/src/uniphot/src/update_dvo_fixstkids.c
===================================================================
--- trunk/Ohana/src/uniphot/src/update_dvo_fixstkids.c	(revision 38470)
+++ trunk/Ohana/src/uniphot/src/update_dvo_fixstkids.c	(revision 38471)
@@ -38,7 +38,6 @@
 
     // set up the basic catalog info
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename  = HOST_ID ? localFilename : skylist[0].filename[i];
-    catalog.catformat = DVO_FORMAT_UNDEF; // not needed since we skip empty catalogs
-    catalog.catmode   = DVO_MODE_UNDEF;	  // not needed since we skip empty catalogs
     catalog.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
     catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
Index: trunk/Ohana/src/uniphot/src/update_dvo_setastrom.c
===================================================================
--- trunk/Ohana/src/uniphot/src/update_dvo_setastrom.c	(revision 38470)
+++ trunk/Ohana/src/uniphot/src/update_dvo_setastrom.c	(revision 38471)
@@ -40,7 +40,6 @@
 
     // set up the basic catalog info
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename  = HOST_ID ? localFilename : skylist[0].filename[i];
-    catalog.catformat = DVO_FORMAT_UNDEF; // not needed since we skip empty catalogs
-    catalog.catmode   = DVO_MODE_UNDEF;	  // not needed since we skip empty catalogs
     catalog.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
     catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
Index: trunk/Ohana/src/uniphot/src/update_dvo_setgalmodel.c
===================================================================
--- trunk/Ohana/src/uniphot/src/update_dvo_setgalmodel.c	(revision 38470)
+++ trunk/Ohana/src/uniphot/src/update_dvo_setgalmodel.c	(revision 38471)
@@ -35,7 +35,6 @@
 
     // set up the basic catalog info
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename  = HOST_ID ? localFilename : skylist[0].filename[i];
-    catalog.catformat = DVO_FORMAT_UNDEF; // not needed since we skip empty catalogs
-    catalog.catmode   = DVO_MODE_UNDEF;	  // not needed since we skip empty catalogs
     catalog.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT | DVO_LOAD_STARPAR;
     catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
Index: trunk/Ohana/src/uniphot/src/update_dvo_setphot.c
===================================================================
--- trunk/Ohana/src/uniphot/src/update_dvo_setphot.c	(revision 38470)
+++ trunk/Ohana/src/uniphot/src/update_dvo_setphot.c	(revision 38471)
@@ -51,9 +51,8 @@
 
     // set up the basic catalog info
-    catalog.filename  = HOST_ID ? localFilename : skylist[0].filename[i];
-    catalog.catformat = DVO_FORMAT_UNDEF; // not needed since we skip empty catalogs
-    catalog.catmode   = DVO_MODE_UNDEF;	  // not needed since we skip empty catalogs
-    catalog.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
-    catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
+    dvo_catalog_init (&catalog, TRUE);
+    catalog.filename    = HOST_ID ? localFilename : skylist[0].filename[i];
+    catalog.catflags    = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
+    catalog.Nsecfilt    = GetPhotcodeNsecfilt ();
 
     if (!dvo_catalog_open (&catalog, skylist[0].regions[i], VERBOSE, "w")) {
Index: trunk/Ohana/src/uniphot/src/update_dvo_setposangle.c
===================================================================
--- trunk/Ohana/src/uniphot/src/update_dvo_setposangle.c	(revision 38470)
+++ trunk/Ohana/src/uniphot/src/update_dvo_setposangle.c	(revision 38471)
@@ -52,7 +52,6 @@
 
     // set up the basic catalog info
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename  = HOST_ID ? localFilename : skylist[0].filename[i];
-    catalog.catformat = DVO_FORMAT_UNDEF; // not needed since we skip empty catalogs
-    catalog.catmode   = DVO_MODE_UNDEF;	  // not needed since we skip empty catalogs
     catalog.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
     catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
Index: trunk/Ohana/src/uniphot/src/update_dvo_uniphot.c
===================================================================
--- trunk/Ohana/src/uniphot/src/update_dvo_uniphot.c	(revision 38470)
+++ trunk/Ohana/src/uniphot/src/update_dvo_uniphot.c	(revision 38471)
@@ -60,4 +60,5 @@
   
   for (i = 0; i < pglob.gl_pathc; i++) {
+    dvo_catalog_init (&catalog, TRUE);
     catalog.filename = pglob.gl_pathv[i];
     catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
