Index: /trunk/Ohana/src/addstar/src/ConfigInit.c
===================================================================
--- /trunk/Ohana/src/addstar/src/ConfigInit.c	(revision 6683)
+++ /trunk/Ohana/src/addstar/src/ConfigInit.c	(revision 6684)
@@ -60,5 +60,4 @@
   ScanConfig (config, "TYCHO_DIR",             "%s",  0, TYCHO_DIR);
 
-  ScanConfig (config, "IMAGE_CATALOG",          "%s",  0, ImageCat);
   ScanConfig (config, "GSCFILE",                "%s",  0, GSCFILE);
   ScanConfig (config, "CATDIR",                 "%s",  0, CATDIR);
@@ -72,4 +71,8 @@
     SKY_TABLE[0] = 0;
   }
+  sprintf (ImageCat, "%s/Images.dat", CATDIR);
+
+  /* dropped: ScanConfig (config, "IMAGE_CATALOG",          "%s",  0, ImageCat); */
+
 
   /* used by client/server setup */
Index: /trunk/Ohana/src/addstar/src/addstar.c
===================================================================
--- /trunk/Ohana/src/addstar/src/addstar.c	(revision 6683)
+++ /trunk/Ohana/src/addstar/src/addstar.c	(revision 6684)
@@ -15,5 +15,5 @@
 
   double dtime;
-  struct timeval start, stop, t1, t2;
+  struct timeval start, stop;
 
   gettimeofday (&start, NULL);
@@ -38,6 +38,4 @@
   status = dvo_image_lock (&db, ImageCat, 3600.0, LCK_XCLD);
   if (!status) Shutdown ("ERROR: failure to lock image catalog %s", db.filename);
-  gettimeofday (&stop, NULL);
-  dtime = DTIME (stop, start);
 
   switch (options.mode) {
@@ -65,12 +63,6 @@
   if (VERBOSE) fprintf (stderr, "writing to %d regions\n", skylist[0].Nregions);
 
-  gettimeofday (&stop, NULL);
-  dtime = DTIME (stop, start);
-  fprintf (stderr, "mark: gstars: time %9.4f sec\n", dtime);
-
   Naverage = Nmeasure = 0;
   for (i = 0; i < skylist[0].Nregions; i++) {
-
-    gettimeofday (&t1, NULL);
 
     catalog.filename = skylist[0].filename[i];
@@ -87,12 +79,6 @@
     Ns = Nstars;
 
-    gettimeofday (&t2, NULL);
-    dtime = DTIME (t2, t1);
-    fprintf (stderr, "load time %9.4f sec for %5d stars, %6d average, %7d measure\n", dtime, Ns, Na, Nm);
-
     Naverage += catalog.Naverage;
     Nmeasure += catalog.Nmeasure;
-
-    gettimeofday (&t1, NULL);
 
     switch (options.mode) {
@@ -114,10 +100,4 @@
     }
 
-    gettimeofday (&t2, NULL);
-    dtime = DTIME (t2, t1);
-    fprintf (stderr, "match time %9.4f sec for %5d stars, %6d average, %7d measure\n", dtime, Ns, Na, Nm);
-
-    gettimeofday (&t1, NULL);
-
     if (Nsubset == 0) {
       unlock_catalog (&catalog);
@@ -129,14 +109,5 @@
     }
     free (catalog.filename);
-
-    gettimeofday (&t2, NULL);
-    dtime = DTIME (t2, t1);
-    fprintf (stderr, "save time %9.4f sec for %5d stars, %6d average, %7d measure\n", dtime, Ns, Na, Nm);
-
   }
-
-  gettimeofday (&stop, NULL);
-  dtime = DTIME (stop, start);
-  fprintf (stderr, "mark: match: time %9.4f sec\n", dtime);
 
   if (options.calibrate) { FindCalibration (&image); }
Index: /trunk/Ohana/src/addstar/src/args.c
===================================================================
--- /trunk/Ohana/src/addstar/src/args.c	(revision 6683)
+++ /trunk/Ohana/src/addstar/src/args.c	(revision 6684)
@@ -46,4 +46,9 @@
   options.photcode = 0;
   if ((N = get_argument (argc, argv, "-p"))) {
+    remove_argument (N, &argc, argv);
+    options.photcode = GetPhotcodeCodebyName (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+  if ((N = get_argument (argc, argv, "-photcode"))) {
     remove_argument (N, &argc, argv);
     options.photcode = GetPhotcodeCodebyName (argv[N]);
@@ -253,5 +258,6 @@
   fprintf (stderr, "  optional flags:\n");
   fprintf (stderr, "  -region ra ra dec dec 	  : only add data in specified region (-ref mode only)\n");
-  fprintf (stderr, "  -p (photcode)         	  : specify photcode (override header)\n");
+  fprintf (stderr, "  -p (photcode)         	  : specify photcode (-ref / -cat / or override header)\n");
+  fprintf (stderr, "  -photcode (photcode)    	  : specify photcode (-ref / -cat / or override header)\n");
   fprintf (stderr, "  -time (YYYY/MM/DD,HH:MM:SS) : specify date/time (override header)\n");
   fprintf (stderr, "  -mosaic (filename)    	  : identify associated mosaic frame for chip image\n");
Index: /trunk/Ohana/src/addstar/src/image-db.c
===================================================================
--- /trunk/Ohana/src/addstar/src/image-db.c	(revision 6683)
+++ /trunk/Ohana/src/addstar/src/image-db.c	(revision 6684)
@@ -35,4 +35,5 @@
   if (!strcasecmp (CATFORMAT, "ELIXIR"))    db[0].format = DVO_FORMAT_ELIXIR;
   if (!strcasecmp (CATFORMAT, "PANSTARRS")) db[0].format = DVO_FORMAT_PANSTARRS;
+  if (!strcasecmp (CATFORMAT, "PMTEST"))    db[0].format = DVO_FORMAT_PMTEST;
   if (db[0].format == DVO_FORMAT_UNDEF) {
     fprintf (stderr, "invalid output catalog format\n");
@@ -51,3 +52,4 @@
   if (db[0].format == DVO_FORMAT_ELIXIR)    fits_modify (&db[0].header, "FORMAT", "%s", 1, "ELIXIR");
   if (db[0].format == DVO_FORMAT_PANSTARRS) fits_modify (&db[0].header, "FORMAT", "%s", 1, "PANSTARRS");
+  if (db[0].format == DVO_FORMAT_PMTEST)    fits_modify (&db[0].header, "FORMAT", "%s", 1, "PMTEST");
 }
Index: /trunk/Ohana/src/addstar/src/mkcatalog.c
===================================================================
--- /trunk/Ohana/src/addstar/src/mkcatalog.c	(revision 6683)
+++ /trunk/Ohana/src/addstar/src/mkcatalog.c	(revision 6684)
@@ -15,4 +15,5 @@
   if (!strcasecmp (CATFORMAT, "ELIXIR"))    catalog[0].catformat = DVO_FORMAT_ELIXIR;
   if (!strcasecmp (CATFORMAT, "PANSTARRS")) catalog[0].catformat = DVO_FORMAT_PANSTARRS;
+  if (!strcasecmp (CATFORMAT, "PMTEST"))    catalog[0].catformat = DVO_FORMAT_PMTEST;
   if (catalog[0].catformat == DVO_FORMAT_UNDEF) {
     fprintf (stderr, "invalid output catalog format\n");
Index: /trunk/Ohana/src/delstar/src/ConfigInit.c
===================================================================
--- /trunk/Ohana/src/delstar/src/ConfigInit.c	(revision 6683)
+++ /trunk/Ohana/src/delstar/src/ConfigInit.c	(revision 6684)
@@ -18,7 +18,4 @@
   ScanConfig (config, "NSIGMA",                 "%lf", 0, &NSIGMA);
   ScanConfig (config, "ALPHA",                  "%lf", 0, &ALPHA);
-  ScanConfig (config, "IMAGE_CATALOG",          "%s", 0, ImageCat);
-  ScanConfig (config, "IMAGE_CATALOG_TEMPLATE", "%s", 0, ImageTemplate);
-  ScanConfig (config, "CATALOG_TEMPLATE",       "%s", 0, CatTemplate);
   ScanConfig (config, "GSCFILE",                "%s", 0, GSCFILE);
   ScanConfig (config, "CATDIR",                 "%s", 0, CATDIR);
@@ -26,4 +23,6 @@
   ScanConfig (config, "CATFORMAT",              "%s",  0, CATFORMAT);
   ScanConfig (config, "PHOTCODE_FILE",          "%s", 0, PhotCodeFile);
+
+  sprintf (ImageCat, "%s/Images.dat", CATDIR);
 
   ScanConfig (config, "DATE-KEYWORD",           "%s", 0, DateKeyword);
Index: /trunk/Ohana/src/fixcat/src/ConfigInit.c
===================================================================
--- /trunk/Ohana/src/fixcat/src/ConfigInit.c	(revision 6683)
+++ /trunk/Ohana/src/fixcat/src/ConfigInit.c	(revision 6684)
@@ -16,8 +16,9 @@
 
   /* used in other pipeline functions */
-  ScanConfig (config, "IMAGE_CATALOG",   "%s",  0, ImageCat);
   ScanConfig (config, "CATDIR",          "%s",  0, CATDIR);
   ScanConfig (config, "GSCDIR",          "%s",  0, GSCDIR);
   ScanConfig (config, "GSCFILE",         "%s",  0, GSCFILE);
+  sprintf (ImageCat, "%s/Images.dat", CATDIR);
+
   /* unique to markstar */
   ScanConfig (config, "SEARCH_RADIUS",   "%lf", 0, &RADIUS);
Index: /trunk/Ohana/src/imregister/base/ConfigInit.c
===================================================================
--- /trunk/Ohana/src/imregister/base/ConfigInit.c	(revision 6683)
+++ /trunk/Ohana/src/imregister/base/ConfigInit.c	(revision 6684)
@@ -6,5 +6,5 @@
 
   int i, NDB;
-  char *config, *file, ElixirBase[80];
+  char *config, *file, ElixirBase[80], catdir[256];
 
   /*** load configuration info ***/
@@ -23,5 +23,7 @@
   WarnConfig (config, "PHOT_DATABASE",               "%s", 0, PhotDB);
   WarnConfig (config, "TRANS_DATABASE",              "%s", 0, TransDB);
-  WarnConfig (config, "IMAGE_CATALOG",               "%s", 0, ImPhotDB);
+
+  WarnConfig (config, "CATDIR",                      "%s", 0, catdir);
+  sprintf (ImPhotDB, "%s/Images.dat", catdir);
 
   /* small text databases: filters, camera defs */ 
Index: /trunk/Ohana/src/imregister/imphot/ConfigInit.c
===================================================================
--- /trunk/Ohana/src/imregister/imphot/ConfigInit.c	(revision 6683)
+++ /trunk/Ohana/src/imregister/imphot/ConfigInit.c	(revision 6684)
@@ -7,5 +7,5 @@
 
   int i, NDB;
-  char *config, *file, ElixirBase[80];
+  char *config, *file, ElixirBase[80], catdir[256];
 
   /*** load configuration info ***/
@@ -20,5 +20,6 @@
   success = TRUE;
 
-  WarnConfig (config, "IMAGE_CATALOG",               "%s", 0, ImPhotDB);
+  WarnConfig (config, "CATDIR",                      "%s", 0, catdir);
+  sprintf (ImPhotDB, "%s/Images.dat", catdir);
 
   /* small text databases: filters, camera defs */ 
Index: /trunk/Ohana/src/kapa/doc/ChangeLog.txt
===================================================================
--- /trunk/Ohana/src/kapa/doc/ChangeLog.txt	(revision 6683)
+++ /trunk/Ohana/src/kapa/doc/ChangeLog.txt	(revision 6684)
@@ -1,2 +1,7 @@
+
+- kapa 1.5
+  * fixed residual label text
+  * fixed box -axis,-label,-ticks bug (was ignoring user input) 
+  * dropped unused axis.label (is replaced by label.text)
 
 - kapa 1.4
Index: /trunk/Ohana/src/kapa/event/SetSection.c
===================================================================
--- /trunk/Ohana/src/kapa/event/SetSection.c	(revision 6683)
+++ /trunk/Ohana/src/kapa/event/SetSection.c	(revision 6684)
@@ -46,5 +46,4 @@
       section[ThisSection].axis[i].areticks = FALSE;
       section[ThisSection].axis[i].islabel = FALSE;
-      strcpy (section[ThisSection].axis[i].label, "");
     }    
     for (i = 0; i < 8; i++) {
Index: /trunk/Ohana/src/kapa/graph/LoadLabels.c
===================================================================
--- /trunk/Ohana/src/kapa/graph/LoadLabels.c	(revision 6683)
+++ /trunk/Ohana/src/kapa/graph/LoadLabels.c	(revision 6684)
@@ -14,5 +14,7 @@
   label = KiiRecvData (sock);
 
-  Nbytes = MIN (strlen(label), 127);
+  bzero (layout[0].label[mode].text, LABEL_MAXLEN);
+
+  Nbytes = MIN (strlen(label), LABEL_MAXLEN - 1);
   strncpy (layout[0].label[mode].text, label, Nbytes);
   label[Nbytes] = 0;
Index: /trunk/Ohana/src/kapa/graph/LoadPtext.c
===================================================================
--- /trunk/Ohana/src/kapa/graph/LoadPtext.c	(revision 6683)
+++ /trunk/Ohana/src/kapa/graph/LoadPtext.c	(revision 6684)
@@ -27,4 +27,6 @@
   layout[0].ptext[N].angle = tT;
 
+  bzero (layout[0].ptext[N].text, LABEL_MAXLEN);
+
   string = KiiRecvData (sock);
   strcpy (layout[0].ptext[N].text, string);
Index: /trunk/Ohana/src/kapa/include/constants.h
===================================================================
--- /trunk/Ohana/src/kapa/include/constants.h	(revision 6683)
+++ /trunk/Ohana/src/kapa/include/constants.h	(revision 6684)
@@ -14,4 +14,5 @@
 # define MIN_WIDTH 250
 # define MIN_HEIGHT 250
+# define LABEL_MAXLEN 128
 
 /* label names */
Index: /trunk/Ohana/src/kapa/include/structures.h
===================================================================
--- /trunk/Ohana/src/kapa/include/structures.h	(revision 6683)
+++ /trunk/Ohana/src/kapa/include/structures.h	(revision 6684)
@@ -79,5 +79,5 @@
   int  size;
   char font[64]; 
-  char text[128];
+  char text[LABEL_MAXLEN];
 } Label;
 
@@ -88,14 +88,4 @@
 } Overlay;
   
-# if (0)
-typedef struct {
-  char      ctype[16];
-  double    crval1, crpix1, cdelt1;
-  double    crval2, crpix2, cdelt2;
-  double    pc1_1, pc1_2;
-  double    pc2_1, pc2_2;
-} Coords;
-# endif
-
 typedef struct {
   float *x, *y, *z, *dxp, *dxm, *dyp, *dym;
@@ -110,5 +100,4 @@
   char isaxis, areticks, islabel, islog;
   double fx, dfx, fy, dfy;  /* axis location on graphic */
-  char label[64];
 } Axis;
 
@@ -127,5 +116,5 @@
   double   y, dy; 
 
-  char     name[64];
+  char     name[LABEL_MAXLEN];  /* name of the section */
 
 } Layout;
Index: /trunk/Ohana/src/kapa/setup/DefineLayout.c
===================================================================
--- /trunk/Ohana/src/kapa/setup/DefineLayout.c	(revision 6683)
+++ /trunk/Ohana/src/kapa/setup/DefineLayout.c	(revision 6684)
@@ -32,5 +32,4 @@
     section[0].axis[i].areticks = FALSE;
     section[0].axis[i].islabel = FALSE;
-    strcpy (section[0].axis[i].label, " ");
   }    
   for (i = 0; i < 8; i++) {
Index: /trunk/Ohana/src/libautocode/def/average-pmtest.d
===================================================================
--- /trunk/Ohana/src/libautocode/def/average-pmtest.d	(revision 6683)
+++ /trunk/Ohana/src/libautocode/def/average-pmtest.d	(revision 6684)
@@ -2,5 +2,5 @@
 EXTNAME      DVO_AVERAGE_PMTEST
 TYPE         BINTABLE
-SIZE         76
+SIZE         80
 DESCRIPTION  DVO Average Object Table
 
@@ -29,3 +29,4 @@
 FIELD offset,         offset,     int,     	    offset to first measurement
 FIELD missing,        missing,    int,     	    offset to first missing obs
+FIELD dummy,          dummy,      int,              extra space
 
Index: /trunk/Ohana/src/libdvo/src/dvo_image_raw.c
===================================================================
--- /trunk/Ohana/src/libdvo/src/dvo_image_raw.c	(revision 6683)
+++ /trunk/Ohana/src/libdvo/src/dvo_image_raw.c	(revision 6684)
@@ -24,4 +24,5 @@
     if (!strcmp (format, "ELIXIR")) db[0].format = DVO_FORMAT_ELIXIR;
     if (!strcmp (format, "PANSTARRS")) db[0].format = DVO_FORMAT_PANSTARRS;
+    if (!strcmp (format, "PMTEST")) db[0].format = DVO_FORMAT_PANSTARRS;
     if (db[0].format != DVO_FORMAT_UNDEF) goto got_format;
   }
Index: /trunk/Ohana/src/markstar/src/ConfigInit.c
===================================================================
--- /trunk/Ohana/src/markstar/src/ConfigInit.c	(revision 6683)
+++ /trunk/Ohana/src/markstar/src/ConfigInit.c	(revision 6684)
@@ -17,8 +17,9 @@
 
   /* used in other pipeline functions */
-  ScanConfig (config, "IMAGE_CATALOG",   "%s",  0, ImageCat);
   ScanConfig (config, "CATDIR",          "%s",  0, CATDIR);
   ScanConfig (config, "CATMODE",                "%s",  0, CATMODE);
   ScanConfig (config, "CATFORMAT",              "%s",  0, CATFORMAT);
+
+  sprintf (ImageCat, "%s/Images.dat", CATDIR);
 
   ScanConfig (config, "GSCDIR",          "%s",  0, GSCDIR);
Index: /trunk/Ohana/src/opihi/Makefile.Common
===================================================================
--- /trunk/Ohana/src/opihi/Makefile.Common	(revision 6683)
+++ /trunk/Ohana/src/opihi/Makefile.Common	(revision 6684)
@@ -26,10 +26,6 @@
 $(DESTLIB)/%.a: $(LIB)/%.$(ARCH).a
 	@if [ ! -d $(DESTLIB) ]; then mkdir -p $(DESTLIB); fi
-	@echo ""
-	@echo "current: $^"
-	@echo "current: $*"
-	@echo "current: $@"
 	rm -f $@
-	cp $^ $@
+	cp $< $@
 
 lib%.clean:
Index: /trunk/Ohana/src/opihi/cmd.data/Makefile
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/Makefile	(revision 6683)
+++ /trunk/Ohana/src/opihi/cmd.data/Makefile	(revision 6684)
@@ -26,4 +26,5 @@
 $(SDIR)/clear.$(ARCH).o		\
 $(SDIR)/clip.$(ARCH).o		\
+$(SDIR)/close.$(ARCH).o		\
 $(SDIR)/concat.$(ARCH).o	\
 $(SDIR)/contour.$(ARCH).o	\
Index: /trunk/Ohana/src/opihi/cmd.data/box.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/box.c	(revision 6683)
+++ /trunk/Ohana/src/opihi/cmd.data/box.c	(revision 6684)
@@ -6,4 +6,12 @@
   Graphdata graphmode;
   
+  Ngraph = -1;
+  if ((N = get_argument (argc, argv, "-n"))) {
+    remove_argument (N, &argc, argv);
+    Ngraph = atof (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+  if (!GetGraph (&graphmode, &Xgraph, &Ngraph)) return (FALSE);
+
   strcpy (graphmode.ticks, "2222");
   if ((N = get_argument (argc, argv, "-ticks"))) {
@@ -38,12 +46,4 @@
     }
   }
-
-  Ngraph = -1;
-  if ((N = get_argument (argc, argv, "-n"))) {
-    remove_argument (N, &argc, argv);
-    Ngraph = atof (argv[N]);
-    remove_argument (N, &argc, argv);
-  }
-  if (!GetGraph (&graphmode, &Xgraph, &Ngraph)) return (FALSE);
 
   if (argc != 1) goto usage;
Index: /trunk/Ohana/src/opihi/cmd.data/init.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/init.c	(revision 6683)
+++ /trunk/Ohana/src/opihi/cmd.data/init.c	(revision 6684)
@@ -9,4 +9,5 @@
 int clear            PROTO((int, char **));
 int clip             PROTO((int, char **));
+int close_device     PROTO((int, char **));
 int concat           PROTO((int, char **));
 int contour          PROTO((int, char **));
@@ -115,4 +116,5 @@
   {"clear",   	   clear,	     "erase plot"},
   {"clip",         clip,	     "clip values in a buffer to be within a range"},
+  {"close",        close_device,     "close the current display device"},
   {"concat",  	   concat,	     "reduce vector dimension"},
   {"contour", 	   contour,	     "create contour from image"},
Index: /trunk/Ohana/src/opihi/dvo/LoadImages.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/LoadImages.c	(revision 6683)
+++ /trunk/Ohana/src/opihi/dvo/LoadImages.c	(revision 6684)
@@ -3,9 +3,12 @@
 Image *LoadImages (int *nimage) {
 
-  char filename[256];
+  char *catdir, filename[256];
   Image *image;
   FITS_DB db;
   
-  VarConfig ("IMAGE_CATALOG", "%s", filename);
+  /* VarConfig ("IMAGE_CATALOG", "%s", filename); */
+
+  catdir = GetCATDIR ();
+  sprintf (filename, "%s/Images.dat", catdir);
 
   fits_db_init (&db);
Index: /trunk/Ohana/src/opihi/dvo/catdir.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/catdir.c	(revision 6683)
+++ /trunk/Ohana/src/opihi/dvo/catdir.c	(revision 6684)
@@ -3,4 +3,5 @@
 int catdir_define (int argc, char **argv) {
   
+  char *current;
   int status, N, VERBOSE;
 
@@ -14,4 +15,10 @@
     fprintf (stderr, "USAGE: catdir (name)\n");
     fprintf (stderr, "       (name) may be a path or 'default'\n");
+    current = GetCATDIR ();
+    if (current == NULL) {
+      fprintf (stderr, "catdir not defined\n");
+    } else {
+      fprintf (stderr, "current: %s\n", current);
+    }
     return (FALSE);
   }
Index: /trunk/Ohana/src/opihi/dvo/region_list.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/region_list.c	(revision 6683)
+++ /trunk/Ohana/src/opihi/dvo/region_list.c	(revision 6684)
@@ -11,5 +11,5 @@
 
   char *newpath;
-  char catdir[256];
+  char catdir_config[256];
   char gscfile[256];
   char skyfile[256];
@@ -18,6 +18,6 @@
   /* find CATDIR in config system */
   if (path == NULL) {
-    if (VarConfig ("CATDIR", "%s", catdir) == NULL) return (FALSE);
-    newpath = catdir;
+    if (VarConfig ("CATDIR", "%s", catdir_config) == NULL) return (FALSE);
+    newpath = catdir_config;
   } else {
     newpath = path;
@@ -32,5 +32,5 @@
 
   if (verbose) {
-      fprintf (stderr, "CATDIR %s\n", catdir);
+      fprintf (stderr, "CATDIR %s\n", CATDIR);
       fprintf (stderr, "GSCFILE %s\n", gscfile);
       fprintf (stderr, "SKYFILE %s\n", skyfile);
@@ -42,10 +42,17 @@
 
   if (sky != NULL) SkyTableFree (sky);
-  sky = SkyTableLoadOptimal (catdir, skyfile, gscfile, skydepth, verbose);
+  sky = SkyTableLoadOptimal (CATDIR, skyfile, gscfile, skydepth, verbose);
   if (sky == NULL) return FALSE;
 
-  SkyTableSetFilenames (sky, catdir, "cpt");
+  SkyTableSetFilenames (sky, CATDIR, "cpt");
 
   return (TRUE);
+}
+
+char *GetCATDIR () {
+  if (CATDIR == NULL) {
+    SetCATDIR (NULL, FALSE);
+  }
+  return (CATDIR);
 }
 
Index: /trunk/Ohana/src/opihi/include/display.h
===================================================================
--- /trunk/Ohana/src/opihi/include/display.h	(revision 6683)
+++ /trunk/Ohana/src/opihi/include/display.h	(revision 6684)
@@ -24,4 +24,5 @@
 void          InitGraph             PROTO((void));
 int           open_graph            PROTO((int N));
+int           close_graph           PROTO((int N));
 void          QuitGraph             PROTO((void));
 void          SetGraph              PROTO((Graphdata data));
@@ -35,4 +36,5 @@
 void          InitImage             PROTO((void));
 int           open_image            PROTO((int N));
+int           close_image           PROTO((int N));
 void          QuitImage             PROTO((void));
 void          SetImageDevice        PROTO((int state));
Index: /trunk/Ohana/src/opihi/include/dvo1.h
===================================================================
--- /trunk/Ohana/src/opihi/include/dvo1.h	(revision 6683)
+++ /trunk/Ohana/src/opihi/include/dvo1.h	(revision 6684)
@@ -73,4 +73,5 @@
 SkyList      *SkyListLoadFile       PROTO((char *filename));
 int           SetCATDIR             PROTO((char *path, int verbose));
+char *        GetCATDIR             PROTO(());
 SkyTable     *GetSkyTable           PROTO(());
 SkyList      *SkyListFromFile       PROTO((char *filename));
Index: /trunk/Ohana/src/opihi/lib.data/open_graph.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.data/open_graph.c	(revision 6683)
+++ /trunk/Ohana/src/opihi/lib.data/open_graph.c	(revision 6684)
@@ -8,6 +8,4 @@
 static int       Xgraph[NXGRAPH];  
 static Graphdata graphdata[NXGRAPH];
-
-
 
 void QuitGraph () {
@@ -80,4 +78,14 @@
 
   Xgraph[N] = fd;
+  return (TRUE);
+}
+
+int close_graph (int N) {
+
+  if (N <  0) return (FALSE);
+  if (N >= NXGRAPH) return (FALSE);
+
+  KiiClose (Xgraph[N]); 
+  Xgraph[N] = -1;
   return (TRUE);
 }
Index: /trunk/Ohana/src/opihi/lib.data/open_image.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.data/open_image.c	(revision 6683)
+++ /trunk/Ohana/src/opihi/lib.data/open_image.c	(revision 6684)
@@ -33,22 +33,4 @@
 }
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 /* set SIGPIPE to this function to close cleanly */ 
 void XImageDead (int input) {
@@ -80,4 +62,14 @@
 
   Ximage[N] = fd;
+  return (TRUE);
+}
+
+int close_image (int N) {
+
+  if (N <  0) return (FALSE);
+  if (N >= NXIMAGE) return (FALSE);
+
+  KiiClose (Ximage[N]); 
+  Ximage[N] = -1;
   return (TRUE);
 }
Index: /trunk/Ohana/src/photdbc/src/ConfigInit.c
===================================================================
--- /trunk/Ohana/src/photdbc/src/ConfigInit.c	(revision 6683)
+++ /trunk/Ohana/src/photdbc/src/ConfigInit.c	(revision 6684)
@@ -48,9 +48,9 @@
   WarnConfig (config, "NMEAS_MIN",              "%d",  0, &NMEAS_MIN);
 
-  WarnConfig (config, "IMAGE_CATALOG",          "%s",  0, ImageCat);
   WarnConfig (config, "GSCFILE",                "%s",  0, GSCFILE);
   WarnConfig (config, "CATDIR",                 "%s",  0, CATDIR);
   ScanConfig (config, "CATMODE",                "%s",  0, CATMODE);
   ScanConfig (config, "CATFORMAT",              "%s",  0, CATFORMAT);
+  sprintf (ImageCat, "%s/Images.dat", CATDIR);
 
   WarnConfig (config, "PHOTCODE_FILE",          "%s",  0, PhotCodeFile);
Index: /trunk/Ohana/src/relphot/src/ConfigInit.c
===================================================================
--- /trunk/Ohana/src/relphot/src/ConfigInit.c	(revision 6683)
+++ /trunk/Ohana/src/relphot/src/ConfigInit.c	(revision 6684)
@@ -28,11 +28,10 @@
   GetConfig (config, "IMAGE_GOOD_FRACTION",    "%lf", 0, &IMAGE_GOOD_FRACTION);
 
-  GetConfig (config, "IMAGE_CATALOG",          "%s",  0, ImageCat);
-  GetConfig (config, "IMAGE_CATALOG_TEMPLATE", "%s",  0, ImageTemplate);
-  GetConfig (config, "CATALOG_TEMPLATE",       "%s",  0, CatTemplate);
   GetConfig (config, "GSCFILE",                "%s",  0, GSCFILE);
   GetConfig (config, "CATDIR",                 "%s",  0, CATDIR);
   ScanConfig (config, "CATMODE",                "%s",  0, CATMODE);
   ScanConfig (config, "CATFORMAT",              "%s",  0, CATFORMAT);
+  sprintf (ImageCat, "%s/Images.dat", CATDIR);
+
   GetConfig (config, "PHOTCODE_FILE",          "%s",  0, PhotCodeFile);
   GetConfig (config, "ZERO_PT",                "%lf", 0, &ZERO_POINT);
Index: /trunk/Ohana/src/relphot/src/initialize.c
===================================================================
--- /trunk/Ohana/src/relphot/src/initialize.c	(revision 6683)
+++ /trunk/Ohana/src/relphot/src/initialize.c	(revision 6684)
@@ -45,6 +45,4 @@
     fprintf (stderr, "IMAGE_OFFSET           %lf\n", IMAGE_OFFSET);
     fprintf (stderr, "IMAGE_CATALOG          %s\n",  ImageCat);
-    fprintf (stderr, "IMAGE_CATALOG_TEMPLATE %s\n",  ImageTemplate);
-    fprintf (stderr, "CATALOG_TEMPLATE       %s\n",  CatTemplate);
     fprintf (stderr, "GSCFILE                %s\n",  GSCFILE);
     fprintf (stderr, "CATDIR                 %s\n",  CATDIR);
Index: /trunk/Ohana/src/uniphot/src/ConfigInit.c
===================================================================
--- /trunk/Ohana/src/uniphot/src/ConfigInit.c	(revision 6683)
+++ /trunk/Ohana/src/uniphot/src/ConfigInit.c	(revision 6684)
@@ -20,6 +20,6 @@
   ScanConfig (config, "CATMODE",                "%s",  0, CATMODE);
   ScanConfig (config, "CATFORMAT",              "%s",  0, CATFORMAT);
+  sprintf (ImageCat, "%s/Images.dat", CATDIR);
 
-  ScanConfig (config, "IMAGE_CATALOG",          "%s",  0, ImageCat);
   ScanConfig (config, "PHOTCODE_FILE",          "%s",  0, PhotCodeFile);
   ScanConfig (config, "ZERO_PT",                "%lf", 0, &ZERO_POINT);
