Index: trunk/Ohana/src/opihi/dvo/dmags.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/dmags.c	(revision 7917)
+++ trunk/Ohana/src/opihi/dvo/dmags.c	(revision 8427)
@@ -58,16 +58,12 @@
     /* lock, load, unlock catalog */
     catalog.filename = skylist[0].filename[j];
-    switch (lock_catalog (&catalog, LCK_SOFT)) {
-      case 2:
-	unlock_catalog (&catalog);
-      case 0:
-	continue;
+    catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF;
+
+    // an error exit status here is a significant error
+    if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) {
+      fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename);
+      exit (2);
     }
-    catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF;
-    if (!load_catalog (&catalog, FALSE)) {
-      unlock_catalog (&catalog);
-      continue;
-    }
-    unlock_catalog (&catalog);
+    dvo_catalog_unlock (&catalog);
 
     /* get correct mags, convert to X,Y */
@@ -108,10 +104,5 @@
       if (M3 != NULL) free (M3);
     }
-    if (catalog.average != NULL) free (catalog.average);
-    if (catalog.secfilt != NULL) free (catalog.secfilt);
-    if (catalog.measure != NULL) free (catalog.measure);
-    catalog.average = (Average *) NULL; 
-    catalog.secfilt = (SecFilt *) NULL;
-    catalog.measure = (Measure *) NULL;
+    dvo_catalog_free (&catalog);
   }
 
@@ -131,7 +122,5 @@
 escape:
   SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL)));
-  if (catalog.average != NULL) free (catalog.average);
-  if (catalog.secfilt != NULL) free (catalog.secfilt);
-  if (catalog.measure != NULL) free (catalog.measure);
+  dvo_catalog_free (&catalog);
   if (RegionName != NULL) free (RegionName);
   if (RegionList != NULL) free (RegionList);
