Index: /trunk/Ohana/src/relastro/src/ConfigInit.c
===================================================================
--- /trunk/Ohana/src/relastro/src/ConfigInit.c	(revision 17206)
+++ /trunk/Ohana/src/relastro/src/ConfigInit.c	(revision 17207)
@@ -6,4 +6,6 @@
   char CatdirPhotcodeFile[256];
   char MasterPhotcodeFile[256];
+  struct stat filestat;
+  int status;
 
   /*** load configuration info ***/
@@ -29,6 +31,4 @@
   GetConfig (config, "PM_TOOFEW",              "%d",  0, &PM_TOOFEW);
   GetConfig (config, "POS_TOOFEW",             "%d",  0, &POS_TOOFEW);
-  GetConfig (config, "IMAGE_TOOFEW",           "%d",  0, &IMAGE_TOOFEW);
-  GetConfig (config, "IMAGE_GOOD_FRACTION",    "%lf", 0, &IMAGE_GOOD_FRACTION);
 
   GetConfig (config, "GSCFILE",                "%s",  0, GSCFILE);
@@ -47,14 +47,15 @@
   }
 
-  // GetConfig (config, "ZERO_PT",                "%lf", 0, &ZERO_POINT);
-  // GetConfig (config, "RELPHOT_GRID_X",         "%d",  0, &RELPHOT_GRID_X);
-  // GetConfig (config, "RELPHOT_GRID_Y",         "%d",  0, &RELPHOT_GRID_Y);
-  // GetConfig (config, "RELPHOT_GRID_BINNING",   "%d",  0, &RELPHOT_GRID_BINNING);
-  // GetConfig (config, "CAMERA_CONFIG",          "%s",  0, CameraConfig);
-
   if (*CATMODE == 0) strcpy (CATMODE, "RAW");
   if (*CATFORMAT == 0) strcpy (CATFORMAT, "ELIXIR");
 
-  /* XXX this does not yet write out the master photcode table */
+  // check for existence of CATDIR
+  status = stat (CATDIR, &filestat);
+  if (status == -1) {
+    fprintf (stderr, "directory %s does not exist, giving up\n", CATDIR);
+    exit (1);
+  } 
+
+  /* update master photcode table if not defined */
   sprintf (CatdirPhotcodeFile, "%s/Photcodes.dat", CATDIR);
   if (!LoadPhotcodes (CatdirPhotcodeFile, MasterPhotcodeFile)) {
