Index: trunk/Ohana/src/opihi/dvo/ddmags.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/ddmags.c	(revision 3462)
+++ trunk/Ohana/src/opihi/dvo/ddmags.c	(revision 3689)
@@ -22,4 +22,7 @@
   catalog.measure = NULL;
 
+  /* find CATDIR in config system */
+  VarConfig ("CATDIR", "%s", catdir);
+
   /* load photcode information */
   if (!InitPhotcodes ()) goto escape;
@@ -30,6 +33,7 @@
   if (!GetGraphData (&graphsky, NULL, &Ngraph)) return (FALSE);
  
-  /* find CATDIR in config system */
-  VarConfig ("CATDIR", "%s", catdir);
+  /* find catalog files which overlap this region */
+  Radius = MAX (fabs(graphsky.xmax), fabs(graphsky.ymax));
+  regions = find_regions (graphsky.coords.crval1, graphsky.coords.crval2, Radius, &Nregions);
 
   /* interpret command-line options */
@@ -46,8 +50,4 @@
   if (!GetPhotcodeInfo (argv[7], &code[3], &mode[3])) return (FALSE);
   if ((mode[2] == MAG_AVE) || (mode[2] == MAG_REF)) UseAverages = TRUE;
-
-  /* find catalog files which overlap this region */
-  Radius = MAX (fabs(graphsky.xmax), fabs(graphsky.ymax));
-  regions = find_regions (graphsky.coords.crval1, graphsky.coords.crval2, Radius, &Nregions);
 
   /* init vectors to save data */
@@ -114,5 +114,4 @@
 usage:
   fprintf (stderr, "USAGE: ddmags F - F : measure.param\n");
-  return (FALSE);
 
 escape:
