Index: /trunk/Ohana/src/addstar/src/LoadStars.c
===================================================================
--- /trunk/Ohana/src/addstar/src/LoadStars.c	(revision 14589)
+++ /trunk/Ohana/src/addstar/src/LoadStars.c	(revision 14590)
@@ -97,5 +97,5 @@
   } else {
     double jd;
-    jd = sec_to_jd (image[0].tzero);
+    jd = ohana_sec_to_jd (image[0].tzero);
     image[0].sidtime  = ohana_lst (jd, Longitude);
   }
Index: /trunk/Ohana/src/addstar/src/ReadImageHeader.c
===================================================================
--- /trunk/Ohana/src/addstar/src/ReadImageHeader.c	(revision 14589)
+++ /trunk/Ohana/src/addstar/src/ReadImageHeader.c	(revision 14590)
@@ -126,5 +126,5 @@
   } else {
     double jd;
-    jd = sec_to_jd (image[0].tzero);
+    jd = ohana_sec_to_jd (image[0].tzero);
     image[0].sidtime  = ohana_lst (jd, Longitude);
   }
Index: /trunk/Ohana/src/addstar/src/args.c
===================================================================
--- /trunk/Ohana/src/addstar/src/args.c	(revision 14589)
+++ /trunk/Ohana/src/addstar/src/args.c	(revision 14590)
@@ -91,5 +91,5 @@
     time_t tmp;
     remove_argument (N, &argc, argv);
-    if (!str_to_time (argv[N], &tmp)) { 
+    if (!ohana_str_to_time (argv[N], &tmp)) { 
       fprintf (stderr, "syntax error in time\n");
       exit (1);
Index: /trunk/Ohana/src/addstar/src/args_client.c
===================================================================
--- /trunk/Ohana/src/addstar/src/args_client.c	(revision 14589)
+++ /trunk/Ohana/src/addstar/src/args_client.c	(revision 14590)
@@ -54,5 +54,5 @@
     time_t tmp;
     remove_argument (N, &argc, argv);
-    if (!str_to_time (argv[N], &tmp)) { 
+    if (!ohana_str_to_time (argv[N], &tmp)) { 
       fprintf (stderr, "syntax error in time\n");
       exit (1);
Index: /trunk/Ohana/src/addstar/src/calibrate.c
===================================================================
--- /trunk/Ohana/src/addstar/src/calibrate.c	(revision 14589)
+++ /trunk/Ohana/src/addstar/src/calibrate.c	(revision 14590)
@@ -127,5 +127,5 @@
       SaveCalibration (Mcal, new[0].dM, CalM0, dCalM, Minst, Nstar);
       if ((DUMP != NULL) && !strcmp (DUMP, "cal")) {
-	fprintf (stdout, "cal-match : %10.6f %10.6f : %7.4f %6.4f  %7.4f %6.4f   %7.4f : %7.4f %7.4f\n", average[0].R, average[0].D, Mcal, new[0].dM, CalM0, dCalM, Minst, airmass, color);
+	fprintf (stdout, "cal-match : %10.6f %10.6f : %7.4f %6.4f  %7.4f %6.4f   %7.4f : %7.4f %7.4f\n", average[0].R, average[0].D, Mcal, new[0].dM, CalM0, dCalM, Minst, new[0].airmass, color);
       }
       return;
Index: /trunk/Ohana/src/addstar/src/get2mass_ops.c
===================================================================
--- /trunk/Ohana/src/addstar/src/get2mass_ops.c	(revision 14589)
+++ /trunk/Ohana/src/addstar/src/get2mass_ops.c	(revision 14590)
@@ -148,5 +148,5 @@
   if (end == NULL) Shutdown ("format error in 2mass");
   *end = 0;
-  time = date_to_sec (ptr);
+  time = ohana_date_to_sec (ptr);
   *end = '|';
 
@@ -167,5 +167,5 @@
   *end = 0;
   jd = strtod (p, NULL);
-  time = jd_to_sec (jd);
+  time = ohana_jd_to_sec (jd);
   *end = '|';
 
Index: /trunk/Ohana/src/addstar/src/gettycho.c
===================================================================
--- /trunk/Ohana/src/addstar/src/gettycho.c	(revision 14589)
+++ /trunk/Ohana/src/addstar/src/gettycho.c	(revision 14590)
@@ -53,5 +53,5 @@
   ALLOCATE (buffer, char, NITEM*NBYTE);
 
-  TychoEpoch = date_to_sec ("1991/04/02,07:30:00");
+  TychoEpoch = ohana_date_to_sec ("1991/04/02,07:30:00");
 
   for (i = 0; i < skylist[0].Nregions; i++) {
Index: /trunk/Ohana/src/addstar/src/getusnob.c
===================================================================
--- /trunk/Ohana/src/addstar/src/getusnob.c	(revision 14589)
+++ /trunk/Ohana/src/addstar/src/getusnob.c	(revision 14590)
@@ -108,5 +108,5 @@
     }
 
-    USNOepoch = date_to_sec ("2000/01/01,00:00:00");
+    USNOepoch = ohana_date_to_sec ("2000/01/01,00:00:00");
 
     buf = buffer;
Index: /trunk/Ohana/src/delstar/src/args.c
===================================================================
--- /trunk/Ohana/src/delstar/src/args.c	(revision 14589)
+++ /trunk/Ohana/src/delstar/src/args.c	(revision 14590)
@@ -61,9 +61,9 @@
     remove_argument (N, argc, argv);
 
-    if (!str_to_time (argv[N], &START)) usage ();
+    if (!ohana_str_to_time (argv[N], &START)) usage ();
     remove_argument (N, argc, argv);
 
     /* interpret second value */
-    if (str_to_dtime (argv[N], &trange)) { 
+    if (ohana_str_to_dtime (argv[N], &trange)) { 
       if (trange < 0) {
 	END = START;
@@ -75,5 +75,5 @@
       goto goodtime;
     }
-    if (str_to_time (argv[N], &END)) { 
+    if (ohana_str_to_time (argv[N], &END)) { 
       if (START > END) {
 	tmp   = START;
Index: /trunk/Ohana/src/delstar/src/delete_imagename.c
===================================================================
--- /trunk/Ohana/src/delstar/src/delete_imagename.c	(revision 14589)
+++ /trunk/Ohana/src/delstar/src/delete_imagename.c	(revision 14590)
@@ -83,5 +83,5 @@
   gfits_modify (&db[0].header, "NIMAGES", "%d", 1, Noutimage);
   db[0].theader.Naxis[1] = Noutimage;
-  db[0].ftable.buffer = outimage;
+  db[0].ftable.buffer = (char *) outimage;
 
   dvo_image_save (db, VERBOSE);
Index: /trunk/Ohana/src/gastro/include/gastro.h
===================================================================
--- /trunk/Ohana/src/gastro/include/gastro.h	(revision 14589)
+++ /trunk/Ohana/src/gastro/include/gastro.h	(revision 14590)
@@ -1,4 +1,5 @@
 # include <ohana.h>
 # include <dvo.h>
+# include <kapa.h>
 
 double DEFAULT_RADIUS;
@@ -47,10 +48,4 @@
 double ASEC_PIX;
 char ROUGH_ASTROMETRY[64];
-
-typedef struct {
-  double xmin, xmax, ymin, ymax;
-  int style, ptype, ltype, etype, color;
-  double lweight, size;
-} Graphdata;
 
 /* simple structure to carry around data on an array of stars */
Index: /trunk/Ohana/src/gastro/src/gstars.c
===================================================================
--- /trunk/Ohana/src/gastro/src/gstars.c	(revision 14589)
+++ /trunk/Ohana/src/gastro/src/gstars.c	(revision 14590)
@@ -82,5 +82,5 @@
 	exit (1);
       }
-      dms_to_ddd (&coords[0].crval1, line);
+      ohana_dms_to_ddd (&coords[0].crval1, line);
       coords[0].crval1 = coords[0].crval1 * 15.0;
 
@@ -90,5 +90,5 @@
 	exit (1);
       } 
-      dms_to_ddd (&coords[0].crval2, line);
+      ohana_dms_to_ddd (&coords[0].crval2, line);
     }
   }
Index: /trunk/Ohana/src/gastro/src/plotstuff.c
===================================================================
--- /trunk/Ohana/src/gastro/src/plotstuff.c	(revision 14589)
+++ /trunk/Ohana/src/gastro/src/plotstuff.c	(revision 14590)
@@ -46,9 +46,17 @@
 void PlotVector (int Npts, float *vect, int mode, int N) {
 
-  int Nbytes;
-
   if (Npts < 1) return;
   active = N;
-  KapaPlotVector (Xgraph[N], Npts, vect);
+
+  switch (mode) {
+    case 0:
+      KapaPlotVector (Xgraph[N], Npts, vect, "x");
+      break;
+    case 1:
+      KapaPlotVector (Xgraph[N], Npts, vect, "y");
+      break;
+    default:
+      abort();
+  }
 }
 
Index: /trunk/Ohana/src/gastro2/include/gastro2.h
===================================================================
--- /trunk/Ohana/src/gastro2/include/gastro2.h	(revision 14589)
+++ /trunk/Ohana/src/gastro2/include/gastro2.h	(revision 14590)
@@ -1,4 +1,5 @@
 # include <ohana.h>
 # include <dvo.h>
+# include <kapa.h>
 
 typedef struct {
@@ -123,10 +124,4 @@
 char LONEOS_REGION_FILE[256];
 
-typedef struct {
-  double xmin, xmax, ymin, ymax;
-  int style, ptype, ltype, etype, ebar, color;
-  double lweight, size;
-} Graphdata;
-
 StarData *rtext (FILE *f, int *nstars);
 StarData *rfits (FILE *f, int *nstars);
Index: /trunk/Ohana/src/gastro2/src/gstars2.c
===================================================================
--- /trunk/Ohana/src/gastro2/src/gstars2.c	(revision 14589)
+++ /trunk/Ohana/src/gastro2/src/gstars2.c	(revision 14590)
@@ -72,8 +72,8 @@
     FoundAstrom = TRUE;
     FoundAstrom &= gfits_scan (&Target[0].header, "RA", "%s", 1, line);
-    dms_to_ddd (&Target[0].coords.crval1, line);
+    ohana_dms_to_ddd (&Target[0].coords.crval1, line);
     Target[0].coords.crval1 = Target[0].coords.crval1 * 15.0;
     FoundAstrom &= gfits_scan (&Target[0].header, "DEC", "%s", 1, line);
-    dms_to_ddd (&Target[0].coords.crval2, line);
+    ohana_dms_to_ddd (&Target[0].coords.crval2, line);
   }
 
Index: /trunk/Ohana/src/gastro2/src/plotstuff.c
===================================================================
--- /trunk/Ohana/src/gastro2/src/plotstuff.c	(revision 14589)
+++ /trunk/Ohana/src/gastro2/src/plotstuff.c	(revision 14590)
@@ -46,9 +46,17 @@
 void PlotVector (int Npts, float *vect, int mode, int N) {
 
-  int Nbytes;
-
   if (Npts < 1) return;
   active = N;
-  KapaPlotVector (Xgraph[N], Npts, vect);
+
+  switch (mode) {
+    case 0:
+      KapaPlotVector (Xgraph[N], Npts, vect, "x");
+      break;
+    case 1:
+      KapaPlotVector (Xgraph[N], Npts, vect, "y");
+      break;
+    default:
+      abort();
+  }
 }
 
Index: /trunk/Ohana/src/getstar/include/dvoImageOverlaps.h
===================================================================
--- /trunk/Ohana/src/getstar/include/dvoImageOverlaps.h	(revision 14589)
+++ /trunk/Ohana/src/getstar/include/dvoImageOverlaps.h	(revision 14590)
@@ -36,2 +36,3 @@
 int GetFileMode (Header *header);
 int edge_check (double *x1, double *y1, double *x2, double *y2);
+double opening_angle (double x1, double y1, double x2, double y2, double x3, double y3);
Index: /trunk/Ohana/src/getstar/src/MatchImages.c
===================================================================
--- /trunk/Ohana/src/getstar/src/MatchImages.c	(revision 14589)
+++ /trunk/Ohana/src/getstar/src/MatchImages.c	(revision 14590)
@@ -7,8 +7,8 @@
 int *MatchImage (Image *dbImages, int NdbImages, Image *image, int *Nmatch) {
   
-  int i, j, k, N, addtolist, status;
+  int i, j, N, addtolist, status;
   int NMATCH, nmatch, *match;
   Coords tcoords;
-  double r, d, x, y;
+  double r, d;
   double Xi[4], Yi[4], Xo[4], Yo[4];  /* image and original corners */
   double Xmin, Xmax, Ymin, Ymax;
Index: /trunk/Ohana/src/getstar/src/ReadImageFiles.c
===================================================================
--- /trunk/Ohana/src/getstar/src/ReadImageFiles.c	(revision 14589)
+++ /trunk/Ohana/src/getstar/src/ReadImageFiles.c	(revision 14590)
@@ -4,5 +4,5 @@
 
   int i, j, N, Nfile, Nheader, NHEADER, Nimage, NIMAGE;
-  int Nskip, Nhead, Ndata, done, status, mode, NinStars;
+  int Nskip, Nhead, Ndata, done, status, mode;
   char **file, *name;
   FILE *f;
Index: /trunk/Ohana/src/getstar/src/ReadImageHeader.c
===================================================================
--- /trunk/Ohana/src/getstar/src/ReadImageHeader.c	(revision 14589)
+++ /trunk/Ohana/src/getstar/src/ReadImageHeader.c	(revision 14590)
@@ -4,7 +4,6 @@
 int ReadImageHeader (Header *header, Image *image) {
 
-  int Nastro, ccdnum, hour, min, Nx, Ny;
-  double tmp, sec, Cerror;
-  char *c, photname[64], line[80];
+  int Nastro, Nx, Ny;
+  double tmp;
 
   /* get astrometry information */
Index: /trunk/Ohana/src/getstar/src/SelectImages.c
===================================================================
--- /trunk/Ohana/src/getstar/src/SelectImages.c	(revision 14589)
+++ /trunk/Ohana/src/getstar/src/SelectImages.c	(revision 14590)
@@ -4,5 +4,5 @@
 int *SelectImages (char *filename, Image *images, int Nimages, int *Nmatch) {
   
-  int i, Nchar, status;
+  int i, Nchar;
   int NMATCH, nmatch, *match;
 
Index: /trunk/Ohana/src/getstar/src/WriteImageFITS.c
===================================================================
--- /trunk/Ohana/src/getstar/src/WriteImageFITS.c	(revision 14589)
+++ /trunk/Ohana/src/getstar/src/WriteImageFITS.c	(revision 14590)
@@ -8,5 +8,4 @@
   int Nstars;
   Header header;
-  Matrix matrix;
   Header theader;
   FTable table;
Index: /trunk/Ohana/src/getstar/src/WriteImages.c
===================================================================
--- /trunk/Ohana/src/getstar/src/WriteImages.c	(revision 14589)
+++ /trunk/Ohana/src/getstar/src/WriteImages.c	(revision 14590)
@@ -4,6 +4,5 @@
 int WriteImages (char *filename, Image *images, int Nimages, int *matches, int Nmatches) {
   
-  int i, N, status;
-  int NMATCH, nmatch, *match;
+  int i, N;
   int nWRP, newWRP, isWRP;
   FILE *f;
Index: /trunk/Ohana/src/getstar/src/args.c
===================================================================
--- /trunk/Ohana/src/getstar/src/args.c	(revision 14589)
+++ /trunk/Ohana/src/getstar/src/args.c	(revision 14590)
@@ -59,5 +59,5 @@
     remove_argument (N, &argc, argv);
     if (argc != 5) help();
-    str_to_radec (&R, &D, argv[N+0], argv[N+1]);
+    ohana_str_to_radec (&R, &D, argv[N+0], argv[N+1]);
     REGION.Rmin = R;
     REGION.Dmin = D;
@@ -65,5 +65,5 @@
     remove_argument (N, &argc, argv);
 
-    str_to_radec (&R, &D, argv[N+0], argv[N+1]);
+    ohana_str_to_radec (&R, &D, argv[N+0], argv[N+1]);
     REGION.Rmax = R;
     REGION.Dmax = D;
@@ -87,5 +87,5 @@
     remove_argument (N, &argc, argv);
     if (argc != 4) help();
-    str_to_radec (&R, &D, argv[N+0], argv[N+1]);
+    ohana_str_to_radec (&R, &D, argv[N+0], argv[N+1]);
     radius = atof(argv[N+2]);
     REGION.Rmin = R - radius / cos(D*RAD_DEG);
Index: /trunk/Ohana/src/getstar/src/dvoImageExtract.c
===================================================================
--- /trunk/Ohana/src/getstar/src/dvoImageExtract.c	(revision 14589)
+++ /trunk/Ohana/src/getstar/src/dvoImageExtract.c	(revision 14590)
@@ -3,8 +3,7 @@
 int main (int argc, char **argv) {
 
-  int i, Nimages, status;
+  int Nimages, status;
   int Nmatches, *matches;
   Image *images;
-  Catalog catalog;
   FITS_DB db;
 
Index: /trunk/Ohana/src/getstar/src/dvoImageOverlaps.c
===================================================================
--- /trunk/Ohana/src/getstar/src/dvoImageOverlaps.c	(revision 14589)
+++ /trunk/Ohana/src/getstar/src/dvoImageOverlaps.c	(revision 14590)
@@ -6,5 +6,4 @@
   int Nmatches, *matches;
   Image *images, *dbImages;
-  Catalog catalog;
   FITS_DB db;
 
Index: /trunk/Ohana/src/imregister/base/misc.c
===================================================================
--- /trunk/Ohana/src/imregister/base/misc.c	(revision 14589)
+++ /trunk/Ohana/src/imregister/base/misc.c	(revision 14590)
@@ -35,5 +35,5 @@
     
     /* tstart */
-    if (!str_to_time (argv[Na], &tstart[N])) { 
+    if (!ohana_str_to_time (argv[Na], &tstart[N])) { 
       return (FALSE);
     }
@@ -41,5 +41,5 @@
     /* interpret second value */
     remove_argument (Na, argc, argv);
-    if (str_to_dtime (argv[Na], &trange)) { 
+    if (ohana_str_to_dtime (argv[Na], &trange)) { 
       if (trange < 0) {
 	tstop[N]  = tstart[N];
@@ -51,5 +51,5 @@
       goto goodvalue;
     }
-    if (str_to_time (argv[Na], &tstop[N])) { 
+    if (ohana_str_to_time (argv[Na], &tstop[N])) { 
       if (tstart[N] > tstop[N]) {
 	tmp     = tstart[N];
Index: /trunk/Ohana/src/imregister/base/parse_time.c
===================================================================
--- /trunk/Ohana/src/imregister/base/parse_time.c	(revision 14589)
+++ /trunk/Ohana/src/imregister/base/parse_time.c	(revision 14590)
@@ -15,5 +15,5 @@
     uppercase (JDKeyword);
     warn_scan (header, JDKeyword, "%lf", 1, &jd);
-    Nsec = jd_to_sec (jd);
+    Nsec = ohana_jd_to_sec (jd);
     return (Nsec);
   }
@@ -23,5 +23,5 @@
     uppercase (MJDKeyword);
     warn_scan (header, MJDKeyword, "%lf", 1, &jd);
-    Nsec = mjd_to_sec (jd);
+    Nsec = ohana_mjd_to_sec (jd);
     return (Nsec);
   }
Index: /trunk/Ohana/src/imregister/detrend/args.detregister.c
===================================================================
--- /trunk/Ohana/src/imregister/detrend/args.detregister.c	(revision 14589)
+++ /trunk/Ohana/src/imregister/detrend/args.detregister.c	(revision 14590)
@@ -18,10 +18,10 @@
   if ((N = get_argument (argc, argv, "-time"))) {
     remove_argument (N, &argc, argv);
-    if (!str_to_time (argv[N], &descriptor[0].tstart)) { 
+    if (!ohana_str_to_time (argv[N], &descriptor[0].tstart)) { 
       fprintf (stderr, "syntax error\n");
       return (FALSE);
     }
     remove_argument (N, &argc, argv);
-    if (!str_to_time (argv[N], &descriptor[0].tstop)) { 
+    if (!ohana_str_to_time (argv[N], &descriptor[0].tstop)) { 
       fprintf (stderr, "syntax error\n");
       return (FALSE);
Index: /trunk/Ohana/src/imregister/detrend/args.detsearch.c
===================================================================
--- /trunk/Ohana/src/imregister/detrend/args.detsearch.c	(revision 14589)
+++ /trunk/Ohana/src/imregister/detrend/args.detsearch.c	(revision 14590)
@@ -101,5 +101,5 @@
     remove_argument (N, &argc, argv);
     bad  = get_argument (argc, argv, "-trange");
-    bad &= str_to_time (argv[N], &base.tstart);
+    bad &= ohana_str_to_time (argv[N], &base.tstart);
     if (bad) {
       fprintf (stderr, "ERROR: syntax error in -time\n");
@@ -302,5 +302,5 @@
   valid_entry:
     if (!strcasecmp (output.ModifyEntry, "tstart") || !strcasecmp (output.ModifyEntry, "tstop")) {
-      if (!str_to_time (output.ModifyValue, &output.TimeValue)) { 
+      if (!ohana_str_to_time (output.ModifyValue, &output.TimeValue)) { 
 	fprintf (stderr, "ERROR: invalid time %s\n", output.ModifyValue);
 	exit (1);
Index: /trunk/Ohana/src/imregister/detrend/imdef.c
===================================================================
--- /trunk/Ohana/src/imregister/detrend/imdef.c	(revision 14589)
+++ /trunk/Ohana/src/imregister/detrend/imdef.c	(revision 14590)
@@ -88,5 +88,5 @@
       exit (1);
     }
-    if (!str_to_time (line, &descriptor[0].tstart)) { 
+    if (!ohana_str_to_time (line, &descriptor[0].tstart)) { 
       fprintf (stderr, "ERROR: invalid time %s\n", line);
       exit (1);
@@ -97,5 +97,5 @@
       exit (1);
     }
-    if (!str_to_time (line, &descriptor[0].tstop)) { 
+    if (!ohana_str_to_time (line, &descriptor[0].tstop)) { 
       fprintf (stderr, "ERROR: invalid time %s\n", line);
       exit (1);
Index: /trunk/Ohana/src/imregister/detrend/output.c
===================================================================
--- /trunk/Ohana/src/imregister/detrend/output.c	(revision 14589)
+++ /trunk/Ohana/src/imregister/detrend/output.c	(revision 14590)
@@ -83,6 +83,6 @@
       
   /* add current date/time to header */
-  str_to_time ("now", &tsecond);
-  datestr = sec_to_date (tsecond);
+  ohana_str_to_time ("now", &tsecond);
+  datestr = ohana_sec_to_date (tsecond);
   gfits_modify (&header,  "DATE", "%s", 1, datestr);
   gfits_modify (&theader, "DATE", "%s", 1, datestr);
@@ -151,7 +151,7 @@
     if ((p = strrchr (key, '.')) != (char *) NULL) *p = 0;
 
-    startstr = sec_to_date (newdata[0].tstart);
-    stopstr  = sec_to_date (newdata[0].tstop);
-    regstr   = sec_to_date (newdata[0].treg);
+    startstr = ohana_sec_to_date (newdata[0].tstart);
+    stopstr  = ohana_sec_to_date (newdata[0].tstop);
+    regstr   = ohana_sec_to_date (newdata[0].treg);
     typestr  = get_type_name(newdata[0].type);
     modestr  = get_mode_name(newdata[0].mode);
@@ -212,11 +212,11 @@
     switch (output.TimeMode) {
     case START:
-      timestr = sec_to_date (detdata[i].tstart);
+      timestr = ohana_sec_to_date (detdata[i].tstart);
       break;
     case STOP:
-      timestr = sec_to_date (detdata[i].tstop);
+      timestr = ohana_sec_to_date (detdata[i].tstop);
       break;
     case REG:
-      timestr = sec_to_date (detdata[i].treg);
+      timestr = ohana_sec_to_date (detdata[i].treg);
       break;
     default:
@@ -275,6 +275,6 @@
 
   for (i = 0; i < Ncriteria; i++) {
-    start = sec_to_date (criteria[i].tstart);
-    stop  = sec_to_date (criteria[i].tstop);
+    start = ohana_sec_to_date (criteria[i].tstart);
+    stop  = ohana_sec_to_date (criteria[i].tstop);
     
     fprintf (stdout, "%19s %19s %7s %6s %s %6.1f\n", 
Index: /trunk/Ohana/src/imregister/imphot/dumpfits.c
===================================================================
--- /trunk/Ohana/src/imregister/imphot/dumpfits.c	(revision 14589)
+++ /trunk/Ohana/src/imregister/imphot/dumpfits.c	(revision 14590)
@@ -72,6 +72,6 @@
 
   /* add current date/time to header */
-  str_to_time ("now", &tsecond);
-  datestr = sec_to_date (tsecond);
+  ohana_str_to_time ("now", &tsecond);
+  datestr = ohana_sec_to_date (tsecond);
   gfits_modify (&header,  "DATE", "%s", 1, datestr);
   gfits_modify (&theader, "DATE", "%s", 1, datestr);
@@ -112,5 +112,5 @@
   for (i = 0; i < Nmatch; i++) {
     subset   = &image[match[i]];
-    startstr = sec_to_date (subset[0].tzero);
+    startstr = ohana_sec_to_date (subset[0].tzero);
     filtstr  = GetPhotcodeNamebyCode (subset[0].photcode);
     zp       = subset[0].Mcal;
Index: /trunk/Ohana/src/imregister/imphot/output.c
===================================================================
--- /trunk/Ohana/src/imregister/imphot/output.c	(revision 14589)
+++ /trunk/Ohana/src/imregister/imphot/output.c	(revision 14590)
@@ -32,5 +32,5 @@
       
     /* convert UNIX time to Elixir-style date string */
-    timestr = sec_to_date (image[i].tzero);
+    timestr = ohana_sec_to_date (image[i].tzero);
       
     /* convert photcode to filter name */
Index: /trunk/Ohana/src/imregister/imreg/cadc.c
===================================================================
--- /trunk/Ohana/src/imregister/imreg/cadc.c	(revision 14589)
+++ /trunk/Ohana/src/imregister/imreg/cadc.c	(revision 14590)
@@ -47,6 +47,6 @@
       
   /* add current date/time to header */
-  str_to_time ("now", &tsecond);
-  datestr = sec_to_date (tsecond);
+  ohana_str_to_time ("now", &tsecond);
+  datestr = ohana_sec_to_date (tsecond);
   gfits_modify (&header,  "DATE", "%s", 1, datestr);
   gfits_modify (&theader, "DATE", "%s", 1, datestr);
Index: /trunk/Ohana/src/imregister/imreg/iminfo.c
===================================================================
--- /trunk/Ohana/src/imregister/imreg/iminfo.c	(revision 14589)
+++ /trunk/Ohana/src/imregister/imreg/iminfo.c	(revision 14590)
@@ -106,8 +106,8 @@
     if (RASexigKeyword[0] & DECSexigKeyword[0]) {
       gfits_scan (&header, RASexigKeyword,  "%s", 1, line);
-      dms_to_ddd (&tmp, line);
+      ohana_dms_to_ddd (&tmp, line);
       image[0].ra = 15*tmp;
       gfits_scan (&header, DECSexigKeyword, "%s", 1, &line);
-      dms_to_ddd (&tmp, line);
+      ohana_dms_to_ddd (&tmp, line);
       image[0].dec = tmp;
     }
Index: /trunk/Ohana/src/imregister/imreg/output.c
===================================================================
--- /trunk/Ohana/src/imregister/imreg/output.c	(revision 14589)
+++ /trunk/Ohana/src/imregister/imreg/output.c	(revision 14590)
@@ -112,6 +112,6 @@
       
   /* add current date/time to header */
-  str_to_time ("now", &tsecond);
-  datestr = sec_to_date (tsecond);
+  ohana_str_to_time ("now", &tsecond);
+  datestr = ohana_sec_to_date (tsecond);
   gfits_modify (&header,  "DATE", "%s", 1, datestr);
   gfits_modify (&theader, "DATE", "%s", 1, datestr);
@@ -152,6 +152,6 @@
   for (i = 0; i < Nmatch; i++) {
     subset = &image[match[i]];
-    obsstr   = sec_to_date (subset[0].obstime);
-    regstr   = sec_to_date (subset[0].regtime);
+    obsstr   = ohana_sec_to_date (subset[0].obstime);
+    regstr   = ohana_sec_to_date (subset[0].regtime);
     typestr  = get_type_name(subset[0].type);
     modestr  = get_mode_name(subset[0].mode);
@@ -197,5 +197,5 @@
     modestr = get_mode_name (image[i].mode);
     typestr = get_type_name (image[i].type);
-    timestr = RegTimeMode ? sec_to_date (image[i].regtime) : sec_to_date (image[i].obstime);
+    timestr = RegTimeMode ? ohana_sec_to_date (image[i].regtime) : ohana_sec_to_date (image[i].obstime);
 
     if (CCDSeq) {
Index: /trunk/Ohana/src/imregister/photreg/output.c
===================================================================
--- /trunk/Ohana/src/imregister/photreg/output.c	(revision 14589)
+++ /trunk/Ohana/src/imregister/photreg/output.c	(revision 14590)
@@ -99,6 +99,6 @@
     
   /* add current date/time to header */
-  str_to_time ("now", &tsecond);
-  datestr = sec_to_date ((unsigned int) tsecond);
+  ohana_str_to_time ("now", &tsecond);
+  datestr = ohana_sec_to_date ((unsigned int) tsecond);
   gfits_modify (&header,  "DATE", "%s", 1, datestr);
   gfits_modify (&theader, "DATE", "%s", 1, datestr);
@@ -158,6 +158,6 @@
   for (i = 0; i < Nkeep; i++) {
     newdata = &photdata[index[i]];
-    startstr = sec_to_date (newdata[0].tstart);
-    stopstr = sec_to_date (newdata[0].tstop);
+    startstr = ohana_sec_to_date (newdata[0].tstart);
+    stopstr = ohana_sec_to_date (newdata[0].tstop);
     code    = GetPhotcodeNamebyCode (newdata[0].photcode);
     photsys = GetPhotcodeNamebyCode (newdata[0].refcode);
@@ -207,5 +207,5 @@
     
     /* convert UNIX time to Elixir-style date string */
-    timestr = sec_to_date (photdata[i].tstart);
+    timestr = ohana_sec_to_date (photdata[i].tstart);
     
     if (output.photcodenames) {
Index: /trunk/Ohana/src/imregister/spreg/output.c
===================================================================
--- /trunk/Ohana/src/imregister/spreg/output.c	(revision 14589)
+++ /trunk/Ohana/src/imregister/spreg/output.c	(revision 14590)
@@ -101,6 +101,6 @@
   for (i = 0; i < Nmatch; i++) {
     subset = &spectrum[match[i]];
-    obsstr = sec_to_date (subset[0].obstime);
-    regstr = sec_to_date (subset[0].regtime);
+    obsstr = ohana_sec_to_date (subset[0].obstime);
+    regstr = ohana_sec_to_date (subset[0].regtime);
 
     /* we should get an error here if we don't construct this line correctly */
@@ -119,6 +119,6 @@
 
   /* add current date/time to header */
-  str_to_time ("now", &tsecond);
-  datestr = sec_to_date (tsecond);
+  ohana_str_to_time ("now", &tsecond);
+  datestr = ohana_sec_to_date (tsecond);
   gfits_modify (&header,  "DATE", "%s", 1, datestr);
   gfits_modify (&theader, "DATE", "%s", 1, datestr);
@@ -150,5 +150,5 @@
     i = match[j];
     
-    timestr = RegTimeMode ? sec_to_date (spectrum[i].regtime) : sec_to_date (spectrum[i].obstime);
+    timestr = RegTimeMode ? ohana_sec_to_date (spectrum[i].regtime) : ohana_sec_to_date (spectrum[i].obstime);
 
     /* predefined subset of values */
Index: /trunk/Ohana/src/imregister/spreg/showinfo.c
===================================================================
--- /trunk/Ohana/src/imregister/spreg/showinfo.c	(revision 14589)
+++ /trunk/Ohana/src/imregister/spreg/showinfo.c	(revision 14590)
@@ -24,6 +24,6 @@
   fprintf (stderr, "Nspec: %d\n", spec[0].Nspec);
 
-  obstime = sec_to_date (spec[0].obstime);
-  regtime = sec_to_date (spec[0].regtime);
+  obstime = ohana_sec_to_date (spec[0].obstime);
+  regtime = ohana_sec_to_date (spec[0].regtime);
 
   fprintf (stderr, "obstime: %s\n", obstime);
Index: /trunk/Ohana/src/imregister/spreg/spinfo.c
===================================================================
--- /trunk/Ohana/src/imregister/spreg/spinfo.c	(revision 14589)
+++ /trunk/Ohana/src/imregister/spreg/spinfo.c	(revision 14590)
@@ -73,8 +73,8 @@
       /* expect RA & DEC in hh:mm:ss, dd:mm:ss */
       warn_scan (&header, RASexigKeyword,  "%s", 1, line);
-      dms_to_ddd (&tmp, line);
+      ohana_dms_to_ddd (&tmp, line);
       spectrum[0].ra = 15*tmp;
       warn_scan (&header, DECSexigKeyword, "%s", 1, &line);
-      dms_to_ddd (&tmp, line);
+      ohana_dms_to_ddd (&tmp, line);
       spectrum[0].dec = tmp;
     }
Index: /trunk/Ohana/src/imregister/src/showiminfo.c
===================================================================
--- /trunk/Ohana/src/imregister/src/showiminfo.c	(revision 14589)
+++ /trunk/Ohana/src/imregister/src/showiminfo.c	(revision 14590)
@@ -1,5 +1,5 @@
 # include "imregister.h"
 # include "imreg.h"
-static char *version = "showiminfo $Revision: 3.1 $";
+static char *version = "showiminfo $Revision: 3.2 $";
 
 int main (int argc, char **argv) {
@@ -28,6 +28,6 @@
   fprintf (stderr, "ra: %f, dec: %f, rotangle: %f\n", im.ra, im.dec, im.rotangle);
 
-  obstime = sec_to_date (im.obstime);
-  regtime = sec_to_date (im.regtime);
+  obstime = ohana_sec_to_date (im.obstime);
+  regtime = ohana_sec_to_date (im.regtime);
 
   fprintf (stderr, "obstime: %s\n", obstime);
Index: /trunk/Ohana/src/kapa2/include/icons.h
===================================================================
--- /trunk/Ohana/src/kapa2/include/icons.h	(revision 14589)
+++ /trunk/Ohana/src/kapa2/include/icons.h	(revision 14590)
@@ -1,2 +1,18 @@
+
+#define icon_width 29
+#define icon_height 29
+static unsigned char icon_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x07,
+   0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04,
+   0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0xfc, 0xff, 0xff, 0x07,
+   0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04,
+   0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0xfc, 0xff, 0xff, 0x07,
+   0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04,
+   0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0xfc, 0xff, 0xff, 0x07,
+   0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04,
+   0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0xfc, 0xff, 0xff, 0x07,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+/* *** icons for buttons, not used ***
 #define arrow_width 6
 #define arrow_height 9
@@ -19,17 +35,4 @@
    0xfc, 0x0f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x0f, 0xfc, 0x03, 0xfc, 0x00,
    0x3c, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00};
-#define icon_width 29
-#define icon_height 29
-static unsigned char icon_bits[] = {
-   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x07,
-   0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04,
-   0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0xfc, 0xff, 0xff, 0x07,
-   0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04,
-   0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0xfc, 0xff, 0xff, 0x07,
-   0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04,
-   0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0xfc, 0xff, 0xff, 0x07,
-   0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04,
-   0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0xfc, 0xff, 0xff, 0x07,
-   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
 #define stop_width 16
 #define stop_height 16
@@ -38,2 +41,3 @@
    0xf8, 0x1f, 0xf8, 0x1f, 0xf8, 0x1f, 0xf8, 0x1f, 0xf8, 0x1f, 0xf8, 0x1f,
    0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+*/
Index: /trunk/Ohana/src/kapa2/include/prototypes.h
===================================================================
--- /trunk/Ohana/src/kapa2/include/prototypes.h	(revision 14589)
+++ /trunk/Ohana/src/kapa2/include/prototypes.h	(revision 14590)
@@ -23,4 +23,5 @@
 void          NameWindow          PROTO((Graphic *graphic, char *name));
 void          MapWindow           PROTO((Graphic *graphic));
+void CheckVisual (Graphic *graphic, int *argc, char **argv);
 
 /* X drawing utilities */
@@ -85,4 +86,5 @@
 int           SetActiveSectionByNumber PROTO((int N));
 int           ListSection         PROTO((int sock));
+void SetSectionSizes (Section *section);
 
 KapaGraphWidget *InitGraph        PROTO(());
@@ -188,2 +190,31 @@
 int	      Overlay3		  PROTO((Graphic *graphic, KapaImageWidget *image));
 int	      PSfunction	  PROTO((Graphic *graphic, KapaImageWidget *image));
+
+/* misc functions */
+void SetToolbox (int sock);
+int EraseOverlay (int sock);
+int LoadOverlay (int sock);
+int SaveOverlay (int sock);
+int CSaveOverlay (int sock);
+int JPEGit24 (int sock);
+
+int UpdatePointer (Graphic *graphic, XMotionEvent *event);
+int InterpretPresses (Graphic *graphic, XButtonEvent *event);
+int InterpretKeys (Graphic *graphic, XKeyEvent *event);
+void InitPipe (char *namedSocket);
+void EraseGraph (KapaGraphWidget *graph);
+void StatusBox (Graphic *graphic, KapaImageWidget *image);
+
+void CreatePicture (KapaImageWidget *image, Graphic *graphic);
+void CreateColorbar (KapaImageWidget *image, Graphic *graphic);
+void CreateZoom (KapaImageWidget *image, Graphic *graphic, double x, double y);
+void UpdateStatusBox (Graphic *graphic, KapaImageWidget *image, double x, double y, double z, int mode);
+
+void CreateZoom8  (KapaImageWidget *image, Graphic *graphic, double x, double y);
+void CreateZoom16 (KapaImageWidget *image, Graphic *graphic, double x, double y);
+void CreateZoom24 (KapaImageWidget *image, Graphic *graphic, double x, double y);
+void CreateZoom32 (KapaImageWidget *image, Graphic *graphic, double x, double y);
+
+int GetActiveSocket ();
+void InvertButton (Graphic *graphic, Button *button);
+void bDrawOverlay (KapaImageWidget *image, int N);
Index: /trunk/Ohana/src/kapa2/include/structures.h
===================================================================
--- /trunk/Ohana/src/kapa2/include/structures.h	(revision 14589)
+++ /trunk/Ohana/src/kapa2/include/structures.h	(revision 14590)
@@ -13,5 +13,5 @@
   Cursor         cursor;
   int            x,  y;
-  int            dx, dy;
+  unsigned int   dx, dy;
   XColor         cmap[256];
   Colormap       colormap;
Index: /trunk/Ohana/src/kapa2/src/CheckGeometry.c
===================================================================
--- /trunk/Ohana/src/kapa2/src/CheckGeometry.c	(revision 14589)
+++ /trunk/Ohana/src/kapa2/src/CheckGeometry.c	(revision 14590)
@@ -4,7 +4,5 @@
 void CheckGeometry (Graphic *graphic, int *argc, char **argv) {
 
-  int status, x, y, N;
-  unsigned int dx, dy;
-  int X, Y, dX, dY;
+  int status, N;
   char *temp_name;
   
Index: /trunk/Ohana/src/kapa2/src/CheckPipe.c
===================================================================
--- /trunk/Ohana/src/kapa2/src/CheckPipe.c	(revision 14589)
+++ /trunk/Ohana/src/kapa2/src/CheckPipe.c	(revision 14590)
@@ -186,5 +186,5 @@
   
   if (!strcmp (word, "TOOL")) {
-    status = SetToolbox (sock);
+    SetToolbox (sock);
     KiiSendCommand (sock, 4, "DONE");
     FINISHED (TRUE);
Index: /trunk/Ohana/src/kapa2/src/CreateZoom8.c
===================================================================
--- /trunk/Ohana/src/kapa2/src/CreateZoom8.c	(revision 14589)
+++ /trunk/Ohana/src/kapa2/src/CreateZoom8.c	(revision 14590)
@@ -68,5 +68,5 @@
   if ((i_end - i_start) % expand_out == 0) dropback = 0;
 
-  out_pix = (char *) image[0].zoom.data;
+  out_pix = (unsigned char *) image[0].zoom.data;
   imdata  = (float *) image[0].matrix.buffer;
   in_pix  = &imdata[DX*(int)MAX(Ry,0) + (int)MAX(Rx,0)];
Index: /trunk/Ohana/src/kapa2/src/DefineSection.c
===================================================================
--- /trunk/Ohana/src/kapa2/src/DefineSection.c	(revision 14589)
+++ /trunk/Ohana/src/kapa2/src/DefineSection.c	(revision 14590)
@@ -4,5 +4,5 @@
 int DefineSection (int sock) {
   
-  int i, N, MoveSection;
+  int N, MoveSection;
   char name[128];
   double x, y, dx, dy;
Index: /trunk/Ohana/src/kapa2/src/DrawButton.c
===================================================================
--- /trunk/Ohana/src/kapa2/src/DrawButton.c	(revision 14589)
+++ /trunk/Ohana/src/kapa2/src/DrawButton.c	(revision 14590)
@@ -2,6 +2,4 @@
 
 void DrawButton (Graphic *graphic, Button *button) {
-  
-  int y, dX;
   
   XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].back);
Index: /trunk/Ohana/src/kapa2/src/EraseImage.c
===================================================================
--- /trunk/Ohana/src/kapa2/src/EraseImage.c	(revision 14589)
+++ /trunk/Ohana/src/kapa2/src/EraseImage.c	(revision 14590)
@@ -3,6 +3,4 @@
 int EraseImage () {
 
-  char buffer[256];
-  int i, status, N;
   Graphic *graphic;
   Section *section;
Index: /trunk/Ohana/src/kapa2/src/EraseOverlay.c
===================================================================
--- /trunk/Ohana/src/kapa2/src/EraseOverlay.c	(revision 14589)
+++ /trunk/Ohana/src/kapa2/src/EraseOverlay.c	(revision 14590)
@@ -3,6 +3,5 @@
 int EraseOverlay (int sock) {
 
-  char buffer[256];
-  int i, status, N;
+  int i, N;
   Graphic *graphic;
   Section *section;
Index: /trunk/Ohana/src/kapa2/src/EventLoop.c
===================================================================
--- /trunk/Ohana/src/kapa2/src/EventLoop.c	(revision 14589)
+++ /trunk/Ohana/src/kapa2/src/EventLoop.c	(revision 14590)
@@ -50,5 +50,5 @@
     if (LastEvent (display, MotionNotify,    &event)) UpdatePointer (graphic, (XMotionEvent *) &event);
     if (LastEvent (display, ButtonPress,     &event)) InterpretPresses (graphic, (XButtonEvent *) &event);
-    if (LastEvent (display, KeyPress,        &event)) InterpretKeys (graphic, &event);
+    if (LastEvent (display, KeyPress,        &event)) InterpretKeys (graphic, (XKeyEvent *) &event);
 
     /* drop and ignore the following StructureNotifyMask events */
Index: /trunk/Ohana/src/kapa2/src/GetPixelCount.c
===================================================================
--- /trunk/Ohana/src/kapa2/src/GetPixelCount.c	(revision 14589)
+++ /trunk/Ohana/src/kapa2/src/GetPixelCount.c	(revision 14590)
@@ -3,6 +3,4 @@
 int GetPixelCount (int sock) {
   
-  int i;
-  double xmin, xmax, ymin, ymax;
   Graphic *graphic;
 
Index: /trunk/Ohana/src/kapa2/src/InterpretKeys.c
===================================================================
--- /trunk/Ohana/src/kapa2/src/InterpretKeys.c	(revision 14589)
+++ /trunk/Ohana/src/kapa2/src/InterpretKeys.c	(revision 14590)
@@ -6,5 +6,5 @@
   double 	   X, Y, Z, R, D, offset;
   int    	   sock, DX, DY, modstate;
-  char   	  *name, string[16], line[40];
+  char   	  *name, string[16];
   KeySym           keysym;
   XComposeStatus   composestatus;
@@ -134,5 +134,5 @@
     case XK_Tab:
       image[0].MovePointer = image[0].MovePointer ^ TRUE;
-      if (image[0].MovePointer) UpdatePointer (graphic, image, (XMotionEvent *)event);
+      if (image[0].MovePointer) UpdatePointer (graphic, (XMotionEvent *)event);
       break;
   }
Index: /trunk/Ohana/src/kapa2/src/InterpretPresses.c
===================================================================
--- /trunk/Ohana/src/kapa2/src/InterpretPresses.c	(revision 14589)
+++ /trunk/Ohana/src/kapa2/src/InterpretPresses.c	(revision 14590)
@@ -3,9 +3,8 @@
 int InterpretPresses (Graphic *graphic, XButtonEvent *event) {
 
-  int              sock, DX, DY, status, done, this_button, old_cursor;
-  char             name[16], line[40];
+  int              sock, DX, DY, status, done, this_button;
+  char             name[16];
   double           X, Y, Z, R, D;
   float           *imdata;
-  KeySym           keysym;
   Button          *button;
   Section         *section;
Index: /trunk/Ohana/src/kapa2/src/JPEGit24.c
===================================================================
--- /trunk/Ohana/src/kapa2/src/JPEGit24.c	(revision 14589)
+++ /trunk/Ohana/src/kapa2/src/JPEGit24.c	(revision 14590)
@@ -33,5 +33,5 @@
   int dropback;  /* this is a bit of a kludge... */
   int dx, dy, DX, DY, pixelN;
-  int status, Nbytes, quality;
+  int quality;
   int expand_in, expand_out;
   double expand, Rx, Ry, X, Y;
Index: /trunk/Ohana/src/kapa2/src/LoadFrame.c
===================================================================
--- /trunk/Ohana/src/kapa2/src/LoadFrame.c	(revision 14589)
+++ /trunk/Ohana/src/kapa2/src/LoadFrame.c	(revision 14590)
@@ -3,5 +3,5 @@
 int LoadFrame (int sock) {
   
-  int i, status;
+  int i;
   char Axis[16], Labels[16], Ticks[16];
   Section *section;
Index: /trunk/Ohana/src/kapa2/src/LoadObject.c
===================================================================
--- /trunk/Ohana/src/kapa2/src/LoadObject.c	(revision 14589)
+++ /trunk/Ohana/src/kapa2/src/LoadObject.c	(revision 14590)
@@ -123,5 +123,5 @@
   }
   if (Nbytes_send != Npts_send*sizeof(float)) {
-    fprintf (stderr, "Kapa Communication error: unexpected data size %d vs %d\n", Nbytes_send, Npts_send*sizeof(float));
+    fprintf (stderr, "Kapa Communication error: unexpected data size %d vs %ld\n", Nbytes_send, Npts_send*sizeof(float));
   }
 
Index: /trunk/Ohana/src/kapa2/src/LoadOverlay.c
===================================================================
--- /trunk/Ohana/src/kapa2/src/LoadOverlay.c	(revision 14589)
+++ /trunk/Ohana/src/kapa2/src/LoadOverlay.c	(revision 14590)
@@ -4,5 +4,5 @@
   
   int i, j, Ntotal, Nbytes, Nread, Nfound, Ntext, Nobjects, overnum;
-  int Noverlay, NOVERLAY, Ntextdata;
+  int Noverlay, Ntextdata;
   char *textdata, *buffer, *p, *q;
   Section *section;
Index: /trunk/Ohana/src/kapa2/src/SetImageData.c
===================================================================
--- /trunk/Ohana/src/kapa2/src/SetImageData.c	(revision 14589)
+++ /trunk/Ohana/src/kapa2/src/SetImageData.c	(revision 14590)
@@ -3,6 +3,4 @@
 int SetImageData (int sock) {
   
-  int i;
-  double xmin, xmax, ymin, ymax;
   Graphic *graphic;
   Section *section;
@@ -55,6 +53,4 @@
 int SetImageCoords (int sock) {
   
-  int i;
-  double xmin, xmax, ymin, ymax;
   Graphic *graphic;
   Section *section;
Index: /trunk/Ohana/src/kapa2/src/SetImageSize.c
===================================================================
--- /trunk/Ohana/src/kapa2/src/SetImageSize.c	(revision 14589)
+++ /trunk/Ohana/src/kapa2/src/SetImageSize.c	(revision 14590)
@@ -7,5 +7,5 @@
 void SetImageSize (Section *section) {
 
-  int Xs, Ys, Xe, Ye, dX, dY;
+  int Xs, Ys, dX, dY;
   int textpad, textdY, WdY; 
   KapaImageWidget *image;
Index: /trunk/Ohana/src/libdvo/src/SavePhotcodesFITS.c
===================================================================
--- /trunk/Ohana/src/libdvo/src/SavePhotcodesFITS.c	(revision 14589)
+++ /trunk/Ohana/src/libdvo/src/SavePhotcodesFITS.c	(revision 14590)
@@ -7,8 +7,5 @@
 
   PhotCodeData *table = NULL;
-  PhotCode *photcode;
   FITS_DB db;
-
-  int i, code, Ncode, Nsec;
 
   table = GetPhotcodeTable ();
Index: /trunk/Ohana/src/libdvo/src/SavePhotcodesText.c
===================================================================
--- /trunk/Ohana/src/libdvo/src/SavePhotcodesText.c	(revision 14589)
+++ /trunk/Ohana/src/libdvo/src/SavePhotcodesText.c	(revision 14590)
@@ -2,5 +2,4 @@
 # define SCALE 0.001
 
-static char *PHOT_PRI_NAME = "pri";
 static char *PHOT_SEC_NAME = "sec";
 static char *PHOT_ALT_NAME = "alt";
@@ -14,5 +13,4 @@
 
   PhotCodeData *table = NULL;
-  PhotCode *photcode;
   struct stat filestat;
   char *type;
@@ -76,5 +74,5 @@
       fprintf (f, " %f,", table[0].code[i].X[j]);
     }
-    fprintf (f, "%f %f ", table[0].code[i].X[j], table[0].code[i].dX);
+    fprintf (f, "%f %d ", table[0].code[i].X[j], table[0].code[i].dX);
     PrintPhotcodeNamebyCode (f, "%5d ", table[0].code[i].equiv);
     fprintf (f, "\n");
Index: /trunk/Ohana/src/libdvo/src/coordops.c
===================================================================
--- /trunk/Ohana/src/libdvo/src/coordops.c	(revision 14589)
+++ /trunk/Ohana/src/libdvo/src/coordops.c	(revision 14590)
@@ -735,5 +735,6 @@
     case PROJ_PAR:
       return PROJ_MODE_PSEUDOCYL;
-    default: PROJ_MODE_NONE;
+    default: 
+      return PROJ_MODE_NONE;
   }
   return PROJ_MODE_NONE;
Index: /trunk/Ohana/src/libdvo/src/dvo_catalog_create.c
===================================================================
--- /trunk/Ohana/src/libdvo/src/dvo_catalog_create.c	(revision 14589)
+++ /trunk/Ohana/src/libdvo/src/dvo_catalog_create.c	(revision 14590)
@@ -97,6 +97,6 @@
 
   /* write creation date in header */
-  str_to_time ("now", &now);
-  line = sec_to_date (now);
+  ohana_str_to_time ("now", &now);
+  line = ohana_sec_to_date (now);
   gfits_modify (&catalog[0].header, "DATE", "%s", 1, line);
   free (line);
Index: /trunk/Ohana/src/libkapa/include/kapa.h
===================================================================
--- /trunk/Ohana/src/libkapa/include/kapa.h	(revision 14589)
+++ /trunk/Ohana/src/libkapa/include/kapa.h	(revision 14590)
@@ -163,4 +163,5 @@
 int KapaSendTextline (int fd, char *string, float x, float y, float angle);
 int KapaSetLimits (int fd, Graphdata *graphmode);
+int KapaGetLimits (int fd, float *dx, float *dy);
 int KapaSetSection (int fd, KapaSection *section);
 int KapaSelectSection (int fd, char *name);
@@ -171,4 +172,5 @@
 int KapaSetImageData (int fd, KapaImageData *graphmode);
 int KapaGetImageData (int fd, KapaImageData *graphmode);
+int KapaSetToolbox (int fd, int location);
 
 /* KapaColors */
Index: /trunk/Ohana/src/libkapa/src/KapaOpen.c
===================================================================
--- /trunk/Ohana/src/libkapa/src/KapaOpen.c	(revision 14589)
+++ /trunk/Ohana/src/libkapa/src/KapaOpen.c	(revision 14590)
@@ -123,5 +123,5 @@
 int KapaDefineValidIP (char *ipstring) {
 
-  int i, NVALID, ip1, ip2, ip3, ip4, test, status;
+  int ip1, ip2, ip3, ip4, test, status;
   char string[80];
 
Index: /trunk/Ohana/src/libkapa/src/KiiOverlay.c
===================================================================
--- /trunk/Ohana/src/libkapa/src/KiiOverlay.c	(revision 14589)
+++ /trunk/Ohana/src/libkapa/src/KiiOverlay.c	(revision 14590)
@@ -131,5 +131,5 @@
   // we could break this into segments if we want to trap an interrupt, but why bother?
   Nchar = write (fd, buffer, Noverlay*sizeof(KiiOverlayBase));
-  fprintf (stderr, "sent %d of %d bytes\n", Nchar, Noverlay*sizeof(KiiOverlayBase));
+  fprintf (stderr, "sent %d of %ld bytes\n", Nchar, Noverlay*sizeof(KiiOverlayBase));
   KiiWaitAnswer (fd, "DONE");
 
Index: /trunk/Ohana/src/libkapa/src/KiiPicture.c
===================================================================
--- /trunk/Ohana/src/libkapa/src/KiiPicture.c	(revision 14589)
+++ /trunk/Ohana/src/libkapa/src/KiiPicture.c	(revision 14590)
@@ -3,9 +3,6 @@
 int KiiNewPicture1D (int fd, KiiImage *image, KapaImageData *data, Coords *coords) {
 
-  int i;
-  int Npix, Ncolors, NNcolors, size;
+  int Npix, Ncolors, size;
   float *in, min, max;
-  char *out, *outbuffer;
-  double a1, a2;
 
   Npix = image[0].Nx*image[0].Ny;
Index: /trunk/Ohana/src/libohana/include/ohana.h
===================================================================
--- /trunk/Ohana/src/libohana/include/ohana.h	(revision 14589)
+++ /trunk/Ohana/src/libohana/include/ohana.h	(revision 14590)
@@ -187,18 +187,18 @@
 enum {TIME_NONE, TIME_DATE, TIME_DAYS, TIME_HOURS, TIME_MINUTES, TIME_SECONDS, TIME_JD, TIME_MJD};
 
-int     chk_time               PROTO((char *line));
-time_t  date_to_sec            PROTO((char *date));
-int     dms_to_ddd             PROTO((double *Value, char *string));
-time_t  jd_to_sec              PROTO((double jd));
-char   *sec_to_date            PROTO((time_t second));
-double  sec_to_jd              PROTO((time_t second));
-int     str_to_dtime           PROTO((char *line, double *second));
-int     str_to_time            PROTO((char *line, time_t *second));
-double  sec_to_mjd             PROTO((time_t second));
-time_t  mjd_to_sec             PROTO((double mjd));
+int     ohana_chk_time         PROTO((char *line));
+time_t  ohana_date_to_sec      PROTO((char *date));
+int     ohana_dms_to_ddd       PROTO((double *Value, char *string));
+time_t  ohana_jd_to_sec        PROTO((double jd));
+time_t  ohana_mjd_to_sec       PROTO((double mjd));
+char   *ohana_sec_to_date      PROTO((time_t second));
+double  ohana_sec_to_jd        PROTO((time_t second));
+int     ohana_str_to_dtime     PROTO((char *line, double *second));
+int     ohana_str_to_time      PROTO((char *line, time_t *second));
+double  ohana_sec_to_mjd       PROTO((time_t second));
 double  ohana_lst              PROTO((double jd, double longitude));
+int     ohana_str_to_radec     PROTO((double *ra, double *dec, char *str1, char *str2));
 
 int     hstgsc_hms_to_deg      PROTO((double *h0, double *h1, double *d0, double *d1, char *string));
-int     str_to_radec           PROTO((double *ra, double *dec, char *str1, char *str2));
 
 /* IO Buffer functions */
Index: /trunk/Ohana/src/libohana/src/time.c
===================================================================
--- /trunk/Ohana/src/libohana/src/time.c	(revision 14589)
+++ /trunk/Ohana/src/libohana/src/time.c	(revision 14590)
@@ -2,5 +2,5 @@
 
 /***** convert [-]00:00:00 to 0.0000 ****/
-int dms_to_ddd (double *Value, char *string) {
+int ohana_dms_to_ddd (double *Value, char *string) {
   
   int valid, neg, status;
@@ -58,10 +58,10 @@
 
 /**********/
-int str_to_radec (double *ra, double *dec, char *str1, char *str2) {
+int ohana_str_to_radec (double *ra, double *dec, char *str1, char *str2) {
 
   double Ra, Dec;
 
   *ra = *dec = 0;
-  switch (dms_to_ddd (&Ra, str1)) {
+  switch (ohana_dms_to_ddd (&Ra, str1)) {
     case 0:
       fprintf (stderr, "syntax error in RA\n");
@@ -73,5 +73,5 @@
       break;
   }
-  switch (dms_to_ddd (&Dec, str2)) {
+  switch (ohana_dms_to_ddd (&Dec, str2)) {
     case 0:
       fprintf (stderr, "syntax error in DEC\n");
@@ -87,5 +87,5 @@
 
 /**********/
-int chk_time (char *line) {
+int ohana_chk_time (char *line) {
 
   char *p1, *p2;
@@ -120,5 +120,5 @@
 
 /**********/
-int str_to_time (char *line, time_t *second) {
+int ohana_str_to_time (char *line, time_t *second) {
   
   char *tmpline;
@@ -141,5 +141,5 @@
       gmt   = gmtime (&tsec);
       sprintf (tmpline, "%04d/%02d/%02d,%s", 1900 + gmt[0].tm_year, gmt[0].tm_mon+1, gmt[0].tm_mday, &line[6]);
-      *second = date_to_sec (tmpline);
+      *second = ohana_date_to_sec (tmpline);
       free (tmpline);
       return (TRUE);
@@ -150,9 +150,9 @@
   }
     
-  switch (chk_time (line)) {
+  switch (ohana_chk_time (line)) {
     case 0:
       return (FALSE);
     case TIME_DATE:
-      *second = date_to_sec (line);
+      *second = ohana_date_to_sec (line);
       return (TRUE);
     case TIME_DAYS:
@@ -170,9 +170,9 @@
     case TIME_JD:
       jd = strtod (line, 0);
-      *second = jd_to_sec (jd);
+      *second = ohana_jd_to_sec (jd);
       return (TRUE);
     case TIME_MJD:
       jd = strtod (line, 0);
-      *second = mjd_to_sec (jd);
+      *second = ohana_mjd_to_sec (jd);
       return (TRUE);
   }
@@ -182,7 +182,7 @@
 
 /**********/
-int str_to_dtime (char *line, double *second) {
-  
-  switch (chk_time (line)) {
+int ohana_str_to_dtime (char *line, double *second) {
+  
+  switch (ohana_chk_time (line)) {
     case 0:
     case TIME_JD:
@@ -207,5 +207,5 @@
 
 /**********/
-double sec_to_jd (time_t second) {
+double ohana_sec_to_jd (time_t second) {
 
   double jd;
@@ -216,5 +216,5 @@
 
 /**********/
-time_t jd_to_sec (double jd) {
+time_t ohana_jd_to_sec (double jd) {
 
   time_t second;
@@ -225,5 +225,5 @@
 
 /**********/
-double sec_to_mjd (time_t second) {
+double ohana_sec_to_mjd (time_t second) {
 
   double mjd;
@@ -234,5 +234,5 @@
 
 /**********/
-time_t mjd_to_sec (double mjd) {
+time_t ohana_mjd_to_sec (double mjd) {
 
   time_t second;
@@ -243,5 +243,5 @@
 
 /**********/
-char *sec_to_date (time_t second) {
+char *ohana_sec_to_date (time_t second) {
   
   struct tm *gmt;
@@ -256,5 +256,5 @@
 
 /***** date in format yyyy/mm/dd,hh:mm:ss *****/
-time_t date_to_sec (char *date) {
+time_t ohana_date_to_sec (char *date) {
   
   time_t second;
Index: /trunk/Ohana/src/misc/src/mkfringetable.c
===================================================================
--- /trunk/Ohana/src/misc/src/mkfringetable.c	(revision 14589)
+++ /trunk/Ohana/src/misc/src/mkfringetable.c	(revision 14590)
@@ -2,5 +2,5 @@
 # include <gfitsio.h>
 
-static char *version = "mkfringetable $Revision: 1.8 $";
+static char *version = "mkfringetable $Revision: 1.9 $";
 
 void get_version (int argc, char **argv, char *version);
@@ -73,5 +73,5 @@
     struct timeval now;
     gettimeofday (&now, (struct timezone *) NULL);
-    datestr = sec_to_date (now.tv_sec);
+    datestr = ohana_sec_to_date (now.tv_sec);
   }
 
Index: /trunk/Ohana/src/nightd/src/ConfigInit.c
===================================================================
--- /trunk/Ohana/src/nightd/src/ConfigInit.c	(revision 14589)
+++ /trunk/Ohana/src/nightd/src/ConfigInit.c	(revision 14590)
@@ -88,5 +88,5 @@
     
   ScanConfig (config, "NIGHT_START",            "%s", 0, line);
-  if (!dms_to_ddd (&tmp, line)) { 
+  if (!ohana_dms_to_ddd (&tmp, line)) { 
     fprintf (LogFile, "format error in NIGHT_START\n");
     exit (2);
@@ -99,5 +99,5 @@
   }
   ScanConfig (config, "NIGHT_STOP",             "%s", 0, line);
-  if (!dms_to_ddd (&tmp, line)) { 
+  if (!ohana_dms_to_ddd (&tmp, line)) { 
     fprintf (LogFile, "format error in NIGHT_STOP\n");
     exit (2);
Index: /trunk/Ohana/src/nightd/src/misc.c
===================================================================
--- /trunk/Ohana/src/nightd/src/misc.c	(revision 14589)
+++ /trunk/Ohana/src/nightd/src/misc.c	(revision 14590)
@@ -7,60 +7,4 @@
 
 char **getargs (char *);
-
-/***** convert [-]00:00:00 to 0.0000 ****/
-int dms_to_ddd (double *Value, char *string) {
-  
-  int valid, neg, status;
-  double tmp, value;
-  char *p1, *p2, *px;
-
-  valid = FALSE; 
-  neg = FALSE;
-  stripwhite (string);
-  p1 = string;
-  px = string + strlen(string);
-
-  if (string[0] == '-') { 
-    valid = TRUE; 
-    neg = TRUE;
-    p1 = &string[1];
-  }
-  if (string[0] == '+') { 
-    valid = TRUE; 
-    neg = FALSE;
-    p1 = &string[1];
-  }
-  if (isdigit(string[0])) { 
-    valid = TRUE;
-    p1 = &string[0];
-  }
-  if (!valid) { return (FALSE); }
-
-  status = 1;
-  tmp = strtod (p1, &p2);
-  if (p2 == p1) return (FALSE); /* entry not a number: +fred */
-  value = tmp;
-  if (p2 == px) goto escape;    /* entry only number: +1.0 */ 
-  p1 = p2 + 1;
-
-  tmp = strtod (p1, &p2);
-  if (p2 == p1) goto escape;    /* entry not a number: +1:fred */
-  status = 2;
-  value += tmp / 60.0;
-  if (p2 == px) goto escape;    /* entry only number: +1:1 */
-  p1 = p2 + 1;
-
-  tmp = strtod (p1, &p2);
-  if (p2 == p1) goto escape;    /* entry not a number: +1:1:fred */
-  value += tmp / 3600.0;
-
- escape:
-  if (neg) {
-    value *= -1;
-  }
-  *Value = value;
-
-  return (status);
-}
 
 /* SetPID is always called outside of daemon loop, send errors to stderr */
Index: /trunk/Ohana/src/opihi/cmd.astro/ctimes.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.astro/ctimes.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/cmd.astro/ctimes.c	(revision 14590)
@@ -29,5 +29,5 @@
     value = atof (argv[2]);
     time = TimeRef (value, TimeReference, TimeFormat);
-    date = sec_to_date (time);
+    date = ohana_sec_to_date (time);
     
     if (Variable != (char *) NULL) {
@@ -48,5 +48,5 @@
     }
 
-    if (!str_to_time (argv[2], &time)) { 
+    if (!ohana_str_to_time (argv[2], &time)) { 
       gprint (GP_ERR, "syntax error\n");
       return (FALSE);
Index: /trunk/Ohana/src/opihi/cmd.astro/getlst.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.astro/getlst.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/cmd.astro/getlst.c	(revision 14590)
@@ -16,5 +16,5 @@
   if (argc != 3) goto syntax;
 
-  if (!str_to_time (argv[1], &time)) {
+  if (!ohana_str_to_time (argv[1], &time)) {
       if (Variable != NULL) free (Variable);
       return (FALSE);
@@ -23,5 +23,5 @@
   longitude = atof (argv[2]);
 
-  jd = sec_to_jd (time);
+  jd = ohana_sec_to_jd (time);
   fprintf (stderr, "jd: %f\n", jd);
 
Index: /trunk/Ohana/src/opihi/cmd.astro/region.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.astro/region.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/cmd.astro/region.c	(revision 14590)
@@ -58,5 +58,5 @@
   }
   
-  if (!str_to_radec (&Ra, &Dec, argv[1], argv[2])) return (FALSE);
+  if (!ohana_str_to_radec (&Ra, &Dec, argv[1], argv[2])) return (FALSE);
   Radius = atof (argv[3]);
   strcpy (graphmode.coords.ctype, "RA---TAN");
Index: /trunk/Ohana/src/opihi/cmd.astro/sexigesimal.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.astro/sexigesimal.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/cmd.astro/sexigesimal.c	(revision 14590)
@@ -23,5 +23,5 @@
 
   if (HMS) {
-    if (!dms_to_ddd (&value, argv[1])) {
+    if (!ohana_dms_to_ddd (&value, argv[1])) {
       gprint (GP_ERR, "syntax error in input\n");
       return (FALSE);
Index: /trunk/Ohana/src/opihi/cmd.data/close.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/close.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/cmd.data/close.c	(revision 14590)
@@ -3,5 +3,5 @@
 int close_device (int argc, char **argv) {
 
-  int N, kapa, IsImage;
+  int N, kapa;
   char *name;
   /* close current graphics device */
Index: /trunk/Ohana/src/opihi/cmd.data/dbconnect.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/dbconnect.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/cmd.data/dbconnect.c	(revision 14590)
@@ -8,11 +8,7 @@
 int dbconnect (int argc, char **argv) {
   
-  char c;
-  int i;
-  int Nrows;
   char query[256];
   char password[1024];
   MYSQL_RES *result;
-  MYSQL_ROW row;
 
   if (argc != 4) {
@@ -25,4 +21,7 @@
 
 # if (0)
+  int i;
+  char c;
+
   initscr();
   noecho();
@@ -65,4 +64,7 @@
     
 # if (0)
+  int Nrows;
+  MYSQL_ROW row;
+
   sprintf (query, "select @@interactive_timeout");
   if (mysql_query (connection, query)) {
Index: /trunk/Ohana/src/opihi/cmd.data/device.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/device.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/cmd.data/device.c	(revision 14590)
@@ -3,5 +3,5 @@
 int device (int argc, char **argv) {
 
-  int N, kapa, IsImage;
+  int N, kapa;
   char *name;;
   /* set / get current graphics device */
@@ -18,5 +18,5 @@
     if (name == NULL) {
       gprint (GP_ERR, "no device defined\n");
-      return (NULL);
+      return (FALSE);
     }
   } else {
Index: /trunk/Ohana/src/opihi/cmd.data/jpeg.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/jpeg.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/cmd.data/jpeg.c	(revision 14590)
@@ -4,5 +4,5 @@
 
   char filename[1024];
-  int N, kapa, IsImage, IsPNG, IsPPM;
+  int N, kapa, IsPNG, IsPPM;
   char *name;
   
Index: /trunk/Ohana/src/opihi/cmd.data/ps.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/ps.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/cmd.data/ps.c	(revision 14590)
@@ -4,5 +4,5 @@
 
   char filename[1024], pagename[1024], *name;
-  int N, kapa, scaleMode, pageMode, IsImage;
+  int N, kapa, scaleMode, pageMode;
   
   if ((N = get_argument (argc, argv, "--help"))) goto help;
Index: /trunk/Ohana/src/opihi/cmd.data/zplot.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/zplot.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/cmd.data/zplot.c	(revision 14590)
@@ -3,5 +3,5 @@
 int zplot (int argc, char **argv) {
   
-  int i, kapa, N, Npts;
+  int i, kapa, Npts;
   float *in, *out;
   double min, range;
Index: /trunk/Ohana/src/opihi/dimm/Telescope.c
===================================================================
--- /trunk/Ohana/src/opihi/dimm/Telescope.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/dimm/Telescope.c	(revision 14590)
@@ -37,5 +37,5 @@
   if (!status) return (FALSE);
 
-  status = str_to_radec (r, d, rastr, decstr);
+  status = ohana_str_to_radec (r, d, rastr, decstr);
   if (!status) return (FALSE);
 
@@ -207,9 +207,9 @@
 
   SerialCommand (":GA#", &answer, SER_TIMEOUT);
-  dms_to_ddd (x, answer);
+  ohana_dms_to_ddd (x, answer);
   free (answer);
 
   SerialCommand (":GZ#", &answer, SER_TIMEOUT);
-  dms_to_ddd (y, answer);
+  ohana_dms_to_ddd (y, answer);
   free (answer);
 
@@ -312,15 +312,15 @@
   /* : get latitude */
   SerialCommand (":Gt#", &answer, SER_TIMEOUT);
-  dms_to_ddd (lat, answer);
+  ohana_dms_to_ddd (lat, answer);
   free (answer);
 
   /* : get longitude */
   SerialCommand (":Gg#", &answer, SER_TIMEOUT);
-  dms_to_ddd (lon, answer);
+  ohana_dms_to_ddd (lon, answer);
   free (answer);
 
   /* : get LST */
   SerialCommand (":GS#", &answer, SER_TIMEOUT);
-  dms_to_ddd (lst, answer);
+  ohana_dms_to_ddd (lst, answer);
   free (answer);
 
Index: /trunk/Ohana/src/opihi/dvo/ImageOps.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/ImageOps.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/dvo/ImageOps.c	(revision 14590)
@@ -27,5 +27,10 @@
 
   if (selection->useSkyregion) {
-    get_skyregion (&patch.Rmin, &patch.Rmax, &patch.Dmin, &patch.Dmax);
+    double Rs, Re, Ds, De;
+    get_skyregion (&Rs, &Re, &Ds, &De);
+    patch.Rmin = Rs;
+    patch.Rmax = Re;
+    patch.Dmin = Ds;
+    patch.Dmax = De;
     Rmin = patch.Rmin - 182.0;
     Rmax = patch.Rmax + 182.0;
Index: /trunk/Ohana/src/opihi/dvo/ImageSelection.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/ImageSelection.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/dvo/ImageSelection.c	(revision 14590)
@@ -11,5 +11,4 @@
 int SetImageSelection (int mosaicMode, SkyRegionSelection *selection) {
 
-  int Ngraph;
   int TimeSelect;
   time_t tzero, tend;
Index: /trunk/Ohana/src/opihi/dvo/avextract.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/avextract.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/dvo/avextract.c	(revision 14590)
@@ -5,5 +5,4 @@
   int i, j, n, m, N, Npts, NPTS, last, Nfields, Nreturn, Ncstack, Nstack;
   int Nsecfilt, mode, VERBOSE;
-  char *p;
   char **cstack, name[1024];
   float *values;
@@ -135,8 +134,4 @@
   return (TRUE);
 
- usage:
-  gprint (GP_ERR, "USAGE: avextract (value) [options]\n");
-  gprint (GP_ERR, "  value: average.parameter or photcode\n");
-
  escape:
   dbFreeFields (fields, Nfields);
Index: /trunk/Ohana/src/opihi/dvo/calextract.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/calextract.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/dvo/calextract.c	(revision 14590)
@@ -5,7 +5,6 @@
 int calextract (int argc, char **argv) {
   
-  int i, j, m, N, Nr, mode[2];
+  int i, N, Nr, mode[2];
   int Nsecfilt, NSTAR;
-  double M1, M2, dM2, color;
 
   PhotCode *code[2];
Index: /trunk/Ohana/src/opihi/dvo/calmextract.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/calmextract.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/dvo/calmextract.c	(revision 14590)
@@ -6,7 +6,6 @@
 int calmextract (int argc, char **argv) {
   
-  int i, j, k, m, N, N1, Nr, mode[2];
+  int i, k, N, Nr, mode[2];
   int NSTAR, Nstar, Nsecfilt;
-  double *M1, M2, dM2, color;
 
   Catalog catalog;
Index: /trunk/Ohana/src/opihi/dvo/dbCmdlineFields.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/dbCmdlineFields.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/dvo/dbCmdlineFields.c	(revision 14590)
@@ -4,5 +4,5 @@
 dbField *dbCmdlineFields (int argc, char **argv, int table, int *last, int *nfields) {
 
-  int i, j, status, Nfields, NFIELDS;
+  int i, status, Nfields, NFIELDS;
   char *p, *q, *field;
   dbField *fields;
Index: /trunk/Ohana/src/opihi/dvo/dbExtractMeasures.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/dbExtractMeasures.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/dvo/dbExtractMeasures.c	(revision 14590)
@@ -12,5 +12,5 @@
 double dbExtractMeasures (Average *average, SecFilt *secfilt, Measure *measure, dbField *field) {
 
-  int i, Nsec;
+  int Nsec;
   double value;
   double ra, dec, x, y;
@@ -116,18 +116,7 @@
       value = average[0].Nn;
       break;
-    case MEAS_NPHOT: /* OK */
-      Nsec = f(measure[0].photcode);
-      value = secfilt[Nsec].Nused;
-      break;
-    case MEAS_NCODE: /* OK */
-      Nsec = f(measure[0].photcode);
-      value = secfilt[Nsec].Ncode;
-      break;
     case MEAS_OBJFLAGS: /* OK */
       value = average[0].code;
       break;
-//    case MEAS_dMAG: /* OK */
-//      value = measure[0].dM;
-//      break;
     // note that these represent the ra displacement relative to the average, not 
     // the error.
Index: /trunk/Ohana/src/opihi/dvo/dbFields.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/dbFields.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/dvo/dbFields.c	(revision 14590)
@@ -122,6 +122,4 @@
   if (!strcasecmp (fieldName, "nmeas"))    ESCAPE (MEAS_NMEAS,       	MAG_NONE);
   if (!strcasecmp (fieldName, "nmiss"))    ESCAPE (MEAS_NMISS,       	MAG_NONE);
-  if (!strcasecmp (fieldName, "nphot"))    ESCAPE (MEAS_NPHOT,       	MAG_NONE);
-  if (!strcasecmp (fieldName, "ncode"))    ESCAPE (MEAS_NCODE,       	MAG_NONE);
   if (!strcasecmp (fieldName, "objflags")) ESCAPE (MEAS_OBJFLAGS,     	MAG_NONE);
   if (!strcasecmp (fieldName, "AIRMASS"))  ESCAPE (MEAS_AIRMASS,     	MAG_NONE);
Index: /trunk/Ohana/src/opihi/dvo/detrend.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/detrend.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/dvo/detrend.c	(revision 14590)
@@ -27,10 +27,10 @@
   if ((N = get_argument (argc, argv, "-time"))) {
     remove_argument (N, &argc, argv);
-    if (!str_to_time (argv[N], &tzero)) { 
-      gprint (GP_ERR, "syntax error\n");
-      return (FALSE);
-    }
-    remove_argument (N, &argc, argv);
-    if (!str_to_dtime (argv[N], &trange)) { 
+    if (!ohana_str_to_time (argv[N], &tzero)) { 
+      gprint (GP_ERR, "syntax error\n");
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+    if (!ohana_str_to_dtime (argv[N], &trange)) { 
       gprint (GP_ERR, "syntax error\n");
       return (FALSE);
@@ -45,10 +45,10 @@
   if ((N = get_argument (argc, argv, "-trange"))) {
     remove_argument (N, &argc, argv);
-    if (!str_to_time (argv[N], &tzero)) { 
-      gprint (GP_ERR, "syntax error\n");
-      return (FALSE);
-    }
-    remove_argument (N, &argc, argv);
-    if (!str_to_time (argv[N], &tend)) { 
+    if (!ohana_str_to_time (argv[N], &tzero)) { 
+      gprint (GP_ERR, "syntax error\n");
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+    if (!ohana_str_to_time (argv[N], &tend)) { 
       gprint (GP_ERR, "syntax error\n");
       return (FALSE);
Index: /trunk/Ohana/src/opihi/dvo/dmt.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/dmt.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/dvo/dmt.c	(revision 14590)
@@ -4,4 +4,10 @@
 int dmt (int argc, char **argv) {
   
+  // XXX this needs to be fixed: how to access different graphs at once?
+  gprint (GP_ERR, "ERROR: this function is currently disabled\n");
+  return (FALSE);
+
+# if (0)
+
   int i, m, k, N, kapa, SaveVectors;
   int Nsec, Nsecfilt, NPTS;
@@ -38,7 +44,4 @@
   }
 
-  // XXX this needs to be fixed: how to access different graphs at once?
-  gprint (GP_ERR, "ERROR: this function is currently disabled\n");
-  return (FALSE);
   if (!GetGraphData (&graphsky, &kapa, NULL)) return (FALSE);
   if (!GetGraph (&graphmode, NULL, NULL)) return (FALSE);
@@ -151,4 +154,4 @@
   }
   return (TRUE);
-
+# endif 
 }
Index: /trunk/Ohana/src/opihi/dvo/gimages.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/gimages.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/dvo/gimages.c	(revision 14590)
@@ -30,10 +30,10 @@
   if ((N = get_argument (argc, argv, "-time"))) {
     remove_argument (N, &argc, argv);
-    if (!str_to_time (argv[N], &tzero)) { 
+    if (!ohana_str_to_time (argv[N], &tzero)) { 
       gprint (GP_ERR, "syntax error\n");
       return (FALSE);
     }
     remove_argument (N, &argc, argv);
-    if (!str_to_dtime (argv[N], &trange)) { 
+    if (!ohana_str_to_dtime (argv[N], &trange)) { 
       gprint (GP_ERR, "syntax error\n");
       return (FALSE);
@@ -50,5 +50,5 @@
     remove_argument (N, &argc, argv);
 
-    if (!str_to_dtime (argv[N], &trange)) { 
+    if (!ohana_str_to_dtime (argv[N], &trange)) { 
       gprint (GP_ERR, "syntax error\n");
       return (FALSE);
@@ -80,5 +80,5 @@
   }
 
-  if (!str_to_radec (&Ra, &Dec, argv[1], argv[2])) return (FALSE);
+  if (!ohana_str_to_radec (&Ra, &Dec, argv[1], argv[2])) return (FALSE);
 
   if ((image = LoadImages (&Nimage)) == NULL) return (FALSE);
@@ -89,5 +89,4 @@
   int TriangleUp   = wordhash ("TRP-");
   int TriangleDn   = wordhash ("TRM-");
-  int TrianglePts  = wordhash ("TRI-");
 
   Nfound = 0;
@@ -149,5 +148,5 @@
 
   got_spot:
-    date = sec_to_date (image[i].tzero);
+    date = ohana_sec_to_date (image[i].tzero);
 
     if (PixelCoords) {
Index: /trunk/Ohana/src/opihi/dvo/gstar.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/gstar.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/dvo/gstar.c	(revision 14590)
@@ -168,5 +168,5 @@
 
 	  if (GetMeasures && !QUIET) {
-	    date = sec_to_date (catalog.measure[m].t);
+	    date = ohana_sec_to_date (catalog.measure[m].t);
 	    gprint (GP_LOG, "%6.3f %6.3f %5.3f  %20s  %5.2f %5.2f %2d %3x %3d %-20s\n", 
 		     Mcat, Mrel, catalog.measure[m].dM,
Index: /trunk/Ohana/src/opihi/dvo/images.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/images.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/dvo/images.c	(revision 14590)
@@ -61,10 +61,10 @@
   if ((N = get_argument (argc, argv, "-time"))) {
     remove_argument (N, &argc, argv);
-    if (!str_to_time (argv[N], &tzero)) { 
-      gprint (GP_ERR, "syntax error\n");
-      return (FALSE);
-    }
-    remove_argument (N, &argc, argv);
-    if (!str_to_dtime (argv[N], &trange)) { 
+    if (!ohana_str_to_time (argv[N], &tzero)) { 
+      gprint (GP_ERR, "syntax error\n");
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+    if (!ohana_str_to_dtime (argv[N], &trange)) { 
       gprint (GP_ERR, "syntax error\n");
       return (FALSE);
@@ -79,10 +79,10 @@
   if ((N = get_argument (argc, argv, "-trange"))) {
     remove_argument (N, &argc, argv);
-    if (!str_to_time (argv[N], &tzero)) { 
-      gprint (GP_ERR, "syntax error\n");
-      return (FALSE);
-    }
-    remove_argument (N, &argc, argv);
-    if (!str_to_time (argv[N], &tend)) { 
+    if (!ohana_str_to_time (argv[N], &tzero)) { 
+      gprint (GP_ERR, "syntax error\n");
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+    if (!ohana_str_to_time (argv[N], &tend)) { 
       gprint (GP_ERR, "syntax error\n");
       return (FALSE);
Index: /trunk/Ohana/src/opihi/dvo/imdata.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/imdata.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/dvo/imdata.c	(revision 14590)
@@ -26,10 +26,10 @@
   if ((N = get_argument (argc, argv, "-time"))) {
     remove_argument (N, &argc, argv);
-    if (!str_to_time (argv[N], &tzero)) { 
+    if (!ohana_str_to_time (argv[N], &tzero)) { 
       gprint (GP_ERR, "syntax error\n");
       return (FALSE);
     }
     remove_argument (N, &argc, argv);
-    if (!str_to_dtime (argv[N], &trange)) { 
+    if (!ohana_str_to_dtime (argv[N], &trange)) { 
       gprint (GP_ERR, "syntax error\n");
       return (FALSE);
Index: /trunk/Ohana/src/opihi/dvo/imextract.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/imextract.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/dvo/imextract.c	(revision 14590)
@@ -6,5 +6,5 @@
   
   int i, j, Nimage, mode, N, PhotcodeSelect;
-  int TimeSelect, RegionSelect, *subset, Nsubset, TimeFormat, FlagSelect, FlagValue;
+  int TimeSelect, *subset, Nsubset, TimeFormat, FlagSelect, FlagValue;
   double x, y, ra, dec, t, trange;
   time_t tzero, TimeReference;
@@ -27,10 +27,10 @@
   if ((N = get_argument (argc, argv, "-time"))) {
     remove_argument (N, &argc, argv);
-    if (!str_to_time (argv[N], &tzero)) { 
+    if (!ohana_str_to_time (argv[N], &tzero)) { 
       gprint (GP_ERR, "syntax error\n");
       return (FALSE);
     }
     remove_argument (N, &argc, argv);
-    if (!str_to_dtime (argv[N], &trange)) { 
+    if (!ohana_str_to_dtime (argv[N], &trange)) { 
       gprint (GP_ERR, "syntax error\n");
       return (FALSE);
Index: /trunk/Ohana/src/opihi/dvo/imlist.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/imlist.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/dvo/imlist.c	(revision 14590)
@@ -21,10 +21,10 @@
   if ((N = get_argument (argc, argv, "-time"))) {
     remove_argument (N, &argc, argv);
-    if (!str_to_time (argv[N], &tzero)) { 
+    if (!ohana_str_to_time (argv[N], &tzero)) { 
       gprint (GP_ERR, "syntax error\n");
       return (FALSE);
     }
     remove_argument (N, &argc, argv);
-    if (!str_to_dtime (argv[N], &trange)) { 
+    if (!ohana_str_to_dtime (argv[N], &trange)) { 
       gprint (GP_ERR, "syntax error\n");
       return (FALSE);
Index: /trunk/Ohana/src/opihi/dvo/imphot.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/imphot.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/dvo/imphot.c	(revision 14590)
@@ -40,9 +40,9 @@
 
   /* load image(s) in time range given */
-  if (!str_to_time (argv[1], &tzero)) { 
+  if (!ohana_str_to_time (argv[1], &tzero)) { 
     gprint (GP_ERR, "syntax error\n");
     return (FALSE);
   }
-  if (!str_to_dtime (argv[2], &trange)) { 
+  if (!ohana_str_to_dtime (argv[2], &trange)) { 
     gprint (GP_ERR, "syntax error\n");
     return (FALSE);
Index: /trunk/Ohana/src/opihi/dvo/imrough.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/imrough.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/dvo/imrough.c	(revision 14590)
@@ -23,10 +23,10 @@
   if ((N = get_argument (argc, argv, "-time"))) {
     remove_argument (N, &argc, argv);
-    if (!str_to_time (argv[N], &tzero)) { 
+    if (!ohana_str_to_time (argv[N], &tzero)) { 
       gprint (GP_ERR, "syntax error\n");
       return (FALSE);
     }
     remove_argument (N, &argc, argv);
-    if (!str_to_dtime (argv[N], &trange)) { 
+    if (!ohana_str_to_dtime (argv[N], &trange)) { 
       gprint (GP_ERR, "syntax error\n");
       return (FALSE);
@@ -41,10 +41,10 @@
   if ((N = get_argument (argc, argv, "-trange"))) {
     remove_argument (N, &argc, argv);
-    if (!str_to_time (argv[N], &tzero)) { 
+    if (!ohana_str_to_time (argv[N], &tzero)) { 
       gprint (GP_ERR, "syntax error\n");
       return (FALSE);
     }
     remove_argument (N, &argc, argv);
-    if (!str_to_time (argv[N], &tend)) { 
+    if (!ohana_str_to_time (argv[N], &tend)) { 
       gprint (GP_ERR, "syntax error\n");
       return (FALSE);
Index: /trunk/Ohana/src/opihi/dvo/imsearch.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/imsearch.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/dvo/imsearch.c	(revision 14590)
@@ -25,10 +25,10 @@
   if ((N = get_argument (argc, argv, "-time"))) {
     remove_argument (N, &argc, argv);
-    if (!str_to_time (argv[N], &tzero)) { 
+    if (!ohana_str_to_time (argv[N], &tzero)) { 
       gprint (GP_ERR, "syntax error\n");
       return (FALSE);
     }
     remove_argument (N, &argc, argv);
-    if (!str_to_dtime (argv[N], &trange)) { 
+    if (!ohana_str_to_dtime (argv[N], &trange)) { 
       gprint (GP_ERR, "syntax error\n");
       return (FALSE);
Index: /trunk/Ohana/src/opihi/dvo/mextract.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/mextract.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/dvo/mextract.c	(revision 14590)
@@ -3,8 +3,6 @@
 int mextract (int argc, char **argv) {
   
-  int i, j, k, m, n, N, N1, Npts, NPTS, last, Nfields, Nreturn, Ncstack, Nstack;
+  int i, j, k, m, n, N, Npts, NPTS, last, Nfields, Nreturn, Ncstack, Nstack;
   int Nsecfilt, VERBOSE, loadImages, mosaicMode;
-  char *p;
-  double *M1;
   char **cstack, name[1024];
   float *values;
@@ -24,4 +22,7 @@
   fields = NULL;
   stack = NULL;
+
+  if ((N = get_argument (argc, argv, "-h"))) goto help;
+  if ((N = get_argument (argc, argv, "--help"))) goto help;
 
   VERBOSE = FALSE;
@@ -159,9 +160,4 @@
   FreeSkyRegionSelection (selection);
   return (TRUE);
-
-usage:
-  gprint (GP_ERR, "USAGE: mextract (value) [options]\n");
-  gprint (GP_ERR, "  value: measure.parameter or photcode\n");
-  return (FALSE);
 
 escape:
Index: /trunk/Ohana/src/opihi/dvo/photometry.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/photometry.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/dvo/photometry.c	(revision 14590)
@@ -443,10 +443,10 @@
   if ((N = get_argument (*argc, argv, "-time"))) {
     remove_argument (N, argc, argv);
-    if (!str_to_time (argv[N], &tzero)) { 
+    if (!ohana_str_to_time (argv[N], &tzero)) { 
       gprint (GP_ERR, "syntax error\n");
       return (FALSE);
     }
     remove_argument (N, argc, argv);
-    if (!str_to_dtime (argv[N], &trange)) { 
+    if (!ohana_str_to_dtime (argv[N], &trange)) { 
       gprint (GP_ERR, "syntax error\n");
       return (FALSE);
Index: /trunk/Ohana/src/opihi/dvo/pmeasure.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/pmeasure.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/dvo/pmeasure.c	(revision 14590)
@@ -127,5 +127,5 @@
 	if ((R < Rmin) || (R > Rmax) || (D < -90.0) || (D > 90.0)) {
 	  char *date;
-	  date = sec_to_date (catalog.measure[m+k].t);
+	  date = ohana_sec_to_date (catalog.measure[m+k].t);
 	  gprint (GP_LOG, "out: %f, %f : %s : (%f, %f) + (%f, %f)\n", R, D, date, catalog.average[i].R, catalog.average[i].D, catalog.measure[m+k].dR/3600.0, catalog.measure[m+k].dD/3600.0);
 	  free (date);
Index: /trunk/Ohana/src/opihi/dvo/skycoverage.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/skycoverage.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/dvo/skycoverage.c	(revision 14590)
@@ -24,10 +24,10 @@
   if ((N = get_argument (argc, argv, "-time"))) {
     remove_argument (N, &argc, argv);
-    if (!str_to_time (argv[N], &tzero)) { 
+    if (!ohana_str_to_time (argv[N], &tzero)) { 
       gprint (GP_ERR, "syntax error\n");
       return (FALSE);
     }
     remove_argument (N, &argc, argv);
-    if (!str_to_dtime (argv[N], &trange)) { 
+    if (!ohana_str_to_dtime (argv[N], &trange)) { 
       gprint (GP_ERR, "syntax error\n");
       return (FALSE);
@@ -42,10 +42,10 @@
   if ((N = get_argument (argc, argv, "-trange"))) {
     remove_argument (N, &argc, argv);
-    if (!str_to_time (argv[N], &tzero)) { 
+    if (!ohana_str_to_time (argv[N], &tzero)) { 
       gprint (GP_ERR, "syntax error\n");
       return (FALSE);
     }
     remove_argument (N, &argc, argv);
-    if (!str_to_time (argv[N], &tend)) { 
+    if (!ohana_str_to_time (argv[N], &tend)) { 
       gprint (GP_ERR, "syntax error\n");
       return (FALSE);
Index: /trunk/Ohana/src/opihi/dvo/subpix.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/subpix.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/dvo/subpix.c	(revision 14590)
@@ -28,5 +28,5 @@
     return (FALSE);
   }
-  if (!str_to_radec (&Ra, &Dec, argv[1], argv[2])) return (FALSE);
+  if (!ohana_str_to_radec (&Ra, &Dec, argv[1], argv[2])) return (FALSE);
   if (Ra < 0) Ra += 360.0;
   if (Ra > 360.0) Ra -= 360.0;
Index: /trunk/Ohana/src/opihi/include/convert.h
===================================================================
--- /trunk/Ohana/src/opihi/include/convert.h	(revision 14589)
+++ /trunk/Ohana/src/opihi/include/convert.h	(revision 14590)
@@ -15,6 +15,6 @@
 int           day_to_sec            PROTO((char *string, time_t *second));
 int           hms_to_sec            PROTO((char *string, time_t *second));
-char         *sec_to_hms            PROTO((time_t second));
-char         *sec_to_day            PROTO((time_t second));
+char         *ohana_sec_to_hms      PROTO((time_t second));
+char         *ohana_sec_to_day      PROTO((time_t second));
 
 char         *meade_deg_to_str      PROTO((double deg));
Index: /trunk/Ohana/src/opihi/include/dvoshell.h
===================================================================
--- /trunk/Ohana/src/opihi/include/dvoshell.h	(revision 14589)
+++ /trunk/Ohana/src/opihi/include/dvoshell.h	(revision 14590)
@@ -42,6 +42,4 @@
       MEAS_NMEAS, 
       MEAS_NMISS, 
-      MEAS_NPHOT, 
-      MEAS_NCODE, 
       MEAS_OBJFLAGS, 
       MEAS_MAG, 
@@ -170,5 +168,4 @@
 Image        *LoadImages            PROTO((int *Nimage));
 Image        *MatchImage            PROTO((unsigned int time, short int source));
-Image        *MatchImage            PROTO((unsigned int time, short int source));
 Coords       *MatchMosaic           PROTO((unsigned int time, short int source));
 int           Quality               PROTO((Measure *measure, int IsDophot));
@@ -227,3 +224,10 @@
 char        *strfloat               PROTO((float value));
 
+int get_skyregion (double *Rs, double *Re, double *Ds, double *De);
+int set_skyregion (double Rs, double Re, double Ds, double De);
+void FreeImageSelection ();
+
+void FreeSkyRegionSelection (SkyRegionSelection *selection);
+int wordhash (char *word);
+
 # endif
Index: /trunk/Ohana/src/opihi/include/imfit.h
===================================================================
--- /trunk/Ohana/src/opihi/include/imfit.h	(revision 14589)
+++ /trunk/Ohana/src/opihi/include/imfit.h	(revision 14590)
@@ -14,7 +14,7 @@
 void sgauss_setup (char *name);
 void qgauss_setup (char *name);
-void Pgauss_setup (char *name);
-void Sgauss_setup (char *name);
-void Qgauss_setup (char *name);
 void qfgauss_setup (char *name);
 void qrgauss_setup (char *name);
+void pgauss_psf_setup (char *name);
+void qgauss_psf_setup (char *name);
+void sgauss_psf_setup (char *name);
Index: /trunk/Ohana/src/opihi/include/pcontrol.h
===================================================================
--- /trunk/Ohana/src/opihi/include/pcontrol.h	(revision 14589)
+++ /trunk/Ohana/src/opihi/include/pcontrol.h	(revision 14590)
@@ -216,4 +216,6 @@
 void   LinkJobAndHost (Job *job, Host *host);
 
+void pcontrol_exit (int n);
+
 // Job   *FindJobByID (IDtype JobID, int *StackID);
 // Job   *FindJobInStackByID (int StackID, int ID);
Index: /trunk/Ohana/src/opihi/lib.data/convert.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.data/convert.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/lib.data/convert.c	(revision 14590)
@@ -117,5 +117,5 @@
 
 /***** convert seconds to HH:MM:SS ****/
-char *sec_to_hms (time_t second) {
+char *ohana_sec_to_hms (time_t second) {
   
   struct tm *gmt;
@@ -129,5 +129,5 @@
 
 /***** convert seconds to Day@HH:MM:SS ****/
-char *sec_to_day (time_t second) {
+char *ohana_sec_to_day (time_t second) {
   
   struct tm *gmt;
Index: /trunk/Ohana/src/opihi/lib.data/open_kapa.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.data/open_kapa.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/lib.data/open_kapa.c	(revision 14590)
@@ -190,4 +190,5 @@
   }
   KapaSetGraphData (Socket[Active], data);
+  return (TRUE);
 }
 
@@ -254,4 +255,5 @@
   }
   KapaSetImageData (Socket[Active], data);
+  return (TRUE);
 }
 
Index: /trunk/Ohana/src/opihi/lib.shell/timeformat.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.shell/timeformat.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/lib.shell/timeformat.c	(revision 14590)
@@ -7,5 +7,5 @@
   *TimeReference = 0;
   if ((p = get_variable ("TIMEREF")) != (char *) NULL) {
-    if (!str_to_time (p, TimeReference)) {
+    if (!ohana_str_to_time (p, TimeReference)) {
       gprint (GP_ERR, "error in TIME_REF format\n");
       return (FALSE);
Index: /trunk/Ohana/src/opihi/pantasks/CheckController.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/CheckController.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/pantasks/CheckController.c	(revision 14590)
@@ -89,5 +89,4 @@
   if (VerboseMode()) gprint (GP_ERR, "clear %d crash jobs %f\n", i, TimerElapsed(TRUE)); 
 
- finish:
   FlushIOBuffer (&buffer);
   // status = ControllerCommand ("run", CONTROLLER_PROMPT, &buffer);
Index: /trunk/Ohana/src/opihi/pantasks/TaskOps.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/TaskOps.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/pantasks/TaskOps.c	(revision 14590)
@@ -104,14 +104,14 @@
 	switch (tasks[i][0].ranges[j].type) {
 	  case RANGE_ABS:
-	    start = sec_to_date (tasks[i][0].ranges[j].start);
-	    stop  = sec_to_date (tasks[i][0].ranges[j].stop);
+	    start = ohana_sec_to_date (tasks[i][0].ranges[j].start);
+	    stop  = ohana_sec_to_date (tasks[i][0].ranges[j].stop);
 	    break;
 	  case RANGE_DAY:
-	    start = sec_to_hms (tasks[i][0].ranges[j].start);
-	    stop  = sec_to_hms (tasks[i][0].ranges[j].stop);
+	    start = ohana_sec_to_hms (tasks[i][0].ranges[j].start);
+	    stop  = ohana_sec_to_hms (tasks[i][0].ranges[j].stop);
 	    break;
 	  case RANGE_WEEK:
-	    start = sec_to_day (tasks[i][0].ranges[j].start);
-	    stop  = sec_to_day (tasks[i][0].ranges[j].stop);
+	    start = ohana_sec_to_day (tasks[i][0].ranges[j].start);
+	    stop  = ohana_sec_to_day (tasks[i][0].ranges[j].stop);
 	    break;
 	  default:
@@ -264,14 +264,14 @@
     switch (tasks[i][0].ranges[j].type) {
       case RANGE_ABS:
-	start = sec_to_date (tasks[i][0].ranges[j].start);
-	stop  = sec_to_date (tasks[i][0].ranges[j].stop);
+	start = ohana_sec_to_date (tasks[i][0].ranges[j].start);
+	stop  = ohana_sec_to_date (tasks[i][0].ranges[j].stop);
 	break;
       case RANGE_DAY:
-	start = sec_to_hms (tasks[i][0].ranges[j].start);
-	stop  = sec_to_hms (tasks[i][0].ranges[j].stop);
+	start = ohana_sec_to_hms (tasks[i][0].ranges[j].start);
+	stop  = ohana_sec_to_hms (tasks[i][0].ranges[j].stop);
 	break;
       case RANGE_WEEK:
-	start = sec_to_day (tasks[i][0].ranges[j].start);
-	stop  = sec_to_day (tasks[i][0].ranges[j].stop);
+	start = ohana_sec_to_day (tasks[i][0].ranges[j].start);
+	stop  = ohana_sec_to_day (tasks[i][0].ranges[j].stop);
 	break;
       default:
Index: /trunk/Ohana/src/opihi/pantasks/controller_jobstack.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/controller_jobstack.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/pantasks/controller_jobstack.c	(revision 14590)
@@ -21,5 +21,5 @@
 
   // XXX this has an error?  test this out...
-  sprintf (command, "jobstack", argv[2]);
+  sprintf (command, "jobstack %s", argv[2]);
   InitIOBuffer (&buffer, 0x100);
 
Index: /trunk/Ohana/src/opihi/pantasks/flush.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/flush.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/pantasks/flush.c	(revision 14590)
@@ -2,7 +2,4 @@
 
 int flush_jobs (int argc, char **argv) {
-
-  Job *job;
-  int JobID;
 
   if (argc != 2) goto usage;
Index: /trunk/Ohana/src/opihi/pantasks/task.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/task.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/pantasks/task.c	(revision 14590)
@@ -4,5 +4,5 @@
 int task (int argc, char **argv) {
 
-  int N, hash;
+  int hash;
   int ThisList, status;
   char *input, *outline;
Index: /trunk/Ohana/src/opihi/pantasks/task_trange.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/task_trange.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/pantasks/task_trange.c	(revision 14590)
@@ -69,6 +69,6 @@
   /* this test does not fail sufficiently robustly for invalid inputs */
   /* test for YYYY/MM/DD - both must match */
-  if (str_to_time (argv[1], &range.start)) {
-    if (!str_to_time (argv[2], &range.stop)) {
+  if (ohana_str_to_time (argv[1], &range.start)) {
+    if (!ohana_str_to_time (argv[2], &range.stop)) {
       gprint (GP_ERR, "invalid date/time %s\n", argv[2]);
       goto usage;
Index: /trunk/Ohana/src/opihi/pcontrol/HostOps.c
===================================================================
--- /trunk/Ohana/src/opihi/pcontrol/HostOps.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/pcontrol/HostOps.c	(revision 14590)
@@ -25,4 +25,5 @@
   gprint (GP_ERR, "error: unknown host stack : programming error\n");
   pcontrol_exit (1);
+  return (NULL);
 }
 
@@ -37,4 +38,5 @@
   gprint (GP_ERR, "error: unknown host stack : programming error\n");
   pcontrol_exit (1);
+  return (NULL);
 }
 
Index: /trunk/Ohana/src/opihi/pcontrol/JobOps.c
===================================================================
--- /trunk/Ohana/src/opihi/pcontrol/JobOps.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/pcontrol/JobOps.c	(revision 14590)
@@ -28,4 +28,5 @@
   gprint (GP_ERR, "error: unknown host stack : programming error\n");
   pcontrol_exit (1);
+  return (NULL);
 }
 
@@ -41,4 +42,5 @@
   gprint (GP_ERR, "error: unknown job stack : programming error\n");
   pcontrol_exit (1);
+  return (NULL);
 }
 
Index: /trunk/Ohana/src/opihi/pcontrol/ResetJob.c
===================================================================
--- /trunk/Ohana/src/opihi/pcontrol/ResetJob.c	(revision 14589)
+++ /trunk/Ohana/src/opihi/pcontrol/ResetJob.c	(revision 14590)
@@ -48,4 +48,5 @@
   gprint (GP_ERR, "programming error in GetJobOutput (should not reach here)\n");
   pcontrol_exit (1);
+  return (FALSE);
 }
 
Index: /trunk/Ohana/src/relastro/src/ParFactor.c
===================================================================
--- /trunk/Ohana/src/relastro/src/ParFactor.c	(revision 14589)
+++ /trunk/Ohana/src/relastro/src/ParFactor.c	(revision 14590)
@@ -49,5 +49,5 @@
   /* given a time T in UNIX seconds, determine the solar longitude S */
 
-  jd = sec_to_jd (T);
+  jd = ohana_sec_to_jd (T);
   sun_ecliptic (jd, &L, &B, &E);
 
Index: /trunk/Ohana/src/relastro/src/UpdateObjects.c
===================================================================
--- /trunk/Ohana/src/relastro/src/UpdateObjects.c	(revision 14589)
+++ /trunk/Ohana/src/relastro/src/UpdateObjects.c	(revision 14590)
@@ -62,5 +62,5 @@
 
   // use J2000 as a reference time
-  To = date_to_sec ("2000/01/01");
+  To = ohana_date_to_sec ("2000/01/01");
   Nave = Npar = Npm = 0;
 
Index: /trunk/Ohana/src/relastro/src/args.c
===================================================================
--- /trunk/Ohana/src/relastro/src/args.c	(revision 14589)
+++ /trunk/Ohana/src/relastro/src/args.c	(revision 14590)
@@ -61,11 +61,11 @@
   if ((N = get_argument (argc, argv, "-time"))) {
     remove_argument (N, &argc, argv);
-    if (!str_to_time (argv[N], &TSTART)) { 
+    if (!ohana_str_to_time (argv[N], &TSTART)) { 
       fprintf (stderr, "ERROR: syntax error\n");
       return (FALSE);
     }
     remove_argument (N, &argc, argv);
-    if (!str_to_dtime (argv[N], &trange)) { 
-      if (!str_to_time (argv[N], &TSTOP)) { 
+    if (!ohana_str_to_dtime (argv[N], &trange)) { 
+      if (!ohana_str_to_time (argv[N], &TSTOP)) { 
 	fprintf (stderr, "ERROR: syntax error\n");
 	return (FALSE);
Index: /trunk/Ohana/src/relastro/src/initialize.c
===================================================================
--- /trunk/Ohana/src/relastro/src/initialize.c	(revision 14589)
+++ /trunk/Ohana/src/relastro/src/initialize.c	(revision 14590)
@@ -43,5 +43,5 @@
     fprintf (stderr, "current parameter settings:\n");
     if (TimeSelect) {
-      fprintf (stderr, "TimeSelect: TRUE (%s - %s)\n", sec_to_date (TSTART), sec_to_date (TSTOP));
+      fprintf (stderr, "TimeSelect: TRUE (%s - %s)\n", ohana_sec_to_date (TSTART), ohana_sec_to_date (TSTOP));
     } else {
       fprintf (stderr, "TimeSelect: FALSE\n");
Index: /trunk/Ohana/src/relphot/src/args.c
===================================================================
--- /trunk/Ohana/src/relphot/src/args.c	(revision 14589)
+++ /trunk/Ohana/src/relphot/src/args.c	(revision 14590)
@@ -11,11 +11,11 @@
   if ((N = get_argument (argc, argv, "-time"))) {
     remove_argument (N, &argc, argv);
-    if (!str_to_time (argv[N], &TSTART)) { 
+    if (!ohana_str_to_time (argv[N], &TSTART)) { 
       fprintf (stderr, "ERROR: syntax error\n");
       return (FALSE);
     }
     remove_argument (N, &argc, argv);
-    if (!str_to_dtime (argv[N], &trange)) { 
-      if (!str_to_time (argv[N], &TSTOP)) { 
+    if (!ohana_str_to_dtime (argv[N], &trange)) { 
+      if (!ohana_str_to_time (argv[N], &TSTOP)) { 
 	fprintf (stderr, "ERROR: syntax error\n");
 	return (FALSE);
Index: /trunk/Ohana/src/relphot/src/initialize.c
===================================================================
--- /trunk/Ohana/src/relphot/src/initialize.c	(revision 14589)
+++ /trunk/Ohana/src/relphot/src/initialize.c	(revision 14590)
@@ -30,5 +30,5 @@
     fprintf (stderr, "current parameter settings:\n");
     if (TimeSelect) {
-      fprintf (stderr, "TimeSelect: TRUE (%s - %s)\n", sec_to_date (TSTART), sec_to_date (TSTOP));
+      fprintf (stderr, "TimeSelect: TRUE (%s - %s)\n", ohana_sec_to_date (TSTART), ohana_sec_to_date (TSTOP));
     } else {
       fprintf (stderr, "TimeSelect: FALSE\n");
Index: /trunk/Ohana/src/relphot/src/plotstuff.c
===================================================================
--- /trunk/Ohana/src/relphot/src/plotstuff.c	(revision 14589)
+++ /trunk/Ohana/src/relphot/src/plotstuff.c	(revision 14590)
@@ -81,5 +81,5 @@
 
   float *values;
-  int i, Nbytes;
+  int i;
 
   if (Npts < 1) return;
Index: /trunk/Ohana/src/uniphot/src/args.c
===================================================================
--- /trunk/Ohana/src/uniphot/src/args.c	(revision 14589)
+++ /trunk/Ohana/src/uniphot/src/args.c	(revision 14590)
@@ -9,10 +9,10 @@
   if ((N = get_argument (argc, argv, "-time"))) {
     remove_argument (N, &argc, argv);
-    if (!str_to_time (argv[N], &TSTART)) { 
+    if (!ohana_str_to_time (argv[N], &TSTART)) { 
       fprintf (stderr, "ERROR: syntax error\n");
       exit (1);
     }
     remove_argument (N, &argc, argv);
-    if (!str_to_time (argv[N], &TSTOP)) { 
+    if (!ohana_str_to_time (argv[N], &TSTOP)) { 
       fprintf (stderr, "ERROR: syntax error\n");
       exit (1);
Index: /trunk/Ohana/src/uniphot/src/find_image_tgroups.c
===================================================================
--- /trunk/Ohana/src/uniphot/src/find_image_tgroups.c	(revision 14589)
+++ /trunk/Ohana/src/uniphot/src/find_image_tgroups.c	(revision 14590)
@@ -54,6 +54,6 @@
     group[i].dM = 0;
 
-    start = sec_to_date (tmin[i]);
-    stop = sec_to_date (tmax[i]);
+    start = ohana_sec_to_date (tmin[i]);
+    stop = ohana_sec_to_date (tmax[i]);
     snprintf (group[i].label, 64, "%s - %s", start, stop);
     free (start);
