Index: /trunk/Ohana/Makefile.Common
===================================================================
--- /trunk/Ohana/Makefile.Common	(revision 42388)
+++ /trunk/Ohana/Makefile.Common	(revision 42389)
@@ -84,8 +84,11 @@
 	@echo ""
 
+# USE THIS? -Wl,--allow-multiple-definition
+
 $(LIB)/%.$(ARCH).so:
 	@if [ ! -d $(LIB) ]; then mkdir -p $(LIB); fi
 	rm -f $@
-	gcc -shared -Wl,-soname,$*.so -o $@ $^ -lc
+#	gcc -shared -Wl,-soname,$*.so -o $@ $^ -lc
+	gcc -shared -Wl,-soname,$*.so -o $@ $^ -lc -Wl,--allow-multiple-definition
 	@echo "compiled shared library $*"
 	@echo ""
Index: /trunk/Ohana/Makefile.System.in
===================================================================
--- /trunk/Ohana/Makefile.System.in	(revision 42388)
+++ /trunk/Ohana/Makefile.System.in	(revision 42389)
@@ -17,5 +17,5 @@
 CFLAGS   = @CFLAGS@
 CPPFLAGS = @CPPFLAGS@
-LDFLAGS  = @LDFLAGS@
+LDFLAGS  = @LDFLAGS@ -Wl,--allow-multiple-definition
 DLLTYPE  = @DLLTYPE@
 
Index: /trunk/Ohana/src/addstar/Makefile
===================================================================
--- /trunk/Ohana/src/addstar/Makefile	(revision 42388)
+++ /trunk/Ohana/src/addstar/Makefile	(revision 42389)
@@ -358,4 +358,5 @@
 $(SRC)/loadukirt_uhs_readstars_ugps.$(ARCH).o \
 $(SRC)/loadukirt_uhs_readstars_ulas.$(ARCH).o \
+$(SRC)/loadukirt_uhs_readstars_uhs2022.$(ARCH).o \
 $(SRC)/loadukirt_uhs_table.$(ARCH).o \
 $(SRC)/parse_csv.$(ARCH).o \
Index: /trunk/Ohana/src/addstar/doc/ukirt.gcs.txt
===================================================================
--- /trunk/Ohana/src/addstar/doc/ukirt.gcs.txt	(revision 42389)
+++ /trunk/Ohana/src/addstar/doc/ukirt.gcs.txt	(revision 42389)
@@ -0,0 +1,77 @@
+
+  | UKIRT field name          : DVO measure field
+  1 sourceID                  : extID
+  3 frameSetID		      : imageID (assumes we do not try to go backwards for these photcodes)
+  4 ra			      : R
+  5 dec	  		      : D
+  8 epoch 		      : t 
+ 23 priOrSec		      : primary bit in dbFlags
+ 41 mergedClass		      : photFlags2
+ 42 pStar		      : psfChisq
+ 43 pGalaxy		      : extNsigma
+
+ 46 zHallMag		      : M
+ 47 zHallMagErr		      : dM
+ 50 zAperMag3		      : Map
+ 51 zAperMag3Err	      : dMap
+ 52 zAperMag4		      : Mkron
+ 53 zAperMag4Err	      : dMron
+ 58 zPA			      : posangle
+ 61 zClass		      : psfQF
+ 63 zppErrBits		      : photFlags
+ 64 zSeqNum                   : detID
+
+ 68 yHallMag		      : M
+ 69 yHallMagErr		      : dM
+ 72 yAperMag3		      : Map
+ 73 yAperMag3Err	      : dMap
+ 74 yAperMag4		      : Mkron
+ 75 yAperMag4Err	      : dMron
+ 80 yPA			      : posangle
+ 83 yClass		      : psfQF
+ 85 yppErrBits		      : photFlags
+ 86 ySeqNum                   : detID
+
+ 90 jHallMag		      : M
+ 91 jHallMagErr		      : dM
+ 94 jAperMag3		      : Map
+ 95 jAperMag3Err	      : dMap
+ 96 jAperMag4		      : Mkron
+ 97 jAperMag4Err	      : dMron
+102 jPA			      : posangle
+105 jClass		      : psfQF
+107 jppErrBits		      : photFlags
+108 jSeqNum                   : detID
+
+112 hHallMag		      : M
+113 hHallMagErr		      : dM
+116 hAperMag3		      : Map
+117 hAperMag3Err	      : dMap
+118 hAperMag4		      : Mkron
+119 hAperMag4Err	      : dMron
+124 hPA			      : posangle
+127 hClass		      : psfQF
+129 hppErrBits		      : photFlags
+130 hSeqNum                   : detID
+
+134 k_1HallMag		      : M
+135 k_1HallMagErr	      : dM
+138 k_1AperMag3		      : Map
+139 k_1AperMag3Err	      : dMap
+140 k_1AperMag4		      : Mkron
+141 k_1AperMag4Err	      : dMron
+146 k_1PA		      : posangle
+149 k_1Class		      : psfQF
+151 k_1ppErrBits	      : photFlags
+152 k_1SeqNum                 : detID
+
+156 k_2HallMag		      : M
+157 k_2HallMagErr	      : dM
+160 k_2AperMag3		      : Map
+161 k_2AperMag3Err	      : dMap
+162 k_2AperMag4		      : Mkron
+163 k_2AperMag4Err	      : dMron
+168 k_2PA		      : posangle
+171 k_2Class		      : psfQF
+173 k_2ppErrBits	      : photFlags
+174 k_2SeqNum                 : detID
Index: /trunk/Ohana/src/addstar/doc/ukirt.gps.txt
===================================================================
--- /trunk/Ohana/src/addstar/doc/ukirt.gps.txt	(revision 42389)
+++ /trunk/Ohana/src/addstar/doc/ukirt.gps.txt	(revision 42389)
@@ -0,0 +1,67 @@
+
+  | UKIRT field name          : DVO measure field
+  1 sourceID                  : extID
+  3 frameSetID		      : imageID (assumes we do not try to go backwards for these photcodes)
+  4 ra			      : R
+  5 dec	  		      : D
+  8 epoch 		      : t
+ 23 priOrSec		      : primary bit in dbFlags
+
+ 31 mergedClass		      : psfQFperf or photFlags2
+ 32 pStar		      : psfChisq
+ 33 pGalaxy		      : extNsigma
+
+ 36 jAperMag1		      : M
+ 37 jAperMag1Err	      : dM
+ 38 jAperMag3		      : Map
+ 39 jAperMag3Err	      : dMap
+ 40 jAperMag4		      : Mkron
+ 41 jAperMag4Err	      : dMron
+ 44 jPA			      : posangle
+ 47 jClass		      : psfQF
+ 49 jppErrBits		      : photFlags
+ 50 jSeqNum                   : detID
+
+ 54 hAperMag1		      : M
+ 55 hAperMag1Err	      : dM
+ 56 hAperMag3		      : Map
+ 57 hAperMag3Err	      : dMap
+ 58 hAperMag4		      : Mkron
+ 59 hAperMag4Err	      : dMron
+ 62 hPA			      : posangle
+ 65 hClass		      : psfQF
+ 67 hppErrBits		      : photFlags
+ 68 hSeqNum                   : detID
+
+ 72 k_1AperMag1		      : M
+ 73 k_1AperMag1Err	      : dM
+ 74 k_1AperMag3		      : Map
+ 75 k_1AperMag3Err	      : dMap
+ 76 k_1AperMag4		      : Mkron
+ 77 k_1AperMag4Err	      : dMron
+ 80 k_1PA		      : posangle
+ 83 k_1Class		      : psfQF
+ 85 k_1ppErrBits	      : photFlags
+ 86 k_1SeqNum                 : detID
+
+ 90 k_2AperMag1		      : M
+ 91 k_2AperMag1Err	      : dM
+ 92 k_2AperMag3		      : Map
+ 93 k_2AperMag3Err	      : dMap
+ 94 k_2AperMag4		      : Mkron
+ 95 k_2AperMag4Err	      : dMron
+ 98 k_2PA		      : posangle
+101 k_2Class		      : psfQF
+103 k_2ppErrBits	      : photFlags
+104 k_2SeqNum                 : detID
+
+108 h_2AperMag1		      : M
+109 h_2AperMag1Err	      : dM
+110 h_2AperMag3		      : Map
+111 h_2AperMag3Err	      : dMap
+112 h_2AperMag4		      : Mkron
+113 h_2AperMag4Err	      : dMron
+116 h_2PA		      : posangle
+119 h_2Class		      : psfQF
+121 h_2ppErrBits	      : photFlags
+122 h_2SeqNum                 : detID
Index: /trunk/Ohana/src/addstar/doc/ukirt.las.txt
===================================================================
--- /trunk/Ohana/src/addstar/doc/ukirt.las.txt	(revision 42389)
+++ /trunk/Ohana/src/addstar/doc/ukirt.las.txt	(revision 42389)
@@ -0,0 +1,67 @@
+
+  | UKIRT field name          : DVO measure field
+
+  1 sourceID                  : extID
+  2 frameSetID		      : imageID (assumes we do not try to go backwards for these photcodes)
+  3 ra			      : R
+  4 dec	  		      : D
+  7 epoch 		      : t
+ 22 priOrSec		      : primary bit in dbFlags
+ 36 mergedClass		      : photFlags2
+ 37 pStar		      : psfChisq
+ 38 pGalaxy		      : extNsigma
+
+ 46 yHallMag		      : M
+ 47 yHallMagErr		      : dM
+ 50 yAperMag3		      : Map
+ 51 yAperMag3Err	      : dMap
+ 52 yAperMag4		      : Mkron
+ 53 yAperMag4Err	      : dMron
+ 58 yPA			      : posangle
+ 61 yClass		      : psfQF
+ 63 yppErrBits		      : photFlags
+ 64 ySeqNum                   : detID
+
+ 68 j_1HallMag		      : M
+ 69 j_1HallMagErr	      : dM
+ 72 j_1AperMag3		      : Map
+ 73 j_1AperMag3Err	      : dMap
+ 74 j_1AperMag4		      : Mkron
+ 75 j_1AperMag4Err	      : dMron
+ 80 j_1PA		      : posangle
+ 83 j_1Class		      : psfQF
+ 85 j_1ppErrBits	      : photFlags
+ 86 j_1SeqNum                 : detID
+
+ 90 j_2HallMag		      : M
+ 91 j_2HallMagErr	      : dM
+ 94 j_2AperMag3		      : Map
+ 95 j_2AperMag3Err	      : dMap
+ 96 j_2AperMag4		      : Mkron
+ 97 j_2AperMag4Err	      : dMron
+102 j_2PA		      : posangle
+105 j_2Class		      : psfQF
+107 j_2ppErrBits	      : photFlags
+108 j_2SeqNum                 : detID
+
+112 hHallMag		      : M
+113 hHallMagErr		      : dM
+116 hAperMag3		      : Map
+117 hAperMag3Err	      : dMap
+118 hAperMag4		      : Mkron
+119 hAperMag4Err	      : dMron
+124 hPA			      : posangle
+127 hClass		      : psfQF
+129 hppErrBits		      : photFlags
+130 hSeqNum                   : detID
+
+134 kHallMag		      : M
+135 kHallMagErr	              : dM
+138 kAperMag3		      : Map
+139 kAperMag3Err	      : dMap
+140 kAperMag4		      : Mkron
+141 kAperMag4Err	      : dMron
+146 kPA		              : posangle
+149 kClass		      : psfQF
+151 kppErrBits	              : photFlags
+152 kSeqNum                   : detID
Index: /trunk/Ohana/src/addstar/doc/ukirt.uhs.txt
===================================================================
--- /trunk/Ohana/src/addstar/doc/ukirt.uhs.txt	(revision 42389)
+++ /trunk/Ohana/src/addstar/doc/ukirt.uhs.txt	(revision 42389)
@@ -0,0 +1,22 @@
+
+  N -- field (column) number in CSV file (1 counting)
+  | UKIRT field name          : DVO measure field
+  1 sourceID                  : extID
+  3 frameSetID		      : imageID (assumes we do not try to go backwards for these photcodes)
+  4 ra			      : R
+  5 dec			      : D
+ 14 priOrSec		      : primary bit in dbFlags
+ 16 mergedClass		      : photFlags2
+ 17 pStar		      : psfChisq
+ 18 pGalaxy		      : extNsigma
+
+ 23 jHallMag		      : M
+ 24 jHallMagErr		      : dM
+ 27 jAperMag3		      : Map
+ 28 jAperMag3Err	      : dMap
+ 29 jAperMag4		      : Mkron
+ 30 jAperMag4Err	      : dMron
+ 35 jPA			      : posangle
+ 38 jClass		      : psfQF
+ 40 jppErrBits		      : photFlags
+ 41 jSeqNum                   : detID
Index: /trunk/Ohana/src/addstar/include/WISE.h
===================================================================
--- /trunk/Ohana/src/addstar/include/WISE.h	(revision 42388)
+++ /trunk/Ohana/src/addstar/include/WISE.h	(revision 42389)
@@ -21,4 +21,9 @@
 short WISE_W1, WISE_W2, WISE_W3, WISE_W4;
 
+double  RA_SYS_OFFRAW;
+double  DE_SYS_OFFSET;
+double  uRA_SYS_OFFSET;
+double  uDE_SYS_OFFSET;
+
 enum {MODE_NONE, MODE_CATWISE, MODE_ALLWISE, MODE_ALLSKY, MODE_PRELIM};
 int MODE;
@@ -38,5 +43,5 @@
 int loadwise_star_allsky  (Measure *measure, char *line, int Nmax);
 int loadwise_star_allwise (Measure *measure, char *line, int Nmax);
-int loadwise_star_catwise (Measure *measure, char *line, int Nmax, double Rs, double Ds);
+int loadwise_star_catwise (Average *average, Measure *measure, char *line, int Nmax, WISE_Stars *tstars);
 
 char *nextWISEfield (char *line);
Index: /trunk/Ohana/src/addstar/include/skycells.h
===================================================================
--- /trunk/Ohana/src/addstar/include/skycells.h	(revision 42388)
+++ /trunk/Ohana/src/addstar/include/skycells.h	(revision 42389)
@@ -35,5 +35,5 @@
 
 /* globals which define database info / data sources (KEEP) */
-char   ImageCat[256];
+char   ImageCat[512];
 char   GSCFILE[256];
 char   CATDIR[256];
Index: /trunk/Ohana/src/addstar/include/ukirt_uhs.h
===================================================================
--- /trunk/Ohana/src/addstar/include/ukirt_uhs.h	(revision 42388)
+++ /trunk/Ohana/src/addstar/include/ukirt_uhs.h	(revision 42389)
@@ -1,4 +1,4 @@
 
-typedef enum {UKIRT_MODE_NONE, UKIRT_MODE_UHS, UKIRT_MODE_UGCS, UKIRT_MODE_UGPS, UKIRT_MODE_ULAS} UkirtMode;
+typedef enum {UKIRT_MODE_NONE, UKIRT_MODE_UHS, UKIRT_MODE_UGCS, UKIRT_MODE_UGPS, UKIRT_MODE_ULAS, UKIRT_MODE_UHS2022} UkirtMode;
 
 # define NSTARS_MAX 10000000
@@ -55,4 +55,5 @@
 UKIRT_Stars *loadukirt_uhs_readstars_ulas (FILE *f, char *buffer, int *nstart, AddstarClientOptions *options, int *nstars);
 UKIRT_Stars *loadukirt_uhs_readstars_uhs (FILE *f, char *buffer, int *nstart, AddstarClientOptions *options, int *nstars);
+UKIRT_Stars *loadukirt_uhs_readstars_uhs2022 (FILE *f, char *buffer, int *nstart, AddstarClientOptions *options, int *nstars);
 
 
Index: /trunk/Ohana/src/addstar/src/ConfigInit_skycells.c
===================================================================
--- /trunk/Ohana/src/addstar/src/ConfigInit_skycells.c	(revision 42388)
+++ /trunk/Ohana/src/addstar/src/ConfigInit_skycells.c	(revision 42389)
@@ -6,6 +6,6 @@
 
   char *config, *file;
-  char CatdirPhotcodeFile[256];
-  char MasterPhotcodeFile[256];
+  char CatdirPhotcodeFile[512];
+  char MasterPhotcodeFile[512];
 
   /*** load configuration info ***/
Index: /trunk/Ohana/src/addstar/src/LoadDataPMM.c
===================================================================
--- /trunk/Ohana/src/addstar/src/LoadDataPMM.c	(revision 42388)
+++ /trunk/Ohana/src/addstar/src/LoadDataPMM.c	(revision 42389)
@@ -163,6 +163,5 @@
   if (!PMM_CCD_TABLE) abort ();
 
-  strncpy (fileID, datafile, 7);
-  fileID[7] = 0;
+  strncpy_nowarn (fileID, datafile, 7);
 
   f = fopen (PMM_CCD_TABLE, "r");
@@ -177,24 +176,11 @@
     if (strncmp (fileID, &line[FILE_ID_INDEX], 7)) continue;
     
-    strncpy (date, &line[DATE_INDEX], 9);
-    date[9] = 0;
-
-    strncpy (timestr, &line[TIME_INDEX], 5);
-    timestr[5] = 0;
-
-    strncpy (RA, &line[RA_INDEX], 6);
-    RA[6] = 0;
-
-    strncpy (DEC, &line[DEC_INDEX], 7);
-    DEC[7] = 0;
-
-    strncpy (emulsion, &line[EMULSION_INDEX], 5);
-    emulsion[5] = 0;
-
-    strncpy (filter, &line[FILTER_INDEX], 6);
-    filter[6] = 0;
-
-    strncpy (EXPTIME, &line[EXPTIME_INDEX], 3);
-    EXPTIME[3] = 0;
+    strncpy_nowarn (date, &line[DATE_INDEX], 9);
+    strncpy_nowarn (timestr, &line[TIME_INDEX], 5);
+    strncpy_nowarn (RA, &line[RA_INDEX], 6);
+    strncpy_nowarn (DEC, &line[DEC_INDEX], 7);
+    strncpy_nowarn (emulsion, &line[EMULSION_INDEX], 5);
+    strncpy_nowarn (filter, &line[FILTER_INDEX], 6);
+    strncpy_nowarn (EXPTIME, &line[EXPTIME_INDEX], 3);
 
     image[0].tzero   = pmm_date_to_sec (date, timestr);
@@ -357,15 +343,7 @@
   double h, m, s, ra;
   
-  strncpy (tmp, &RA[0], 2);
-  tmp[2] = 0;
-  h = atof (tmp);
-
-  strncpy (tmp, &RA[2], 2);
-  tmp[2] = 0;
-  m = atof (tmp);
-
-  strncpy (tmp, &RA[4], 2);
-  tmp[2] = 0;
-  s = atof (tmp);
+  strncpy_nowarn (tmp, &RA[0], 2); h = atof (tmp);
+  strncpy_nowarn (tmp, &RA[2], 2); m = atof (tmp);
+  strncpy_nowarn (tmp, &RA[4], 2); s = atof (tmp);
 
   ra = 15.0 * (h + m / 60.0 + s / 3600.0);
@@ -379,15 +357,7 @@
   double d, m, s, dec;
 
-  strncpy (tmp, &DEC[1], 2);
-  tmp[2] = 0;
-  d = atof (tmp);
-
-  strncpy (tmp, &DEC[3], 2);
-  tmp[2] = 0;
-  m = atof (tmp);
-
-  strncpy (tmp, &DEC[5], 2);
-  tmp[2] = 0;
-  s = atof (tmp);
+  strncpy_nowarn (tmp, &DEC[1], 2); d = atof (tmp);
+  strncpy_nowarn (tmp, &DEC[3], 2); m = atof (tmp);
+  strncpy_nowarn (tmp, &DEC[5], 2); s = atof (tmp);
 
   dec = d + m / 60.0 + s / 3600.0;
Index: /trunk/Ohana/src/addstar/src/ReadStarsUKIRT.c
===================================================================
--- /trunk/Ohana/src/addstar/src/ReadStarsUKIRT.c	(revision 42388)
+++ /trunk/Ohana/src/addstar/src/ReadStarsUKIRT.c	(revision 42389)
@@ -66,5 +66,5 @@
   }
 
-  char filter[80];
+  char filter[50];
   if (!gfits_scan (header, "FILTER", "%s", 1, filter)) {
     fprintf (stderr, "missing FILTER\n");
Index: /trunk/Ohana/src/addstar/src/SkyTableFromBSCIndex.c
===================================================================
--- /trunk/Ohana/src/addstar/src/SkyTableFromBSCIndex.c	(revision 42388)
+++ /trunk/Ohana/src/addstar/src/SkyTableFromBSCIndex.c	(revision 42389)
@@ -35,6 +35,5 @@
 
     memset (tycho[i].name, 0, 21);
-    strncpy (tycho[i].name, line, 7);
-    tycho[i].name[7] = 0;
+    strncpy_nowarn (tycho[i].name, line, 7);
   }
   Ntycho = i;
Index: /trunk/Ohana/src/addstar/src/SkyTableFromTychoIndex.c
===================================================================
--- /trunk/Ohana/src/addstar/src/SkyTableFromTychoIndex.c	(revision 42388)
+++ /trunk/Ohana/src/addstar/src/SkyTableFromTychoIndex.c	(revision 42389)
@@ -35,6 +35,5 @@
 
     memset (tycho[i].name, 0, 21);
-    strncpy (tycho[i].name, line, 7);
-    tycho[i].name[7] = 0;
+    strncpy_nowarn (tycho[i].name, line, 7);
   }
   Ntycho = i;
Index: /trunk/Ohana/src/addstar/src/args_loadukirt_uhs.c
===================================================================
--- /trunk/Ohana/src/addstar/src/args_loadukirt_uhs.c	(revision 42388)
+++ /trunk/Ohana/src/addstar/src/args_loadukirt_uhs.c	(revision 42389)
@@ -34,4 +34,9 @@
     UKIRT_MODE = UKIRT_MODE_ULAS;
     UKIRT_NFILTER = 5;
+    remove_argument (N, argc, argv);
+  }
+  if ((N = get_argument (*argc, argv, "-uhs2022"))) {
+    UKIRT_MODE = UKIRT_MODE_UHS2022;
+    UKIRT_NFILTER = 2;
     remove_argument (N, argc, argv);
   }
@@ -152,7 +157,7 @@
 static void help () {
 
-  fprintf (stderr, "USAGE: loadukirt_uhs [options] (file) [-uhs | -ugcs | -ulas | -ugps] [..more files]\n");
+  fprintf (stderr, "USAGE: loadukirt_uhs [options] (file) [-uhs | -ugcs | -ulas | -ugps | -uhs2022] [..more files]\n");
   fprintf (stderr, "  add data from UKIRT CSV file to DVO\n");
-  fprintf (stderr, "  mode is required : -uhs | -ugcs | -ulas | -ugps\n\n");
+  fprintf (stderr, "  mode is required : -uhs | -ugcs | -ulas | -ugps | -uhs2022\n\n");
 
   fprintf (stderr, "  optional flags:\n");
Index: /trunk/Ohana/src/addstar/src/args_loadwise.c
===================================================================
--- /trunk/Ohana/src/addstar/src/args_loadwise.c	(revision 42388)
+++ /trunk/Ohana/src/addstar/src/args_loadwise.c	(revision 42389)
@@ -50,4 +50,32 @@
   if ((N = get_argument (*argc, argv, "-v"))) {
     VERBOSE = TRUE;
+    remove_argument (N, argc, argv);
+  }
+
+  /* accept proper-motion data from reference */
+  ACCEPT_MOTION = FALSE;
+  if ((N = get_argument (*argc, argv, "-accept-motion"))) {
+    ACCEPT_MOTION = TRUE;
+    remove_argument (N, argc, argv);
+  }
+
+  /* accept proper-motion data from reference */
+  RA_SYS_OFFRAW = 0.0;
+  DE_SYS_OFFSET = 0.0;
+  uRA_SYS_OFFSET = 0.0;
+  uDE_SYS_OFFSET = 0.0;
+  if ((N = get_argument (*argc, argv, "-sys-astrom-offsets"))) {
+    if (*argc < N + 5) {
+      fprintf (stderr, "missing args for -sys-astrom-offsets (RA) (DEC) (uRA) (uDEC)\n");
+      exit (2);
+    }
+    remove_argument (N, argc, argv);
+    RA_SYS_OFFRAW = atof(argv[N]);
+    remove_argument (N, argc, argv);
+    DE_SYS_OFFSET = atof(argv[N]);
+    remove_argument (N, argc, argv);
+    uRA_SYS_OFFSET = atof(argv[N]);
+    remove_argument (N, argc, argv);
+    uDE_SYS_OFFSET = atof(argv[N]);
     remove_argument (N, argc, argv);
   }
Index: /trunk/Ohana/src/addstar/src/fakeimage.c
===================================================================
--- /trunk/Ohana/src/addstar/src/fakeimage.c	(revision 42388)
+++ /trunk/Ohana/src/addstar/src/fakeimage.c	(revision 42389)
@@ -7,5 +7,5 @@
   double Rmin, Rmax, Dmin, Dmax;
   double dX, dY, r, d;
-  char chipname[80], chipdata[256], name[80];
+  char chipname[16], chipdata[256], name[117];
   char *config;
   Image *image;
@@ -67,5 +67,5 @@
   for (i = 0; i < Nchips; i++) {
     /* this is the addstar name for the chip in the camera */
-    sprintf (chipname, "CHIP.%03d", i);
+    snprintf (chipname, 16, "CHIP.%03d", i);
     ScanConfig (config, chipname, "%s", 0, chipdata);
 
@@ -74,5 +74,5 @@
 
     /* this is the camera-specific name of a chip */
-    sprintf (name, "%s.%s", rootname, chipname);
+    snprintf (name, 117, "%s.%s", rootname, chipname);
     strcpy (image[i+1].name, name);
 
Index: /trunk/Ohana/src/addstar/src/find_matches_refstars.c
===================================================================
--- /trunk/Ohana/src/addstar/src/find_matches_refstars.c	(revision 42388)
+++ /trunk/Ohana/src/addstar/src/find_matches_refstars.c	(revision 42389)
@@ -224,4 +224,5 @@
 	  tgtcat[0].average[n].P          = srccat->average[N].P;
 	  tgtcat[0].average[n].dP         = srccat->average[N].dP;
+	  tgtcat[0].average[n].Tmean      = srccat->average[N].Tmean;
 	}
 
@@ -305,4 +306,5 @@
       tgtcat[0].average[Nave].P     	   = srccat->average[i].P;
       tgtcat[0].average[Nave].dP    	   = srccat->average[i].dP;
+      tgtcat[0].average[Nave].Tmean    	   = srccat->average[i].Tmean;
     }
 
Index: /trunk/Ohana/src/addstar/src/getusno.c
===================================================================
--- /trunk/Ohana/src/addstar/src/getusno.c	(revision 42388)
+++ /trunk/Ohana/src/addstar/src/getusno.c	(revision 42389)
@@ -10,5 +10,5 @@
   float hours[100];
   int start[100], number[100], *buffer, *buf;
-  char filename[128];
+  char filename[300];
   FILE *f;
   int iRA0, iRA1, iDEC0, iDEC1;
Index: /trunk/Ohana/src/addstar/src/getusnob.c
===================================================================
--- /trunk/Ohana/src/addstar/src/getusnob.c	(revision 42388)
+++ /trunk/Ohana/src/addstar/src/getusnob.c	(revision 42389)
@@ -9,5 +9,5 @@
   float hours[100];
   int start[100], number[100], *buffer, *buf;
-  char filename[128];
+  char filename[300];
   FILE *f;
   double dec;
Index: /trunk/Ohana/src/addstar/src/loadatlas_readstars.c
===================================================================
--- /trunk/Ohana/src/addstar/src/loadatlas_readstars.c	(revision 42388)
+++ /trunk/Ohana/src/addstar/src/loadatlas_readstars.c	(revision 42389)
@@ -242,6 +242,5 @@
 	// why do I need to copy temp here, does gprint modify the value of temp?
 	char temp[32];
-	strncpy (temp, c0, 32);
-	temp[31] = 0;
+	strncpy_nowarn (temp, c0, 31);
 	gprint (GP_ERR, "skip line %s\n\n", temp);
       }
Index: /trunk/Ohana/src/addstar/src/loadgaia_dr2_readstars.c
===================================================================
--- /trunk/Ohana/src/addstar/src/loadgaia_dr2_readstars.c	(revision 42388)
+++ /trunk/Ohana/src/addstar/src/loadgaia_dr2_readstars.c	(revision 42389)
@@ -238,6 +238,5 @@
 	// why do I need to copy temp here, does gprint modify the value of temp?
 	char temp[32];
-	strncpy (temp, c0, 32);
-	temp[31] = 0;
+	strncpy_nowarn (temp, c0, 31);
 	gprint (GP_ERR, "skip line %s\n\n", temp);
       }
Index: /trunk/Ohana/src/addstar/src/loadgaia_edr3_readstars.c
===================================================================
--- /trunk/Ohana/src/addstar/src/loadgaia_edr3_readstars.c	(revision 42388)
+++ /trunk/Ohana/src/addstar/src/loadgaia_edr3_readstars.c	(revision 42389)
@@ -253,6 +253,5 @@
 	// why do I need to copy temp here, does gprint modify the value of temp?
 	char temp[32];
-	strncpy (temp, c0, 32);
-	temp[31] = 0;
+	strncpy_nowarn (temp, c0, 31);
 	gprint (GP_ERR, "skip line %s\n\n", temp);
       }
Index: /trunk/Ohana/src/addstar/src/loadsupercos_ops.c
===================================================================
--- /trunk/Ohana/src/addstar/src/loadsupercos_ops.c	(revision 42388)
+++ /trunk/Ohana/src/addstar/src/loadsupercos_ops.c	(revision 42389)
@@ -38,11 +38,9 @@
 
   Nchar = p2 - p1 - 1;
-  strncpy (emulsion, p1, Nchar);
-  emulsion[Nchar] = 0;
+  strncpy_nowarn (emulsion, p1, Nchar);
   stripwhite (emulsion);
 	
   Nchar = p3 - p2 - 1;
-  strncpy (filterID, p2, Nchar);
-  filterID[Nchar] = 0;
+  strncpy_nowarn (filterID, p2, Nchar);
   stripwhite (filterID);
 	
@@ -69,6 +67,6 @@
 
   char hour[3], minute[3];
-  strncpy(hour, p1, 2); hour[2] = 0;
-  strncpy(minute, p1+2, 2); minute[2] = 0;
+  strncpy_nowarn(hour, p1, 2);
+  strncpy_nowarn(minute, p1+2, 2);
 
   double minuteF = atof (minute);
Index: /trunk/Ohana/src/addstar/src/loadsupercos_plates.c
===================================================================
--- /trunk/Ohana/src/addstar/src/loadsupercos_plates.c	(revision 42388)
+++ /trunk/Ohana/src/addstar/src/loadsupercos_plates.c	(revision 42389)
@@ -77,6 +77,6 @@
     image[Nimage].dMcal     = 0.0;
 
-    char photname[128];
-    snprintf (photname, 128, "SCOS.%s.%s", emulsion, filterID);
+    char photname[300];
+    snprintf (photname, 300, "SCOS.%s.%s", emulsion, filterID);
     image[Nimage].photcode = GetPhotcodeCodebyName (photname);
     if (!image[Nimage].photcode) {
Index: /trunk/Ohana/src/addstar/src/loadukirt_uhs_readstars.c
===================================================================
--- /trunk/Ohana/src/addstar/src/loadukirt_uhs_readstars.c	(revision 42388)
+++ /trunk/Ohana/src/addstar/src/loadukirt_uhs_readstars.c	(revision 42389)
@@ -22,4 +22,9 @@
     case UKIRT_MODE_ULAS: {
       UKIRT_Stars *stars = loadukirt_uhs_readstars_ulas (f, buffer, nstart, options, nstars);
+      return stars;
+    }
+      
+    case UKIRT_MODE_UHS2022: {
+      UKIRT_Stars *stars = loadukirt_uhs_readstars_uhs2022 (f, buffer, nstart, options, nstars);
       return stars;
     }
Index: /trunk/Ohana/src/addstar/src/loadukirt_uhs_readstars_ugcs.c
===================================================================
--- /trunk/Ohana/src/addstar/src/loadukirt_uhs_readstars_ugcs.c	(revision 42388)
+++ /trunk/Ohana/src/addstar/src/loadukirt_uhs_readstars_ugcs.c	(revision 42389)
@@ -458,6 +458,5 @@
 	// why do I need to copy temp here, does gprint modify the value of temp?
 	char temp[32];
-	strncpy (temp, c0, 32);
-	temp[31] = 0;
+	strncpy_nowarn (temp, c0, 31);
 	gprint (GP_ERR, "skip line %s\n\n", temp);
       }
Index: /trunk/Ohana/src/addstar/src/loadukirt_uhs_readstars_ugps.c
===================================================================
--- /trunk/Ohana/src/addstar/src/loadukirt_uhs_readstars_ugps.c	(revision 42388)
+++ /trunk/Ohana/src/addstar/src/loadukirt_uhs_readstars_ugps.c	(revision 42389)
@@ -379,6 +379,5 @@
 	// why do I need to copy temp here, does gprint modify the value of temp?
 	char temp[32];
-	strncpy (temp, c0, 32);
-	temp[31] = 0;
+	strncpy_nowarn (temp, c0, 31);
 	gprint (GP_ERR, "skip line %s\n\n", temp);
       }
Index: /trunk/Ohana/src/addstar/src/loadukirt_uhs_readstars_uhs.c
===================================================================
--- /trunk/Ohana/src/addstar/src/loadukirt_uhs_readstars_uhs.c	(revision 42388)
+++ /trunk/Ohana/src/addstar/src/loadukirt_uhs_readstars_uhs.c	(revision 42389)
@@ -201,6 +201,5 @@
 	// why do I need to copy temp here, does gprint modify the value of temp?
 	char temp[32];
-	strncpy (temp, c0, 32);
-	temp[31] = 0;
+	strncpy_nowarn (temp, c0, 31);
 	gprint (GP_ERR, "skip line %s\n\n", temp);
       }
Index: /trunk/Ohana/src/addstar/src/loadukirt_uhs_readstars_uhs2022.c
===================================================================
--- /trunk/Ohana/src/addstar/src/loadukirt_uhs_readstars_uhs2022.c	(revision 42389)
+++ /trunk/Ohana/src/addstar/src/loadukirt_uhs_readstars_uhs2022.c	(revision 42389)
@@ -0,0 +1,443 @@
+# include "addstar.h"
+# include "ukirt_uhs.h"
+
+/* this function reads the values of interest from the UKIRT UGCS CSV files:
+
+  data model description: doc/mapping_UKIDSS_unWISE_DVO.pdf
+
+  N -- field (column) number in CSV file (1 counting)
+  | UKIRT field name          : DVO measure field
+  1 sourceID                  : extID
+  2 cuEventID		      : 
+  3 frameSetID		      : imageID (assumes we do not try to go backwards for these photcodes)
+  4 ra			      : R
+  5 dec	  		      : D
+
+  6 cx			      : 		      
+  7 cy			      : 		      
+  8 cz			      : 		      
+  9 htmID		      : 		      
+ 10 l			      : 		      
+ 11 b			      : 		      
+ 12 lambda		      : 		      
+ 13 eta			      : 		      
+ 14 priOrSec		      : primary bit in dbFlags
+
+ 15 jmkPnt		      :
+ 16 jmkPntErr		      :
+ 17 jmkExt		      :
+ 18 jmkExtErr		      :
+
+ 19 mergedClassStat	      :                         
+ 20 mergedClass		      : psfQFperf or photFlags2	
+ 21 pStar		      : psfChisq		
+ 22 pGalaxy		      : extNsigma		
+ 23 pNoise		      : 			
+ 24 pSaturated		      : 			
+
+ 25 eBV			    :
+ 26 aJ			    :
+ 27 aK			    :
+
+ 28 jHallMag		      : M	  
+ 29 jHallMagErr		      : dM	  
+ 30 jPetroMag		      : 	  
+ 31 jPetroMagErr	      : 	  
+ 32 jAperMag3		      : Map	  
+ 33 jAperMag3Err	      : dMap	  
+ 34 jAperMag4		      : Mkron	  
+ 35 jAperMag4Err	      : dMron	  
+ 36 jAperMag6		      : 	  
+ 37 jAperMag6Err	      : 	  
+ 38 jGausig		      : 	  
+ 39 jEll		      : 	  
+ 40 jPA			      : posangle  
+ 41 jErrBits		      : 	  
+ 42 jDeblend		      : 	  
+ 43 jClass		      : psfQF	  
+ 44 jClassStat		      : 	  
+ 45 jppErrBits		      : photFlags 
+ 46 jSeqNum                   : detID     
+ 47 jXi   		      : 
+ 48 jEta		      : 
+ 
+ 49 kHallMag		      : M                
+ 50 kHallMagErr		      : dM		 
+ 51 kPetroMag		      : 		 
+ 52 kPetroMagErr	      : 		 
+ 53 kAperMag3		      : Map		 
+ 54 kAperMag3Err	      : dMap		 
+ 55 kAperMag4		      : Mkron		 
+ 56 kAperMag4Err	      : dMron		 
+ 57 kAperMag6		      : 		 
+ 58 kAperMag6Err	      : 		 
+ 59 kGausig		      : 		 
+ 60 kEll		      : 		 
+ 61 kPA			      : posangle	 
+ 62 kErrBits		      : 		 
+ 63 kDeblend		      : 		 
+ 64 kClass		      : psfQF		 
+ 65 kClassStat		      : 		 
+ 66 kppErrBits		      : photFlags	 
+ 67 kSeqNum                   : detID		 
+ 68 kObjID		      : 		 
+ 69 kXi   		      : 		 
+ 70 kEta		      : 		 
+
+*/
+
+# define iPARSE(NS,NE,FIELD,NAME) {					\
+    cA = iparse_csv_rpt (&ivalue, (NS), (NE), cA, &readStatus);		\
+    if (!readStatus && VERBOSE) {					\
+      gprint (GP_ERR, "suspect field: %d (%s) in %s\n",   (NS), NAME, c0); \
+    }									\
+    lineStatus &= readStatus; FIELD[Nelem] = ivalue; }
+
+# define jPARSE(NS,NE,FIELD,NAME) {					\
+    cA = jparse_csv_rpt (&jvalue, (NS), (NE), cA, &readStatus);		\
+    if (!readStatus && VERBOSE) {					\
+      gprint (GP_ERR, "suspect field: %d (%s) in %s\n",   (NS), NAME, c0); \
+    }									\
+    lineStatus &= readStatus; FIELD[Nelem] = jvalue; }
+
+# define dPARSE(NS,NE,FIELD,NAME) {					\
+    cA = dparse_csv_rpt (&dvalue, (NS), (NE), cA, &readStatus);		\
+    if (!readStatus && VERBOSE) {					\
+      gprint (GP_ERR, "suspect field: %d (%s) in %s\n",   (NS), NAME, c0); \
+    }									\
+    lineStatus &= readStatus; FIELD[Nelem] = dvalue; }
+
+static int Nline_read = 0; // track number of lines read so far (use to skip lines as well)
+static int Nskip = 0; // UKIRT UHS CSV files have a single header row (and no special character to mark)
+
+UKIRT_Stars *loadukirt_uhs_readstars_uhs2022 (FILE *f, char *buffer, int *nstart, AddstarClientOptions *options, int *nstars) {
+
+  int codeJ = GetPhotcodeCodebyName ("UKIRT_J"); if (!codeJ) Shutdown ("missing photcode UKIRT_J");
+  int codeK = GetPhotcodeCodebyName ("UKIRT_K"); if (!codeK) Shutdown ("missing photcode UKIRT_K");
+
+  // XXX I need a UKIRT UHS Mean Epoch
+  time_t UKIRT_UHS_J_EPOCH = ohana_date_to_sec ("2016/01/01,00:00:00");
+  time_t UKIRT_UHS_K_EPOCH = ohana_date_to_sec ("2019/01/01,00:00:00");
+  // fprintf (stderr, "WARNING: using an invalid UKIRT_UHS_EPOCH (see loadukirt_uhs_readstars.c:60)\n");
+
+  int Nelem = 0;      // number of valid rows read (vector elements)
+  int NELEM = 10000;  // currently-allocated number of output rows
+
+  // vectors to hold the data loaded from the csv file (names are UKIRT native names)
+  ALLOCATE_PTR (sourceID,     uint64_t, NELEM);
+  ALLOCATE_PTR (frameSetID,   uint64_t, NELEM); // XXX doc says 8-bytes for this value!
+  ALLOCATE_PTR (ra,           double,   NELEM);
+  ALLOCATE_PTR (dec,          double,   NELEM);
+  ALLOCATE_PTR (priOrSec,     uint64_t, NELEM);
+  ALLOCATE_PTR (mergedClass,  int,      NELEM); // XXX doc says 2-bytes (could use a short)
+  ALLOCATE_PTR (pStar,        double,   NELEM);
+  ALLOCATE_PTR (pGalaxy,      double,   NELEM);
+
+  ALLOCATE_PTR (jHallMag,     double,   NELEM);
+  ALLOCATE_PTR (jHallMagErr,  double,   NELEM);
+  ALLOCATE_PTR (jAperMag3,    double,   NELEM);
+  ALLOCATE_PTR (jAperMag3Err, double,   NELEM);
+  ALLOCATE_PTR (jAperMag4,    double,   NELEM);
+  ALLOCATE_PTR (jAperMag4Err, double,   NELEM);
+  ALLOCATE_PTR (jPA,          double,   NELEM);
+  ALLOCATE_PTR (jClass,       int,      NELEM);
+  ALLOCATE_PTR (jppErrBits,   int,      NELEM);
+  ALLOCATE_PTR (jSeqNum,      int,      NELEM);
+
+  ALLOCATE_PTR (kHallMag,     double,   NELEM);
+  ALLOCATE_PTR (kHallMagErr,  double,   NELEM);
+  ALLOCATE_PTR (kAperMag3,    double,   NELEM);
+  ALLOCATE_PTR (kAperMag3Err, double,   NELEM);
+  ALLOCATE_PTR (kAperMag4,    double,   NELEM);
+  ALLOCATE_PTR (kAperMag4Err, double,   NELEM);
+  ALLOCATE_PTR (kPA,          double,   NELEM);
+  ALLOCATE_PTR (kClass,       int,      NELEM);
+  ALLOCATE_PTR (kppErrBits,   int,      NELEM);
+  ALLOCATE_PTR (kSeqNum,      int,      NELEM);
+
+  // we have a working buffer read from the file. we parse the lines in the working buffer
+  // until we reach the last chunk without an EOL char.  at that point, we shift the start
+  // of the last (partial) line to the start of the buffer and re-fill.
+
+  // we treat \n\r pair as a single EOL char to handle mac files:
+
+  int Nstart = *nstart; // location of the last valid byte in the buffer (start filling here)
+  int EndOfFile = FALSE;
+  while (!EndOfFile && (Nelem < NSTARS_MAX)) {
+    int Nbytes = BUFFER_SIZE - Nstart;
+    // we have allocated one extra byte into which we never read so there will always be a NULL terminating the string
+    bzero (&buffer[Nstart], Nbytes + 1);
+    int Nread = fread (&buffer[Nstart], 1, Nbytes, f);
+    if (ferror (f)) {
+      perror ("error reading data file");
+      break;
+    }
+
+    // we still need to parse the rest of the buffer, but there might not be an EOL on the last line
+    if (Nread == 0) {
+      EndOfFile = TRUE;
+    }
+    
+    int bufferStatus = TRUE; 
+    char *c0 = buffer; // c0 always marks the start of a line
+    char *cA = NULL; // cA will carry the curr point within the line
+    while (bufferStatus) {
+
+      // find the end of this current line (\n or \r).  if we hit the end of the buffer (NULL),
+      // attempt to read more data.  finish up when we hit the end of the file
+      char *c1 = strchr (c0, '\n'); // find the end of this current line (also valid for a Mac: \r\n)
+      if (!c1) {
+	c1 = strchr (c0, '\r'); // try \r for Windows files
+      }
+      if (!c1) {
+	Nstart = strlen (c0);
+	if (EndOfFile) {
+	  // if we have reached EOF, we need to do one last pass in case there is a line without a return
+	  c1 = c0 + Nstart;
+	  bufferStatus = FALSE;
+	  if (Nstart == 0) continue; // if we have reached EOF and c0 points at the last valid character, we are done
+	} else {
+	  // if we have not reached EOF, we need to shift the buffer to the start of this line and read more data
+	  memmove (buffer, c0, Nstart);
+	  bufferStatus = FALSE;
+	  continue;
+	}
+      }
+      *c1 = 0; // mark the end of the line 
+      Nline_read ++;
+
+      // skip to the next line (but if EOF, do not overrun buffer)
+      if (Nline_read <= Nskip) { if (!EndOfFile) { c0 = c1 + 1; } continue; }
+
+      // these are not needed: Gaia CSV files do not have any commented-out lines
+      if (*c0 == '#')          { if (!EndOfFile) { c0 = c1 + 1; } continue; }
+      if (*c0 == '!')          { if (!EndOfFile) { c0 = c1 + 1; } continue; }
+
+      // for UKIRT UHS, we know which columns we want in advance
+
+      int lineStatus = TRUE;
+      int readStatus;
+      double dvalue;
+      int ivalue;
+      uint64_t jvalue;
+
+      // cA will follow the currently extracted field, c0 points to the start of the line
+      cA = c0;
+
+      // Tref : TBD for UHS
+
+      // the start of the line is the 1st element (fields are 1-counting)
+      jPARSE (  1,   1, sourceID,      "sourceID");
+      iPARSE (  3,   1, frameSetID,    "frameSetID");
+      dPARSE (  4,   3, ra,            "ra");
+      dPARSE (  5,   4, dec,           "dec");
+      jPARSE ( 14,   5, priOrSec,      "priOrSec"); // watch for epoch
+      iPARSE ( 20,  14, mergedClass,   "mergedClass");
+      dPARSE ( 21,  20, pStar,         "pStar");
+      dPARSE ( 22,  21, pGalaxy,       "pGalaxy");
+      dPARSE ( 28,  22, jHallMag,      "jHallMag");
+      dPARSE ( 29,  28, jHallMagErr,   "jHallMagErr");
+      dPARSE ( 32,  29, jAperMag3,     "jAperMag3");
+      dPARSE ( 33,  32, jAperMag3Err,  "jAperMag3Err");
+      dPARSE ( 34,  33, jAperMag4,     "jAperMag4");
+      dPARSE ( 35,  34, jAperMag4Err,  "jAperMag4Err");
+      dPARSE ( 40,  35, jPA,           "jPA");
+      iPARSE ( 43,  40, jClass,        "jClass");
+      iPARSE ( 45,  43, jppErrBits,    "jppErrBits");
+      iPARSE ( 46,  45, jSeqNum,       "jSeqNum");
+      dPARSE ( 49,  46, kHallMag,     "k1HallMag");
+      dPARSE ( 50,  49, kHallMagErr,  "k1HallMagErr");
+      dPARSE ( 53,  50, kAperMag3,    "k1AperMag3");
+      dPARSE ( 54,  53, kAperMag3Err, "k1AperMag3Err");
+      dPARSE ( 55,  54, kAperMag4,    "k1AperMag4");
+      dPARSE ( 56,  55, kAperMag4Err, "k1AperMag4Err");
+      dPARSE ( 61,  56, kPA,          "k1PA");
+      iPARSE ( 64,  61, kClass,       "k1Class");
+      iPARSE ( 66,  64, kppErrBits,   "k1ppErrBits");
+      iPARSE ( 67,  66, kSeqNum,      "k1SeqNum");
+
+      if (!lineStatus && VERBOSE) {
+	// why do I need to copy temp here, does gprint modify the value of temp?
+	char temp[32];
+	strncpy_nowarn (temp, c0, 31);
+	gprint (GP_ERR, "skip line %s\n\n", temp);
+      }
+
+      Nelem ++;
+      if (Nelem == NELEM) {
+	NELEM += 1000;
+
+	REALLOCATE (sourceID,     uint64_t, NELEM);  
+	REALLOCATE (frameSetID,   uint64_t, NELEM);
+	REALLOCATE (ra,           double,   NELEM);
+	REALLOCATE (dec,          double,   NELEM);
+	REALLOCATE (priOrSec,     uint64_t, NELEM);
+	REALLOCATE (mergedClass,  int,      NELEM);
+	REALLOCATE (pStar,        double,   NELEM);
+	REALLOCATE (pGalaxy,      double,   NELEM);
+
+	REALLOCATE (jHallMag,     double,   NELEM);
+	REALLOCATE (jHallMagErr,  double,   NELEM);
+	REALLOCATE (jAperMag3,    double,   NELEM);
+	REALLOCATE (jAperMag3Err, double,   NELEM);
+	REALLOCATE (jAperMag4,    double,   NELEM);
+	REALLOCATE (jAperMag4Err, double,   NELEM);
+	REALLOCATE (jPA,          double,   NELEM);
+	REALLOCATE (jClass,       int,      NELEM);
+	REALLOCATE (jppErrBits,   int,      NELEM);
+	REALLOCATE (jSeqNum,      int,      NELEM);
+
+	REALLOCATE (kHallMag,     double,   NELEM);
+	REALLOCATE (kHallMagErr,  double,   NELEM);
+	REALLOCATE (kAperMag3,    double,   NELEM);
+	REALLOCATE (kAperMag3Err, double,   NELEM);
+	REALLOCATE (kAperMag4,    double,   NELEM);
+	REALLOCATE (kAperMag4Err, double,   NELEM);
+	REALLOCATE (kPA,          double,   NELEM);
+	REALLOCATE (kClass,       int,      NELEM);
+	REALLOCATE (kppErrBits,   int,      NELEM);
+	REALLOCATE (kSeqNum,      int,      NELEM);
+      }
+      if (!EndOfFile) {
+	c0 = c1 + 1;
+      }
+    }
+  }
+  fprintf (stderr, " DONE: Nelem: %d, *nstars: %d\n", Nelem, *nstars);
+
+  // Nelem is now the number of items (objects,stars) read from the Gaia CSV file
+  int NstarsIn = Nelem;
+
+  double Rmin = +360.0;
+  double Rmax = -360.0;
+  double Dmin = +360.0;
+  double Dmax = -360.0;
+
+  // start off where we finished on a previous read
+  int Nstars = *nstars;
+  int NSTARS = Nstars + 0.1*NstarsIn;
+
+  ALLOCATE_PTR (stars, UKIRT_Stars, NSTARS);
+
+  for (int i = 0; i < NstarsIn; i++) {
+
+    Rmin = MIN (Rmin, ra[i]);
+    Rmax = MAX (Rmax, ra[i]);
+    Dmin = MIN (Dmin, dec[i]);
+    Dmax = MAX (Dmax, dec[i]);
+
+    // only allocate the measures for stars as we define them
+    ALLOCATE (stars[Nstars].measure, Measure, UKIRT_NFILTER);
+
+    // we have NFILTER (== 6) UKIRT measurements per object
+    dvo_average_init (&stars[Nstars].average);
+    for (int j = 0; j < UKIRT_NFILTER; j++) {
+      dvo_measure_init (&stars[Nstars].measure[j]);
+    }
+    
+    stars[Nstars].average.R = ra[i];
+    stars[Nstars].average.D = dec[i];
+    stars[Nstars].average.dR = NAN;
+    stars[Nstars].average.dD = NAN;
+
+    stars[Nstars].flag  = FALSE;
+    stars[Nstars].found = FALSE;
+
+    int isPrimary   = (!priOrSec[i] || (priOrSec[i] == frameSetID[i])) ? ID_MEAS_STACK_PRIMARY : 0x00;
+    int photFlags2 = isPrimary;
+    switch (mergedClass[i]) {
+      case  1: photFlags2 |= 0x01; break; // Galaxy
+      case  0: photFlags2 |= 0x02; break; // Noise
+      case -1: photFlags2 |= 0x04; break; // Star
+      case -2: photFlags2 |= 0x08; break; // probably star
+      case -3: photFlags2 |= 0x10; break; // probably galaxy
+      case -9: photFlags2 |= 0x20; break; // saturated
+      default: break;
+    }
+
+    // J measure
+    stars[Nstars].measure[0].extID      = sourceID[i];
+    stars[Nstars].measure[0].imageID    = frameSetID[i]; // XXX check for frameSetID > 31-bit int
+    stars[Nstars].measure[0].R          = ra[i];
+    stars[Nstars].measure[0].D          = dec[i];
+    stars[Nstars].measure[0].psfChisq   = pStar[i];
+    stars[Nstars].measure[0].extNsigma  = pGalaxy[i];
+    stars[Nstars].measure[0].M          = jHallMag[i];
+    stars[Nstars].measure[0].dM         = jHallMagErr[i];
+    stars[Nstars].measure[0].Map        = jAperMag3[i];
+    stars[Nstars].measure[0].dMap       = jAperMag3Err[i];
+    stars[Nstars].measure[0].Mkron      = jAperMag4[i];
+    stars[Nstars].measure[0].dMkron     = jAperMag4Err[i];
+    stars[Nstars].measure[0].posangle   = ToShortDegrees(jPA[i]); // XXX units
+    stars[Nstars].measure[0].psfQF      = psfQFfromXClass(jClass[i]);
+    stars[Nstars].measure[0].photFlags  = jppErrBits[i];
+    stars[Nstars].measure[0].photFlags2 = photFlags2;
+    stars[Nstars].measure[0].detID      = jSeqNum[i];
+    stars[Nstars].measure[0].photcode   = codeJ;
+    stars[Nstars].measure[0].t          = UKIRT_UHS_J_EPOCH;
+
+    // K measure
+    stars[Nstars].measure[1].extID      = sourceID[i];
+    stars[Nstars].measure[1].imageID    = frameSetID[i]; // XXX check for frameSetID > 31-bit int
+    stars[Nstars].measure[1].R          = ra[i];
+    stars[Nstars].measure[1].D          = dec[i];
+    stars[Nstars].measure[1].psfChisq   = pStar[i];
+    stars[Nstars].measure[1].extNsigma  = pGalaxy[i];
+    stars[Nstars].measure[1].M          = kHallMag[i];
+    stars[Nstars].measure[1].dM         = kHallMagErr[i];
+    stars[Nstars].measure[1].Map        = kAperMag3[i];
+    stars[Nstars].measure[1].dMap       = kAperMag3Err[i];
+    stars[Nstars].measure[1].Mkron      = kAperMag4[i];
+    stars[Nstars].measure[1].dMkron     = kAperMag4Err[i];
+    stars[Nstars].measure[1].posangle   = ToShortDegrees(kPA[i]); // XXX units
+    stars[Nstars].measure[1].psfQF      = psfQFfromXClass(kClass[i]);
+    stars[Nstars].measure[1].photFlags  = kppErrBits[i];
+    stars[Nstars].measure[1].photFlags2 = photFlags2;
+    stars[Nstars].measure[1].detID      = kSeqNum[i];
+    stars[Nstars].measure[1].photcode   = codeK;
+    stars[Nstars].measure[1].t          = UKIRT_UHS_K_EPOCH;
+
+    stars[Nstars].average.Nmeasure = UKIRT_NFILTER;
+    Nstars ++;
+
+    if (Nstars >= NSTARS) {
+      NSTARS += 10000;
+      REALLOCATE (stars, UKIRT_Stars, NSTARS);
+    }
+  }
+
+  FREE (sourceID);
+  FREE (frameSetID);
+  FREE (ra);
+  FREE (dec);
+  FREE (priOrSec);
+  FREE (mergedClass);
+  FREE (pStar);
+  FREE (pGalaxy);
+
+  FREE (jHallMag);
+  FREE (jHallMagErr);
+  FREE (jAperMag3);
+  FREE (jAperMag3Err);
+  FREE (jAperMag4);
+  FREE (jAperMag4Err);
+  FREE (jPA);
+  FREE (jClass);
+  FREE (jppErrBits);
+  FREE (jSeqNum);
+
+  FREE (kHallMag);
+  FREE (kHallMagErr);
+  FREE (kAperMag3);
+  FREE (kAperMag3Err);
+  FREE (kAperMag4);
+  FREE (kAperMag4Err);
+  FREE (kPA);
+  FREE (kClass);
+  FREE (kppErrBits);
+  FREE (kSeqNum);
+
+  *nstars = Nstars;
+  *nstart = Nstart;
+  return (stars);
+}
Index: /trunk/Ohana/src/addstar/src/loadukirt_uhs_readstars_ulas.c
===================================================================
--- /trunk/Ohana/src/addstar/src/loadukirt_uhs_readstars_ulas.c	(revision 42388)
+++ /trunk/Ohana/src/addstar/src/loadukirt_uhs_readstars_ulas.c	(revision 42389)
@@ -406,6 +406,5 @@
 	// why do I need to copy temp here, does gprint modify the value of temp?
 	char temp[32];
-	strncpy (temp, c0, 32);
-	temp[31] = 0;
+	strncpy_nowarn (temp, c0, 31);
 	gprint (GP_ERR, "skip line %s\n\n", temp);
       }
Index: /trunk/Ohana/src/addstar/src/loadwise_ops.c
===================================================================
--- /trunk/Ohana/src/addstar/src/loadwise_ops.c	(revision 42388)
+++ /trunk/Ohana/src/addstar/src/loadwise_ops.c	(revision 42389)
@@ -19,6 +19,9 @@
   if (MODE == MODE_CATWISE) {
       // copy the string ranges and then use strtod (not necessary?)
-      *R = strtod (&ptr[47], NULL); // safe to use the strtod on the line because it is white-space separated
-      *D = strtod (&ptr[59], NULL);
+      // *R = strtod (&ptr[47], NULL); // safe to use strtod on the line because it is white-space separated
+      // *D = strtod (&ptr[59], NULL);
+      // note we use ra_pm and dec_pm which are different from ra,dec when the object is moving
+      *R = strtod (&ptr[1139], NULL); // safe to use strtod on the line because it is white-space separated
+      *D = strtod (&ptr[1151], NULL);
   } else {
       ptr = skipNbounds (ptr, '|', 1, Nmax);
Index: /trunk/Ohana/src/addstar/src/loadwise_rawdata.c
===================================================================
--- /trunk/Ohana/src/addstar/src/loadwise_rawdata.c	(revision 42388)
+++ /trunk/Ohana/src/addstar/src/loadwise_rawdata.c	(revision 42389)
@@ -42,5 +42,5 @@
   while ((Nbyte = fread (&buffer[Nextra], 1, NBYTE-Nextra, f)) != 0) {
     if (Nbyte == -1) Shutdown ("error reading from raw file %s", filename);
-    if (DEBUG) fprintf (stderr, "read %d bytes", Nbyte);
+    if (DEBUG) fprintf (stderr, "read %d bytes .. n", Nbyte);
 
     Nbyte += Nextra;
@@ -69,13 +69,12 @@
 
       if (skipHeader && (MODE == MODE_CATWISE)) {
-	if (*p == '\\') goto skip_header;
+	if (*p == 0x5C) goto skip_header; // back-slash char
 	if (*p == '|') goto skip_header;
-      }
-      if (skipHeader && (MODE == MODE_CATWISE)) {
-	// once we get past the header, do not skip any more
-	skipHeader = FALSE;
-      }
-
+	skipHeader = FALSE; // once we get past the header, do not skip any more
+      }
+
+      // note CATWISE uses a different mapping
       getWISE_coords (p, &tstars[Ntstars].R, &tstars[Ntstars].D, Nbyte - offset);
+
       tstars[Ntstars].offset = offset; // offset within scan
       tstars[Ntstars].flag = FALSE;
@@ -94,5 +93,5 @@
 
       /* start of the next line */
-      p = q + 1;
+      p = q + 1; // q is always RETURN char on this line
       offset = p - buffer; // offset within this scan
       if (offset == Nbyte) {
@@ -104,5 +103,5 @@
       q = memchr (p, '\n', Nbyte - offset);
       if (q == NULL) {
-	// last, incomplete line in buffer
+	// we are on the last, incomplete line in buffer
 	Nextra = Nbyte - offset;
 	break;
@@ -183,9 +182,18 @@
 	    break;
 	  case MODE_CATWISE:
-	    loadwise_star_catwise (&newcat->measure[Nmeas], &buffer[offset], Nbyte - offset, tstars[j].R, tstars[j].D);
+	    loadwise_star_catwise (&newcat->average[Nave], &newcat->measure[Nmeas], &buffer[offset], Nbyte - offset, &tstars[j]);
 	    break;
 	  default:
 	    break;
 	}
+
+	if (DEBUG && (Nave < 10)) {
+	  fprintf (stderr, "pos: %12.6f %12.6f +/- %10.5f %10.5f : %12.6f %12.6f +/- %10.5f %10.5f\n",
+		   newcat->average[Nave].R, newcat->average[Nave].D, 
+		   newcat->average[Nave].dR, newcat->average[Nave].dD, 
+		   newcat->average[Nave].uR, newcat->average[Nave].uD, 
+		   newcat->average[Nave].duR, newcat->average[Nave].duD);
+	}
+	    
 
 	tstars[j].flag = TRUE;
Index: /trunk/Ohana/src/addstar/src/loadwise_star_full.c
===================================================================
--- /trunk/Ohana/src/addstar/src/loadwise_star_full.c	(revision 42388)
+++ /trunk/Ohana/src/addstar/src/loadwise_star_full.c	(revision 42389)
@@ -8,7 +8,11 @@
 int setWISE_blend_flag (Measure *measure, char *ptr);
 
+int setCatWISE_ab_flag (Measure *measure, char qual);
+
+# define CATWISE_EPOCH 1432771200 /* MJD 57170 */
+
 // fill in the data for a CatWISE double star.  takes a pointer to the start of the line the
 // RA and DEC have already been set
-int loadwise_star_catwise (Measure *measure, char *line, int Nmax, double Rs, double Ds) {
+int loadwise_star_catwise (Average *average, Measure *measure, char *line, int Nmax, WISE_Stars *tstars) {
 
   if (line == NULL) Shutdown ("format error in WISE");
@@ -22,12 +26,29 @@
   // already been extracted.
 
-  measure[0].R    = Rs;
-  measure[0].D    = Ds;
-  measure[1].R    = Rs;
-  measure[1].D    = Ds;
+  // reference epoch for CATWise:
+  average[0].Tmean = CATWISE_EPOCH;
+
+  // correct the position information for the systematic corrections
+  double RA_SYS_OFFSET = RA_SYS_OFFRAW / cos(RAD_DEG*tstars->D);
+
+  average[0].R  = tstars->R + RA_SYS_OFFSET;
+  average[0].D  = tstars->D + DE_SYS_OFFSET;
+  average[0].dR = getDoubleNAN (line, 71, 79); // sig_ra -- add 5/1000 to avoid truncation
+  average[0].dD = getDoubleNAN (line, 80, 88); // sig_dec
+
+  // P.M. values go on average:
+  average[0].uR  = getDoubleNAN (line, 1194, 1203) + uRA_SYS_OFFSET; // PMRA
+  average[0].uD  = getDoubleNAN (line, 1204, 1213) + uDE_SYS_OFFSET; // PMDec
+  average[0].duR = getDoubleNAN (line, 1214, 1222); // sigPMRA 
+  average[0].duD = getDoubleNAN (line, 1223, 1231); // sigPMDec
+
+  measure[0].R     = average[0].R;
+  measure[0].D     = average[0].D;
+  measure[1].R     = average[0].R;
+  measure[1].D     = average[0].D;
 
   // I can assign dRA and dDEC to dX and dY if I can consistently set posangle and pltscale
-  measure[0].dXccd = ToShortPixels(getDoubleRAW (line, 71, 79) + 0.005); // sig_ra -- add 5/1000 to avoid truncation
-  measure[0].dYccd = ToShortPixels(getDoubleRAW (line, 80, 88) + 0.005); // sig_dec
+  measure[0].dXccd = ToShortPixels(average[0].dR + 0.005); // sig_ra -- add 5/1000 to avoid truncation
+  measure[0].dYccd = ToShortPixels(average[0].dD + 0.005); // sig_dec
   measure[0].posangle = 0.0;
   measure[0].pltscale = 1.0;
@@ -39,6 +60,6 @@
   measure[1].pltscale = measure[0].pltscale;
 
-  measure[0].Xccd = getDoubleRAW (line,  98, 106); // wx
-  measure[0].Yccd = getDoubleRAW (line, 107, 115); // wy
+  measure[0].Xccd = getDoubleNAN (line,  98, 106); // wx
+  measure[0].Yccd = getDoubleNAN (line, 107, 115); // wy
   measure[1].Xccd = measure[0].Xccd;
   measure[1].Yccd = measure[0].Yccd;
@@ -47,31 +68,52 @@
   measure[0].M         = getDoubleNAN (line, 248, 254); // w1mpro
   measure[0].dM        = getDoubleNAN (line, 255, 264); // w1sigmpro
-  measure[0].psfChisq  = getDoubleRAW (line, 265, 275); // w1rchi2
-  measure[0].psfQF     = measure[0].psfChisq;
+  measure[0].psfChisq  = getDoubleNAN (line, 265, 275); // w1rchi2
   measure[0].photFlags = 0;
+
+  measure[0].Mkron     = getDoubleNAN (line, 563, 572); // w1mag_4
+  measure[0].dMkron    = getDoubleNAN (line, 573, 582); // w1sigm_4
+  measure[0].Map       = getDoubleNAN (line, 339, 345); // w1mag
+  measure[0].dMap      = getDoubleNAN (line, 346, 352); // w1sigm
+
+  measure[0].Xfix      = getDoubleNAN (line, 880, 891); // w1k
+  measure[0].Yfix      = getDoubleNAN (line, 989, 903); // w1mLQ
 
   // W2
   measure[1].M         = getDoubleNAN (line, 276, 282); // w2mpro
   measure[1].dM        = getDoubleNAN (line, 283, 292); // w2sigmpro
-  measure[1].psfChisq  = getDoubleRAW (line, 293, 303); // w2rchi2
-  measure[1].psfQF     = measure[1].psfChisq;
+  measure[1].psfChisq  = getDoubleNAN (line, 293, 303); // w2rchi2
   measure[1].photFlags = 0;
 
-  setCatWISE_blend_flag (measure, line); // w1sat
+  measure[1].Mkron     = getDoubleNAN (line, 591, 600); // w2mag_4 
+  measure[1].dMkron    = getDoubleNAN (line, 601, 610); // w2sigm_4
+  measure[1].Map       = getDoubleNAN (line, 367, 373); // w2mag
+  measure[1].dMap      = getDoubleNAN (line, 374, 380); // w2sigm
+
+  measure[1].Xfix      = getDoubleNAN (line, 995,  1006); // w2k
+  measure[1].Yfix      = getDoubleNAN (line, 1013, 1018); // w2mLQ
+
+  measure[0].psfQF     = getDoubleNAN (line, 304, 314); // rchi2
+  measure[1].psfQF     = measure[0].psfQF;
+
+  setCatWISE_blend_flag (measure, line); // na & nb
 
   setCatWISE_sat_flag (&measure[0], line, 323, 330); // w1sat
   setCatWISE_sat_flag (&measure[1], line, 331, 338); // w2sat
 
-  // cc_flags? 1642 - 1657
-  // setWISE_cc_flag (&measure[0], ptr[i]); // cc_flags
-
-  // set ext flags for all 4 measures
-  // setCatWISE_ext_flag_allsky (measure, ptr[0]); // ext_flg
-
-  // setWISE_var_flag_allsky (&measure[0], ptr[i]); // var_flg
-
-  // setWISE_ph_qual (&measure[i], ptr[i]); // ph_qual
-
-  double mjdmean = getDoubleRAW (line, 1126, 1138); // MeanObsMJD
+  // cc_flags is a field which takes 15 chars, but only 4 are used
+  // bytes 1653 - 1656 are the allWise cc_flag entries for W1, W2, W3, W4
+  // skip lines for which the 4 chars have the value 'null'
+  if (strncmp(&line[1653], "null", 4)) {
+      setWISE_cc_flag (&measure[0], line[1653]); // W1 cc_flag
+      setWISE_cc_flag (&measure[1], line[1654]); // W2 cc_flag
+  }
+
+  // cc_flags is a field which takes 8 chars, but only 2 are used
+  // bytes 1735 & 1736 are the ab_flag entries for W1 & W2
+  // they use the same values as cc_flags
+  setCatWISE_ab_flag (&measure[0], line[1735]); // W1 ab_flag
+  setCatWISE_ab_flag (&measure[1], line[1736]); // W2 ab_flag
+
+  double mjdmean = getDoubleNAN (line, 1126, 1138); // MeanObsMJD
   
   // the release is based on data taken in the period 14 January 2010 to 29 April 2010
@@ -575,4 +617,19 @@
   }
   return TRUE;
+}
+
+int setCatWISE_ab_flag (Measure *measure, char qual) {
+
+  switch (qual) {
+    case 'P': measure[0].photFlags2 |= FLAG_CC_PERSIST | FLAG_CC_SPURIOUS; break;
+    case 'H': measure[0].photFlags2 |= FLAG_CC_HALO    | FLAG_CC_SPURIOUS; break;
+    case 'D': measure[0].photFlags2 |= FLAG_CC_SPIKE   | FLAG_CC_SPURIOUS; break;
+    case 'O': measure[0].photFlags2 |= FLAG_CC_GHOST   | FLAG_CC_SPURIOUS; break;
+
+    case '0': break;
+    default: 
+      fprintf (stderr, "error in ab_flag: %c\n", qual);
+  }      
+  return (TRUE);
 }
 
Index: /trunk/Ohana/src/addstar/src/mkcmf.c
===================================================================
--- /trunk/Ohana/src/addstar/src/mkcmf.c	(revision 42388)
+++ /trunk/Ohana/src/addstar/src/mkcmf.c	(revision 42389)
@@ -559,5 +559,5 @@
     Ns = strlen (simple);
     No = 80 - Ns;
-    strncpy (header.buffer, simple, Ns);
+    strncpy_nowarn (header.buffer, simple, Ns);
     memset (&header.buffer[Ns], ' ', No);
   }
Index: /trunk/Ohana/src/addstar/src/sky_tessalation.c
===================================================================
--- /trunk/Ohana/src/addstar/src/sky_tessalation.c	(revision 42388)
+++ /trunk/Ohana/src/addstar/src/sky_tessalation.c	(revision 42389)
@@ -52,5 +52,5 @@
   Ntotal = Nbase*pow(4.0, level);
   Ndigit = (int)(log10(Ntotal)) + 1 ;
-  snprintf (format, 16, "skytri.%%0%dd", Ndigit);
+  snprintf_nowarn (format, 16, "skytri.%%0%dd", Ndigit);
 
   // to what depth do we need to go to have only Nmax foreach subcell?
@@ -90,5 +90,5 @@
     for (j = 0; j < Ntriangles; j++) {
       sky_triangle_to_image (&image[j], &tri[j]);
-      snprintf (image[j].name, DVO_IMAGE_NAME_LEN, format, Nout);
+      snprintf_nowarn (image[j].name, DVO_IMAGE_NAME_LEN, format, Nout);
       Nout++;
     }  
@@ -128,5 +128,5 @@
   Ntotal = Nbase*pow(4.0, level);
   Ndigit = (int)(log10(Ntotal)) + 1 ;
-  snprintf (format, 16, "skycell.%%0%dd", Ndigit);
+  snprintf_nowarn (format, 16, "skycell.%%0%dd", Ndigit);
 
   // to what depth do we need to go to have only Nmax foreach subcell?
@@ -173,5 +173,5 @@
       if (!strcmp(rectangle[j].coords.ctype, "DROP")) continue;
       memcpy (&subset[Nsubset], &rectangle[j], sizeof(SkyRectangle));
-      snprintf (subset[Nsubset].name, DVO_IMAGE_NAME_LEN, format, Nname);
+      snprintf_nowarn (subset[Nsubset].name, DVO_IMAGE_NAME_LEN, format, Nname);
       Nname++;
       Nsubset++;
@@ -254,5 +254,5 @@
   for (double dec = -90.0; dec < +90.01; dec += CELLSIZE, Ndec ++) {
 
-    snprintf (format, 32, "skycell.%%03d.%03d", Ndec);
+    snprintf_nowarn (format, 32, "skycell.%%03d.%03d", Ndec);
 
     int Nring;
@@ -310,5 +310,5 @@
   Ntotal = 41254.2 / (dDEC*dDEC);
   Ndigit = (int)(log10(Ntotal)) + 1 ;
-  snprintf (format, 16, "skycell.%%0%dd", Ndigit);
+  snprintf_nowarn (format, 16, "skycell.%%0%dd", Ndigit);
 
   // generate the a collection of rectangles for each ring
@@ -367,5 +367,5 @@
   Ntotal = 41254.2 / (dDEC*dDEC);
   Ndigit = (int)(log10(Ntotal)) + 1 ;
-  snprintf (format, 16, "skycell.%%0%dd", Ndigit);
+  snprintf_nowarn (format, 16, "skycell.%%0%dd", Ndigit);
 
   double d2r = M_PI / 180; // is RAD_DEG
@@ -716,5 +716,5 @@
     // CFIS uses names with centers based on ra,dec
     // format = skycell.%03d.%03d
-    snprintf (ring[i].name, DVO_IMAGE_NAME_LEN, format, i);
+    snprintf_nowarn (ring[i].name, DVO_IMAGE_NAME_LEN, format, i);
   }
 
@@ -826,5 +826,5 @@
     ring[i].photcode = 1; // this needs to be set more sensibly
 
-    snprintf (ring[i].name, DVO_IMAGE_NAME_LEN, format, Nname);
+    snprintf_nowarn (ring[i].name, DVO_IMAGE_NAME_LEN, format, Nname);
     Nname++;
 
@@ -897,5 +897,5 @@
       ring[N].photcode = 1; // this needs to be set more sensibly
 
-      snprintf (ring[N].name, DVO_IMAGE_NAME_LEN, format, Nname);
+      snprintf_nowarn (ring[N].name, DVO_IMAGE_NAME_LEN, format, Nname);
       Nname++;
     }
@@ -927,7 +927,7 @@
   if (Nx * Ny > 1) {
     Ndigit = (int)(log10(Nx*Ny)) + 1 ;
-    snprintf (format, 80, "%s.%%0%dd", input[0].name, Ndigit);
+    snprintf_nowarn (format, 80, "%s.%%0%dd", input[0].name, Ndigit);
   } else {
-    snprintf (format, 80, "%s", input[0].name);
+    snprintf_nowarn (format, 80, "%s", input[0].name);
   }
 
@@ -944,7 +944,7 @@
 
       if (Nx + Ny > 1) {
-	snprintf (output[N].name, DVO_IMAGE_NAME_LEN, format, N);
+	snprintf_nowarn (output[N].name, DVO_IMAGE_NAME_LEN, format, N);
       } else {
-	snprintf (output[N].name, DVO_IMAGE_NAME_LEN, "%s", format);
+	snprintf_nowarn (output[N].name, DVO_IMAGE_NAME_LEN, "%s", format);
       }
 
Index: /trunk/Ohana/src/delstar/src/delete_duplicate_images.c
===================================================================
--- /trunk/Ohana/src/delstar/src/delete_duplicate_images.c	(revision 42388)
+++ /trunk/Ohana/src/delstar/src/delete_duplicate_images.c	(revision 42389)
@@ -108,5 +108,5 @@
     // set up the basic catalog info
     char hostfile[1024];
-    snprintf (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name);
+    snprintf_nowarn (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name);
 
     dvo_catalog_init (&catalog, TRUE);
@@ -148,5 +148,5 @@
   // write out the subset table of image information
   char imageFile[512];
-  snprintf (imageFile, 512, "%s/ImageIDs.tmp.fits", CATDIR);
+  snprintf_nowarn (imageFile, 512, "%s/ImageIDs.tmp.fits", CATDIR);
 
   if (!ImageIDSave (imageFile, imageID)) {
@@ -173,11 +173,11 @@
 
     char command[1024];
-    snprintf (command, 1024, "delstar_client -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -dup-images", 
+    snprintf_nowarn (command, 1024, "delstar_client -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -dup-images", 
 	      table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, 
 	      UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
 
     char tmpline[1024];
-    if (VERBOSE)       { snprintf (tmpline, 1024, "%s -v",              command);                    strcpy (command, tmpline); }
-    if (VERBOSE2)      { snprintf (tmpline, 1024, "%s -vv",             command);                    strcpy (command, tmpline); }
+    if (VERBOSE)       { snprintf_nowarn (tmpline, 1024, "%s -v",              command);                    strcpy (command, tmpline); }
+    if (VERBOSE2)      { snprintf_nowarn (tmpline, 1024, "%s -vv",             command);                    strcpy (command, tmpline); }
 
     fprintf (stderr, "command: %s\n", command);
Index: /trunk/Ohana/src/delstar/src/delete_fix_LAP.c
===================================================================
--- /trunk/Ohana/src/delstar/src/delete_fix_LAP.c	(revision 42388)
+++ /trunk/Ohana/src/delstar/src/delete_fix_LAP.c	(revision 42389)
@@ -40,5 +40,5 @@
     // set up the basic catalog info
     char hostfile[1024];
-    snprintf (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name);
+    snprintf_nowarn (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name);
 
     dvo_catalog_init (&catalog, TRUE);
@@ -92,5 +92,5 @@
   // write out the subset table of image information
   char imageFile[512];
-  snprintf (imageFile, 512, "%s/delstar.fixLAP.%s.dat", CATDIR, uniquer);
+  snprintf_nowarn (imageFile, 512, "%s/delstar.fixLAP.%s.dat", CATDIR, uniquer);
 
   if (!ImageSubsetSave (imageFile, image, Nimage)) {
@@ -132,16 +132,16 @@
 
     ALLOCATE (table->hosts[i].results, char, 1024);
-    snprintf (table->hosts[i].results, 1024, "%s/delstar.fixLAP.imstats.%s.dat", table->hosts[i].pathname, uniquer);
+    snprintf_nowarn (table->hosts[i].results, 1024, "%s/delstar.fixLAP.imstats.%s.dat", table->hosts[i].pathname, uniquer);
 
     char command[1024];
-    snprintf (command, 1024, "delstar_client -hostID %d -D CATDIR %s -hostdir %s -images %s -imstats %s -region %f %f %f %f -fix-LAP", 
+    snprintf_nowarn (command, 1024, "delstar_client -hostID %d -D CATDIR %s -hostdir %s -images %s -imstats %s -region %f %f %f %f -fix-LAP", 
 	      table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, imageFile, table->hosts[i].results,
 	      UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
 
     char tmpline[1024];
-    if (VERBOSE)    { snprintf (tmpline, 1024, "%s -v",      command);             strcpy (command, tmpline); }
-    if (VERBOSE2)   { snprintf (tmpline, 1024, "%s -vv",     command);             strcpy (command, tmpline); }
-    if (SINGLE_CPT) { snprintf (tmpline, 1024, "%s -cpt %s", command, SINGLE_CPT); strcpy (command, tmpline); }
-    if (UPDATE)     { snprintf (tmpline, 1024, "%s -update", command);             strcpy (command, tmpline); }
+    if (VERBOSE)    { snprintf_nowarn (tmpline, 1024, "%s -v",      command);             strcpy (command, tmpline); }
+    if (VERBOSE2)   { snprintf_nowarn (tmpline, 1024, "%s -vv",     command);             strcpy (command, tmpline); }
+    if (SINGLE_CPT) { snprintf_nowarn (tmpline, 1024, "%s -cpt %s", command, SINGLE_CPT); strcpy (command, tmpline); }
+    if (UPDATE)     { snprintf_nowarn (tmpline, 1024, "%s -update", command);             strcpy (command, tmpline); }
 
     fprintf (stderr, "command: %s\n", command);
@@ -210,5 +210,5 @@
   // write out the subset table of image information
   char imageFile[512];
-  snprintf (imageFile, 512, "%s/delstar.fixLAP.%s.dat", CATDIR, UNIQUER);
+  snprintf_nowarn (imageFile, 512, "%s/delstar.fixLAP.%s.dat", CATDIR, UNIQUER);
 
   // load the list of hosts
@@ -228,5 +228,5 @@
 
     ALLOCATE (table->hosts[i].results, char, 1024);
-    snprintf (table->hosts[i].results, 1024, "%s/delstar.fixLAP.imstats.%s.dat", table->hosts[i].pathname, UNIQUER);
+    snprintf_nowarn (table->hosts[i].results, 1024, "%s/delstar.fixLAP.imstats.%s.dat", table->hosts[i].pathname, UNIQUER);
 
     fprintf (stderr, "read %s\n", table->hosts[i].results);
Index: /trunk/Ohana/src/delstar/src/delete_fix_LAP_edges.c
===================================================================
--- /trunk/Ohana/src/delstar/src/delete_fix_LAP_edges.c	(revision 42388)
+++ /trunk/Ohana/src/delstar/src/delete_fix_LAP_edges.c	(revision 42389)
@@ -48,5 +48,5 @@
     // set up the basic catalog info
     char hostfile[1024];
-    snprintf (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name);
+    snprintf_nowarn (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name);
 
     dvo_catalog_init (&catalog, TRUE);
@@ -122,16 +122,16 @@
 
     ALLOCATE (table->hosts[i].results, char, 1024);
-    snprintf (table->hosts[i].results, 1024, "%s/delstar.fixLAPedges.measures.%s.dat", table->hosts[i].pathname, uniquer);
+    snprintf_nowarn (table->hosts[i].results, 1024, "%s/delstar.fixLAPedges.measures.%s.dat", table->hosts[i].pathname, uniquer);
 
     char command[1024];
-    snprintf (command, 1024, "delstar_client -hostID %d -D CATDIR %s -hostdir %s -measures %s -region %f %f %f %f -fix-LAP-edges", 
+    snprintf_nowarn (command, 1024, "delstar_client -hostID %d -D CATDIR %s -hostdir %s -measures %s -region %f %f %f %f -fix-LAP-edges", 
 	      table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, table->hosts[i].results,
 	      UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
 
     char tmpline[1024];
-    if (VERBOSE)    { snprintf (tmpline, 1024, "%s -v",      command);             strcpy (command, tmpline); }
-    if (VERBOSE2)   { snprintf (tmpline, 1024, "%s -vv",     command);             strcpy (command, tmpline); }
-    if (SINGLE_CPT) { snprintf (tmpline, 1024, "%s -cpt %s", command, SINGLE_CPT); strcpy (command, tmpline); }
-    // if (UPDATE)     { snprintf (tmpline, 1024, "%s -update", command);             strcpy (command, tmpline); }
+    if (VERBOSE)    { snprintf_nowarn (tmpline, 1024, "%s -v",      command);             strcpy (command, tmpline); }
+    if (VERBOSE2)   { snprintf_nowarn (tmpline, 1024, "%s -vv",     command);             strcpy (command, tmpline); }
+    if (SINGLE_CPT) { snprintf_nowarn (tmpline, 1024, "%s -cpt %s", command, SINGLE_CPT); strcpy (command, tmpline); }
+    // if (UPDATE)     { snprintf_nowarn (tmpline, 1024, "%s -update", command);             strcpy (command, tmpline); }
 
     fprintf (stderr, "command: %s\n", command);
Index: /trunk/Ohana/src/delstar/src/delete_fix_LAP_edges_delete.c
===================================================================
--- /trunk/Ohana/src/delstar/src/delete_fix_LAP_edges_delete.c	(revision 42388)
+++ /trunk/Ohana/src/delstar/src/delete_fix_LAP_edges_delete.c	(revision 42389)
@@ -88,5 +88,5 @@
     // set up the basic catalog info
     char hostfile[1024];
-    snprintf (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name);
+    snprintf_nowarn (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name);
 
     dvo_catalog_init (&catalog, TRUE);
@@ -180,8 +180,8 @@
 
     // ALLOCATE (table->hosts[i].results, char, 1024);
-    // snprintf (table->hosts[i].results, 1024, "%s/delstar.fixLAPedges.measures.%s.dat", table->hosts[i].pathname, uniquer);
+    // snprintf_nowarn (table->hosts[i].results, 1024, "%s/delstar.fixLAPedges.measures.%s.dat", table->hosts[i].pathname, uniquer);
 
     char command[1024];
-    snprintf (command, 1024, "delstar_client -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -fix-LAP-edges-delete %s", 
+    snprintf_nowarn (command, 1024, "delstar_client -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -fix-LAP-edges-delete %s", 
 	      table->hosts[i].hostID, CATDIR, table->hosts[i].pathname,
 	      UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax,
@@ -189,8 +189,8 @@
 
     char tmpline[1024];
-    if (VERBOSE)    { snprintf (tmpline, 1024, "%s -v",      command);             strcpy (command, tmpline); }
-    if (VERBOSE2)   { snprintf (tmpline, 1024, "%s -vv",     command);             strcpy (command, tmpline); }
-    if (SINGLE_CPT) { snprintf (tmpline, 1024, "%s -cpt %s", command, SINGLE_CPT); strcpy (command, tmpline); }
-    if (UPDATE)     { snprintf (tmpline, 1024, "%s -update", command);             strcpy (command, tmpline); }
+    if (VERBOSE)    { snprintf_nowarn (tmpline, 1024, "%s -v",      command);             strcpy (command, tmpline); }
+    if (VERBOSE2)   { snprintf_nowarn (tmpline, 1024, "%s -vv",     command);             strcpy (command, tmpline); }
+    if (SINGLE_CPT) { snprintf_nowarn (tmpline, 1024, "%s -cpt %s", command, SINGLE_CPT); strcpy (command, tmpline); }
+    if (UPDATE)     { snprintf_nowarn (tmpline, 1024, "%s -update", command);             strcpy (command, tmpline); }
 
     fprintf (stderr, "command: %s\n", command);
Index: /trunk/Ohana/src/delstar/src/delete_photcodes.c
===================================================================
--- /trunk/Ohana/src/delstar/src/delete_photcodes.c	(revision 42388)
+++ /trunk/Ohana/src/delstar/src/delete_photcodes.c	(revision 42389)
@@ -38,5 +38,5 @@
     // set up the basic catalog info
     char hostfile[1024];
-    snprintf (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name);
+    snprintf_nowarn (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name);
 
     dvo_catalog_init (&catalog, TRUE);
@@ -94,5 +94,5 @@
 
     char command[1024];
-    snprintf (command, 1024, "delstar_client -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -photcodes %s", 
+    snprintf_nowarn (command, 1024, "delstar_client -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -photcodes %s", 
 	      table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, 
 	      UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, 
@@ -100,6 +100,6 @@
 
     char tmpline[1024];
-    if (VERBOSE)       { snprintf (tmpline, 1024, "%s -v",              command);                    strcpy (command, tmpline); }
-    if (VERBOSE2)      { snprintf (tmpline, 1024, "%s -vv",             command);                    strcpy (command, tmpline); }
+    if (VERBOSE)       { snprintf_nowarn (tmpline, 1024, "%s -v",              command);                    strcpy (command, tmpline); }
+    if (VERBOSE2)      { snprintf_nowarn (tmpline, 1024, "%s -vv",             command);                    strcpy (command, tmpline); }
 
     fprintf (stderr, "command: %s\n", command);
Index: /trunk/Ohana/src/dvomerge/src/dvorepairFixStackIDs.c
===================================================================
--- /trunk/Ohana/src/dvomerge/src/dvorepairFixStackIDs.c	(revision 42388)
+++ /trunk/Ohana/src/dvomerge/src/dvorepairFixStackIDs.c	(revision 42389)
@@ -33,6 +33,6 @@
 
   while (fscanf (f, "%s", catdir) != EOF) {
-    snprintf (imageFilenameOld, DVO_MAX_PATH, "%s/Images.dat", catdir);
-    snprintf (imageFilenameNew, DVO_MAX_PATH, "%s/Images.dat.fixed", catdir);
+    snprintf_nowarn (imageFilenameOld, DVO_MAX_PATH, "%s/Images.dat", catdir);
+    snprintf_nowarn (imageFilenameNew, DVO_MAX_PATH, "%s/Images.dat.fixed", catdir);
     
     if ((image = LoadImages (&db, imageFilenameOld, &Nimage)) == NULL) {
Index: /trunk/Ohana/src/dvomerge/src/dvorepairFixWarpIDs.c
===================================================================
--- /trunk/Ohana/src/dvomerge/src/dvorepairFixWarpIDs.c	(revision 42388)
+++ /trunk/Ohana/src/dvomerge/src/dvorepairFixWarpIDs.c	(revision 42389)
@@ -46,6 +46,6 @@
 
   while (fscanf (f, "%s", catdir) != EOF) {
-    snprintf (imageFilenameOld, DVO_MAX_PATH, "%s/Images.dat", catdir);
-    snprintf (imageFilenameNew, DVO_MAX_PATH, "%s/Images.dat.fixed", catdir);
+    snprintf_nowarn (imageFilenameOld, DVO_MAX_PATH, "%s/Images.dat", catdir);
+    snprintf_nowarn (imageFilenameNew, DVO_MAX_PATH, "%s/Images.dat.fixed", catdir);
     
     if ((image = LoadImages (&db, imageFilenameOld, &Nimage)) == NULL) {
Index: /trunk/Ohana/src/dvomerge/src/dvosecfilt_catalogs.c
===================================================================
--- /trunk/Ohana/src/dvomerge/src/dvosecfilt_catalogs.c	(revision 42388)
+++ /trunk/Ohana/src/dvomerge/src/dvosecfilt_catalogs.c	(revision 42389)
@@ -34,5 +34,5 @@
 
     char hostfile[1024];
-    snprintf (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist->regions[i]->name);
+    snprintf_nowarn (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist->regions[i]->name);
 
     dvo_catalog_init (&catalog, TRUE);
@@ -116,5 +116,5 @@
     // options / arguments that can affect relastro_client -update-objects:
     char command[DVO_MAX_PATH];
-    snprintf (command, DVO_MAX_PATH, "dvosecfilt_client %s %d -hostID %d -hostdir %s -region %f %f %f %f", 
+    snprintf_nowarn (command, DVO_MAX_PATH, "dvosecfilt_client %s %d -hostID %d -hostdir %s -region %f %f %f %f", 
 	      abscatdir, Nsecfilt, table->hosts[i].hostID, table->hosts[i].pathname, 
 	      UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax
@@ -122,6 +122,6 @@
 
     char tmpline[DVO_MAX_PATH];
-    if (VERBOSE)    { snprintf (tmpline, DVO_MAX_PATH, "%s -v",      command);             strcpy (command, tmpline); }
-    if (SINGLE_CPT) { snprintf (tmpline, DVO_MAX_PATH, "%s -cpt %s", command, SINGLE_CPT); strcpy (command, tmpline); }
+    if (VERBOSE)    { snprintf_nowarn (tmpline, DVO_MAX_PATH, "%s -v",      command);             strcpy (command, tmpline); }
+    if (SINGLE_CPT) { snprintf_nowarn (tmpline, DVO_MAX_PATH, "%s -cpt %s", command, SINGLE_CPT); strcpy (command, tmpline); }
 
     fprintf (stderr, "command: %s\n", command);
Index: /trunk/Ohana/src/dvopsps/src/insert_FGshape_dvopsps.c
===================================================================
--- /trunk/Ohana/src/dvopsps/src/insert_FGshape_dvopsps.c	(revision 42388)
+++ /trunk/Ohana/src/dvopsps/src/insert_FGshape_dvopsps.c	(revision 42389)
@@ -47,5 +47,5 @@
 
     char localFilename[1024];
-    snprintf (localFilename, 1024, "%s/%s.cpt", HOSTDIR, skylist->regions[i]->name);
+    snprintf_nowarn (localFilename, 1024, "%s/%s.cpt", HOSTDIR, skylist->regions[i]->name);
 
     // set up the basic catalog info
@@ -125,16 +125,16 @@
 
     char command[1024];
-    snprintf (command, 1024, "dvopsps_client forced_galaxy_shape -hostID %d -catdir %s -hostdir %s -region %f %f %f %f", 
+    snprintf_nowarn (command, 1024, "dvopsps_client forced_galaxy_shape -hostID %d -catdir %s -hostdir %s -region %f %f %f %f", 
 	      table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, 
 	      UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
 
     char tmpline[1024];
-    snprintf (tmpline, 1024, "%s -dbhost %s", command, DATABASE_HOST); strcpy (command, tmpline);
-    snprintf (tmpline, 1024, "%s -dbuser %s", command, DATABASE_USER); strcpy (command, tmpline);
-    snprintf (tmpline, 1024, "%s -dbpass %s", command, DATABASE_PASS); strcpy (command, tmpline);
-    snprintf (tmpline, 1024, "%s -dbname %s", command, DATABASE_NAME); strcpy (command, tmpline);
+    snprintf_nowarn (tmpline, 1024, "%s -dbhost %s", command, DATABASE_HOST); strcpy (command, tmpline);
+    snprintf_nowarn (tmpline, 1024, "%s -dbuser %s", command, DATABASE_USER); strcpy (command, tmpline);
+    snprintf_nowarn (tmpline, 1024, "%s -dbpass %s", command, DATABASE_PASS); strcpy (command, tmpline);
+    snprintf_nowarn (tmpline, 1024, "%s -dbname %s", command, DATABASE_NAME); strcpy (command, tmpline);
 
-    if (VERBOSE)    { snprintf (tmpline, 1024, "%s -v",      command);             strcpy (command, tmpline); }
-    if (SINGLE_CPT) { snprintf (tmpline, 1024, "%s -cpt %s", command, SINGLE_CPT); strcpy (command, tmpline); }
+    if (VERBOSE)    { snprintf_nowarn (tmpline, 1024, "%s -v",      command);             strcpy (command, tmpline); }
+    if (SINGLE_CPT) { snprintf_nowarn (tmpline, 1024, "%s -cpt %s", command, SINGLE_CPT); strcpy (command, tmpline); }
 
     fprintf (stderr, "command: %s\n", command);
Index: /trunk/Ohana/src/dvopsps/src/insert_FWobjects_dvopsps.c
===================================================================
--- /trunk/Ohana/src/dvopsps/src/insert_FWobjects_dvopsps.c	(revision 42388)
+++ /trunk/Ohana/src/dvopsps/src/insert_FWobjects_dvopsps.c	(revision 42389)
@@ -47,5 +47,5 @@
 
     char localFilename[1024];
-    snprintf (localFilename, 1024, "%s/%s.cpt", HOSTDIR, skylist->regions[i]->name);
+    snprintf_nowarn (localFilename, 1024, "%s/%s.cpt", HOSTDIR, skylist->regions[i]->name);
 
     // set up the basic catalog info
@@ -126,17 +126,17 @@
 
     char command[1024];
-    snprintf (command, 1024, "dvopsps_client forced_warp_objects -hostID %d -catdir %s -hostdir %s -region %f %f %f %f", 
+    snprintf_nowarn (command, 1024, "dvopsps_client forced_warp_objects -hostID %d -catdir %s -hostdir %s -region %f %f %f %f", 
 	      table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, 
 	      UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
 
     char tmpline[1024];
-    snprintf (tmpline, 1024, "%s -dbhost %s", command, DATABASE_HOST); strcpy (command, tmpline);
-    snprintf (tmpline, 1024, "%s -dbuser %s", command, DATABASE_USER); strcpy (command, tmpline);
-    snprintf (tmpline, 1024, "%s -dbpass %s", command, DATABASE_PASS); strcpy (command, tmpline);
-    snprintf (tmpline, 1024, "%s -dbname %s", command, DATABASE_NAME); strcpy (command, tmpline);
+    snprintf_nowarn (tmpline, 1024, "%s -dbhost %s", command, DATABASE_HOST); strcpy (command, tmpline);
+    snprintf_nowarn (tmpline, 1024, "%s -dbuser %s", command, DATABASE_USER); strcpy (command, tmpline);
+    snprintf_nowarn (tmpline, 1024, "%s -dbpass %s", command, DATABASE_PASS); strcpy (command, tmpline);
+    snprintf_nowarn (tmpline, 1024, "%s -dbname %s", command, DATABASE_NAME); strcpy (command, tmpline);
 
-    if (VERBOSE)    { snprintf (tmpline, 1024, "%s -v",         command);             strcpy (command, tmpline); }
-    if (TEST_MODE)  { snprintf (tmpline, 1024, "%s -test-mode", command);             strcpy (command, tmpline); }
-    if (SINGLE_CPT) { snprintf (tmpline, 1024, "%s -cpt %s",    command, SINGLE_CPT); strcpy (command, tmpline); }
+    if (VERBOSE)    { snprintf_nowarn (tmpline, 1024, "%s -v",         command);             strcpy (command, tmpline); }
+    if (TEST_MODE)  { snprintf_nowarn (tmpline, 1024, "%s -test-mode", command);             strcpy (command, tmpline); }
+    if (SINGLE_CPT) { snprintf_nowarn (tmpline, 1024, "%s -cpt %s",    command, SINGLE_CPT); strcpy (command, tmpline); }
 
     fprintf (stderr, "command: %s\n", command);
Index: /trunk/Ohana/src/elixir/src/ConfigInit.c
===================================================================
--- /trunk/Ohana/src/elixir/src/ConfigInit.c	(revision 42388)
+++ /trunk/Ohana/src/elixir/src/ConfigInit.c	(revision 42389)
@@ -98,6 +98,9 @@
   if (config == (char *) NULL) {
     fprintf (stderr, "ERROR: can't find configuration file %s\n", file);
-    if (file != (char *) NULL) free (file);
+    // XXX note: the test below fools gcc into thinking file could be NUL
+    // even though the test above forces an exit if it is NULL.
+    // if (file != (char *) NULL) free (file);
     Shutdown (1);
+    exit (2);
   }
   if (VERBOSE) fprintf (stderr, "loaded config file: %s\n", file);
Index: /trunk/Ohana/src/elixir/src/Photcodes.c
===================================================================
--- /trunk/Ohana/src/elixir/src/Photcodes.c	(revision 42388)
+++ /trunk/Ohana/src/elixir/src/Photcodes.c	(revision 42389)
@@ -72,4 +72,39 @@
   char name[256], path[256], ccd[80], mode[80];
   int i;
+
+  p = line;
+  while ((p = strchr (p, ',')) != (char *) NULL) { *p = ' '; }
+  sscanf (line, "%s %s %s %s", path, name, ccd, mode);
+
+  if (!strcasecmp (mode, "MEF")) {
+    snprintf_nowarn (fullname, 256, "%s/%s.fits", path, name);
+  } else {
+    snprintf_nowarn (fullname, 256, "%s/%s/%s%s.fits", path, name, name, ccd);
+  }
+
+  if (!gfits_read_header (fullname, &header)) {
+    fprintf (stderr, "ERROR: can't find image file %s (1)\n", fullname);
+    exit(0);
+  }
+  gfits_scan (&header, "DETECTOR", "%s", 1, detector);
+  gfits_scan (&header, "FILTER",   "%s", 1, filter);
+  gfits_free_header (&header);
+  
+  for (i = 0; i < strlen(detector); i++) { detector[i] = toupper (detector[i]); }
+  for (i = 0; i < strlen(filter); i++) { filter[i] = toupper (filter[i]); }
+
+  ALLOCATE (code, char, 256);
+  sprintf (code, "%s.%s.%s", detector, filter, ccd);
+  return (code);
+
+}
+
+char *BuildName (char *line) {
+
+  char *fullname;
+  char name[256], path[256], ccd[80], mode[80];
+  char *p;
+
+  ALLOCATE (fullname, char, 256);
 
   p = line;
@@ -83,39 +118,4 @@
   }
 
-  if (!gfits_read_header (fullname, &header)) {
-    fprintf (stderr, "ERROR: can't find image file %s (1)\n", fullname);
-    exit(0);
-  }
-  gfits_scan (&header, "DETECTOR", "%s", 1, detector);
-  gfits_scan (&header, "FILTER",   "%s", 1, filter);
-  gfits_free_header (&header);
-  
-  for (i = 0; i < strlen(detector); i++) { detector[i] = toupper (detector[i]); }
-  for (i = 0; i < strlen(filter); i++) { filter[i] = toupper (filter[i]); }
-
-  ALLOCATE (code, char, 256);
-  sprintf (code, "%s.%s.%s", detector, filter, ccd);
-  return (code);
-
-}
-
-char *BuildName (char *line) {
-
-  char *fullname;
-  char name[256], path[256], ccd[80], mode[80];
-  char *p;
-
-  ALLOCATE (fullname, char, 256);
-
-  p = line;
-  while ((p = strchr (p, ',')) != (char *) NULL) { *p = ' '; }
-  sscanf (line, "%s %s %s %s", path, name, ccd, mode);
-
-  if (!strcasecmp (mode, "MEF")) {
-    sprintf (fullname, "%s/%s.fits", path, name);
-  } else {
-    sprintf (fullname, "%s/%s/%s%s.fits", path, name, name, ccd);
-  }
-
   return (fullname);
 
@@ -172,6 +172,5 @@
 
   ALLOCATE (root, char, Nbyte + 1);
-  strncpy (root, p1, Nbyte);
-  root[Nbyte] = 0;
+  strncpy_nowarn (root, p1, Nbyte);
   
   return (root);
@@ -195,6 +194,5 @@
   Nbyte = p1-file;
   ALLOCATE (path, char, Nbyte + 1);
-  strncpy (path, file, Nbyte);
-  path[Nbyte] = 0;
+  strncpy_nowarn (path, file, Nbyte);
   
   return (path);
@@ -232,6 +230,5 @@
   Nbyte = (p1 - p2);
   ALLOCATE (path, char, Nbyte + 1);
-  strncpy (path, p2, Nbyte);
-  path[Nbyte] = 0;
+  strncpy_nowarn (path, p2, Nbyte);
   
   return (path);
Index: /trunk/Ohana/src/elixir/src/ProcessOps.c
===================================================================
--- /trunk/Ohana/src/elixir/src/ProcessOps.c	(revision 42388)
+++ /trunk/Ohana/src/elixir/src/ProcessOps.c	(revision 42389)
@@ -69,5 +69,5 @@
 	REALLOCATE (value, char, Nbyte);
       }    
-      strncpy (&value[Nout], p1, Ncpy);
+      strncpy_nowarn (&value[Nout], p1, Ncpy);
       Nout += Ncpy;
       p2 ++;
@@ -90,7 +90,6 @@
       REALLOCATE (value, char, Nbyte);
     }    
-    strncpy (&value[Nout], p1, Ncpy);
+    strncpy_nowarn (&value[Nout], p1, Ncpy);
     Nout += Ncpy;
-    value[Nout] = 0;
   }
 
Index: /trunk/Ohana/src/fakeastro/src/AstromOffsetMapOps.c
===================================================================
--- /trunk/Ohana/src/fakeastro/src/AstromOffsetMapOps.c	(revision 42388)
+++ /trunk/Ohana/src/fakeastro/src/AstromOffsetMapOps.c	(revision 42389)
@@ -6,5 +6,5 @@
 
   char mapfile[DVO_MAX_PATH];
-  snprintf (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", CATDIR);
+  snprintf_nowarn (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", CATDIR);
   AstromOffsetMapSave (table, mapfile);
 
Index: /trunk/Ohana/src/fakeastro/src/ConfigInit.c
===================================================================
--- /trunk/Ohana/src/fakeastro/src/ConfigInit.c	(revision 42388)
+++ /trunk/Ohana/src/fakeastro/src/ConfigInit.c	(revision 42389)
@@ -4,5 +4,5 @@
 
   char  *config, *file;
-  char CatdirPhotcodeFile[256];
+  char CatdirPhotcodeFile[DVO_MAX_PATH];
 
   /*** load configuration info ***/
@@ -90,5 +90,5 @@
 
   /* update master photcode table if not defined */
-  sprintf (CatdirPhotcodeFile, "%s/Photcodes.dat", CATDIR_CHECK);
+  snprintf_nowarn (CatdirPhotcodeFile, DVO_MAX_PATH, "%s/Photcodes.dat", CATDIR_CHECK);
   if (!LoadPhotcodes (CatdirPhotcodeFile, MasterPhotcodeFile, TRUE)) {
     fprintf (stderr, "error loading photcode table %s\n", CatdirPhotcodeFile);
Index: /trunk/Ohana/src/fakeastro/src/save_fakestars.c
===================================================================
--- /trunk/Ohana/src/fakeastro/src/save_fakestars.c	(revision 42388)
+++ /trunk/Ohana/src/fakeastro/src/save_fakestars.c	(revision 42389)
@@ -18,5 +18,5 @@
     // save to a unique filename
     char filename[1024]; // CATDIR/tmpdir/starpar.PID.index.fits
-    snprintf (filename, 1024, "%s/tmpdir/starpar.%s.%05d.fits", CATDIR, uniquer, region->index);
+    snprintf_nowarn (filename, 1024, "%s/tmpdir/starpar.%s.%05d.fits", CATDIR, uniquer, region->index);
 
     // write the data to the given FITS file
Index: /trunk/Ohana/src/fixcat/src/aregion.c
===================================================================
--- /trunk/Ohana/src/fixcat/src/aregion.c	(revision 42388)
+++ /trunk/Ohana/src/fixcat/src/aregion.c	(revision 42389)
@@ -84,6 +84,5 @@
   Fread (buffer, 1, 48*NDecLines[NBigDec], f, "char");
   for (i = 0; !done && (i < NDecLines[NBigDec]); i++) {
-    strncpy (temp, &buffer[i*48], 48);
-    temp[49] = 0;
+    strncpy_nowarn (temp, &buffer[i*48], 48);
     hstgsc_hms_to_deg (&RA0, &RA1, &DEC0, &DEC1, &temp[7]);
     if (RA1 < RA0) RA1 += 360.0;
Index: /trunk/Ohana/src/gastro/src/getusno.c
===================================================================
--- /trunk/Ohana/src/gastro/src/getusno.c	(revision 42388)
+++ /trunk/Ohana/src/gastro/src/getusno.c	(revision 42389)
@@ -9,4 +9,6 @@
   1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10};
 
+# define MY_MAX_PATH 256
+
 USNOdata *getusno (USNOstats *usnostats, CatStats *catstats, int *Nusno) {
 
@@ -15,5 +17,5 @@
   float hours[100];
   int start[100], number[100], *buffer, *buf;
-  char filename[128], c;
+  char filename[MY_MAX_PATH], c;
   FILE *f;
   double DEC1;
@@ -52,5 +54,5 @@
     
     /* load accelerator file */
-    sprintf (filename, "%s/zone%04d.acc", CDROM, spd); 
+    snprintf_nowarn (filename, MY_MAX_PATH, "%s/zone%04d.acc", CDROM, spd); 
     fprintf (stderr, "reading from %s\n", filename);
     f = fopen (filename, "r");
@@ -82,5 +84,5 @@
     
     /* open data file */
-    sprintf (filename, "%s/zone%04d.cat", CDROM, spd);
+    snprintf_nowarn (filename, MY_MAX_PATH, "%s/zone%04d.cat", CDROM, spd);
     fprintf (stderr, "reading from %s\n", filename);
     f = fopen (filename, "r");
Index: /trunk/Ohana/src/gastro2/src/getusno.c
===================================================================
--- /trunk/Ohana/src/gastro2/src/getusno.c	(revision 42388)
+++ /trunk/Ohana/src/gastro2/src/getusno.c	(revision 42389)
@@ -9,4 +9,6 @@
   1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10};
 
+# define MY_MAX_PATH 256
+
 int getusno (CatStats *catstats, RefCatalog *Ref) {
 
@@ -15,5 +17,5 @@
   float hours[100];
   int start[100], number[100], *buffer, *buf;
-  char filename[128];
+  char filename[MY_MAX_PATH];
   FILE *f;
   double DEC1;
@@ -54,5 +56,5 @@
     
     /* load accelerator file */
-    sprintf (filename, "%s/zone%04d.acc", USNO_A_DIR, spd); 
+    snprintf_nowarn (filename, MY_MAX_PATH, "%s/zone%04d.acc", USNO_A_DIR, spd); 
     fprintf (stderr, "reading from %s\n", filename);
     f = fopen (filename, "r");
@@ -77,5 +79,5 @@
     
     /* open data file */
-    sprintf (filename, "%s/zone%04d.cat", USNO_A_DIR, spd);
+    snprintf_nowarn (filename, MY_MAX_PATH, "%s/zone%04d.cat", USNO_A_DIR, spd);
     fprintf (stderr, "reading from %s\n", filename);
     f = fopen (filename, "r");
Index: /trunk/Ohana/src/gastro2/src/getusnob.c
===================================================================
--- /trunk/Ohana/src/gastro2/src/getusnob.c	(revision 42388)
+++ /trunk/Ohana/src/gastro2/src/getusnob.c	(revision 42389)
@@ -2,4 +2,6 @@
 # define NBYTE   4
 # define NELEM  20
+
+# define MY_MAX_PATH 256
 
 int getusnob (CatStats *catstats, RefCatalog *Ref, double epoch) {
@@ -9,5 +11,5 @@
   float hours[100];
   int start[100], number[100], *buffer, *buf;
-  char filename[128];
+  char filename[MY_MAX_PATH];
   FILE *f;
   double DEC1;
@@ -42,5 +44,5 @@
     
     /* load accelerator file */
-    sprintf (filename, "%s/%03d/b%04d.acc", USNO_B_DIR, (int)(spd/10), spd); 
+    snprintf_nowarn (filename, MY_MAX_PATH, "%s/%03d/b%04d.acc", USNO_B_DIR, (int)(spd/10), spd); 
     if (VERBOSE) fprintf (stderr, "reading from %s\n", filename);
     f = fopen (filename, "r");
@@ -65,5 +67,5 @@
     
     /* open data file */
-    sprintf (filename, "%s/%03d/b%04d.cat", USNO_B_DIR, (int)(spd/10), spd); 
+    snprintf_nowarn (filename, MY_MAX_PATH, "%s/%03d/b%04d.cat", USNO_B_DIR, (int)(spd/10), spd); 
     if (VERBOSE) fprintf (stderr, "reading from %s\n", filename);
     f = fopen (filename, "r");
Index: /trunk/Ohana/src/getstar/src/ConfigInit.c
===================================================================
--- /trunk/Ohana/src/getstar/src/ConfigInit.c	(revision 42388)
+++ /trunk/Ohana/src/getstar/src/ConfigInit.c	(revision 42389)
@@ -1,8 +1,10 @@
 # include "getstar.h"
+
+# define MY_MAX_PATH 256
 
 int ConfigInit (int *argc, char **argv) {
 
   char *config, *file;
-  char CatdirPhotcodeFile[256];
+  char CatdirPhotcodeFile[MY_MAX_PATH];
 
   /*** load configuration info ***/
@@ -31,5 +33,5 @@
 
   /* XXX this does not yet write out the master photcode table */
-  sprintf (CatdirPhotcodeFile, "%s/Photcodes.dat", CATDIR);
+  snprintf_nowarn (CatdirPhotcodeFile, MY_MAX_PATH, "%s/Photcodes.dat", CATDIR);
   if (!LoadPhotcodes (CatdirPhotcodeFile, NULL, FALSE)) {
     fprintf (stderr, "error loading photcode table %s\n", CatdirPhotcodeFile);
Index: /trunk/Ohana/src/getstar/src/ConfigInit_coords.c
===================================================================
--- /trunk/Ohana/src/getstar/src/ConfigInit_coords.c	(revision 42388)
+++ /trunk/Ohana/src/getstar/src/ConfigInit_coords.c	(revision 42389)
@@ -25,5 +25,5 @@
     SKY_TABLE[0] = 0;
   }
-  sprintf (ImageCat, "%s/Images.dat", CATDIR);
+  snprintf_nowarn (ImageCat, 256, "%s/Images.dat", CATDIR);
 
   /* used by parse_time to find time-related keywords */
Index: /trunk/Ohana/src/getstar/src/ConfigInit_extract.c
===================================================================
--- /trunk/Ohana/src/getstar/src/ConfigInit_extract.c	(revision 42388)
+++ /trunk/Ohana/src/getstar/src/ConfigInit_extract.c	(revision 42389)
@@ -25,5 +25,5 @@
     SKY_TABLE[0] = 0;
   }
-  sprintf (ImageCat, "%s/Images.dat", CATDIR);
+  snprintf_nowarn (ImageCat, 256, "%s/Images.dat", CATDIR);
 
   if (*CATMODE == 0) strcpy (CATMODE, "RAW");
Index: /trunk/Ohana/src/getstar/src/ConfigInit_overlaps.c
===================================================================
--- /trunk/Ohana/src/getstar/src/ConfigInit_overlaps.c	(revision 42388)
+++ /trunk/Ohana/src/getstar/src/ConfigInit_overlaps.c	(revision 42389)
@@ -25,5 +25,5 @@
     SKY_TABLE[0] = 0;
   }
-  sprintf (ImageCat, "%s/Images.dat", CATDIR);
+  snprintf_nowarn (ImageCat, 256, "%s/Images.dat", CATDIR);
 
   /* used by parse_time to find time-related keywords */
Index: /trunk/Ohana/src/imregister/base/ConfigInit.c
===================================================================
--- /trunk/Ohana/src/imregister/base/ConfigInit.c	(revision 42388)
+++ /trunk/Ohana/src/imregister/base/ConfigInit.c	(revision 42389)
@@ -6,7 +6,7 @@
 
   int i, NDB;
-  char *config, *file, ElixirBase[80], catdir[256];
-  char CatdirPhotcodeFile[256];
-  char MasterPhotcodeFile[256];
+  char *config, *file, ElixirBase[80], catdir[MY_MAX_PATH];
+  char CatdirPhotcodeFile[MY_MAX_PATH];
+  char MasterPhotcodeFile[MY_MAX_PATH];
 
   /*** load configuration info ***/
@@ -28,5 +28,5 @@
   WarnConfig (config, "CATDIR",                      "%s", 0, catdir);
   WarnConfig (config, "PHOTCODE_FILE",               "%s", 0, MasterPhotcodeFile);
-  sprintf (ImPhotDB, "%s/Images.dat", catdir);
+  snprintf_nowarn (ImPhotDB, MY_MAX_PATH, "%s/Images.dat", catdir);
 
   /* small text databases: filters, camera defs */ 
@@ -75,10 +75,10 @@
 						   
   WarnConfig (config, "imstats",                     "%s", 0, ElixirBase);
-  sprintf (ImstatFifo, "%s.photcode", ElixirBase);   
+  snprintf_nowarn (ImstatFifo, MY_MAX_PATH, "%s.photcode", ElixirBase);   
   WarnConfig (config, "ptolemy",                     "%s", 0, ElixirBase);
-  sprintf (PtolemyFifo, "%s.photcode", ElixirBase);
+  snprintf_nowarn (PtolemyFifo, MY_MAX_PATH, "%s.photcode", ElixirBase);
 
   if (!ScanConfig (config, "CONNECT", "%s",  0, CONNECT)) {
-    sprintf (CONNECT, "/usr/bin/rsh");
+    snprintf_nowarn (CONNECT, 64, "/usr/bin/rsh");
   }
 
@@ -87,5 +87,5 @@
   NDetrendAltDB = 0;
   ALLOCATE (DetrendAltDB, char *, NDB);
-  ALLOCATE (DetrendAltDB[NDetrendAltDB], char, 256);
+  ALLOCATE (DetrendAltDB[NDetrendAltDB], char, MY_MAX_PATH);
   for (i = 1; ScanConfig (config, "DETREND_ALT_DB", "%s", i, DetrendAltDB[NDetrendAltDB]); i++) {
     NDetrendAltDB ++;
@@ -94,5 +94,5 @@
       REALLOCATE (DetrendAltDB, char *, NDB);
     }
-    ALLOCATE (DetrendAltDB[NDetrendAltDB], char, 256);
+    ALLOCATE (DetrendAltDB[NDetrendAltDB], char, MY_MAX_PATH);
   }
   free (DetrendAltDB[NDetrendAltDB]);
@@ -104,5 +104,5 @@
 
   /* XXX this does not yet write out the master photcode table */
-  sprintf (CatdirPhotcodeFile, "%s/Photcodes.dat", catdir);
+  snprintf_nowarn (CatdirPhotcodeFile, MY_MAX_PATH, "%s/Photcodes.dat", catdir);
   if (!LoadPhotcodes (CatdirPhotcodeFile, MasterPhotcodeFile, TRUE)) {
     fprintf (stderr, "error loading photcode table %s or master file %s\n", CatdirPhotcodeFile, MasterPhotcodeFile);
Index: /trunk/Ohana/src/imregister/base/fits_scan_nchar.c
===================================================================
--- /trunk/Ohana/src/imregister/base/fits_scan_nchar.c	(revision 42388)
+++ /trunk/Ohana/src/imregister/base/fits_scan_nchar.c	(revision 42389)
@@ -20,6 +20,5 @@
 
   status = gfits_scan (header, field, "%s", N, tmpstr); 
-  strncpy (outstr, tmpstr, size - 1);
-  outstr[size-1] = 0; 
+  strncpy_nowarn (outstr, tmpstr, size - 1);
 
   return (status);
Index: /trunk/Ohana/src/imregister/detrend/entry.c
===================================================================
--- /trunk/Ohana/src/imregister/detrend/entry.c	(revision 42388)
+++ /trunk/Ohana/src/imregister/detrend/entry.c	(revision 42389)
@@ -31,5 +31,6 @@
   int status;
   int found, Ntry, filestate;
-  char path[256], fullpath[256], filename[256], rootname[256], fullname[256], line[512];
+  char path[MY_MAX_PATH], fullpath[MY_MAX_PATH], filename[MY_MAX_PATH];
+  char rootname[MY_MAX_PATH], fullname[MY_MAX_PATH], line[512];
   char *dBPath;
   char *filter_basename;
@@ -41,9 +42,9 @@
 
   if (newdata[0].type == T_FLAT) {
-    sprintf (path, "%s/%s", get_type_name(newdata[0].type), filter_basename);
+    snprintf_nowarn (path, MY_MAX_PATH, "%s/%s", get_type_name(newdata[0].type), filter_basename);
   } else {
-    sprintf (path, "%s", get_type_name(newdata[0].type));
+    snprintf_nowarn (path, MY_MAX_PATH, "%s", get_type_name(newdata[0].type));
   }    
-  sprintf (fullpath, "%s/%s", dBPath, path);
+  snprintf_nowarn (fullpath, MY_MAX_PATH, "%s/%s", dBPath, path);
 
   status = stat (fullpath, &statbuf);
@@ -65,8 +66,8 @@
   case T_BIAS:
   case T_MASK:
-    sprintf (rootname, "%s.%s.%d.%02d", ID, get_type_name(newdata[0].type), (int)newdata[0].exptime, newdata[0].ccd);
+    snprintf_nowarn (rootname, MY_MAX_PATH, "%s.%s.%d.%02d", ID, get_type_name(newdata[0].type), (int)newdata[0].exptime, newdata[0].ccd);
     break;
   default:
-    sprintf (rootname, "%s.%s.%s.%02d", ID, get_type_name(newdata[0].type), filter_basename, newdata[0].ccd);
+    snprintf_nowarn (rootname, MY_MAX_PATH, "%s.%s.%s.%02d", ID, get_type_name(newdata[0].type), filter_basename, newdata[0].ccd);
   }
 
@@ -74,6 +75,6 @@
   found = FALSE;
   for (Ntry = 0; !found && (Ntry < 100); Ntry++) {
-    sprintf (filename, "%s/%s.%02d.fits", path, rootname, Ntry);
-    sprintf (fullname, "%s/%s", dBPath, filename);
+    snprintf_nowarn (filename, MY_MAX_PATH, "%s/%s.%02d.fits", path, rootname, Ntry);
+    snprintf_nowarn (fullname, MY_MAX_PATH, "%s/%s", dBPath, filename);
     f = fsetlockfile (fullname, 2.0, LCK_XCLD, &filestate);
     /* if there is an error, it may just mean file is locked. */
Index: /trunk/Ohana/src/imregister/detrend/output.c
===================================================================
--- /trunk/Ohana/src/imregister/detrend/output.c	(revision 42388)
+++ /trunk/Ohana/src/imregister/detrend/output.c	(revision 42389)
@@ -148,5 +148,5 @@
     }
     bzero (key, 33);
-    strncpy (key, p, 32);
+    strncpy_nowarn (key, p, 32);
     if ((p = strrchr (key, '.')) != (char *) NULL) *p = 0;
 
Index: /trunk/Ohana/src/imregister/imreg/args.imregister.c
===================================================================
--- /trunk/Ohana/src/imregister/imreg/args.imregister.c	(revision 42388)
+++ /trunk/Ohana/src/imregister/imreg/args.imregister.c	(revision 42389)
@@ -73,6 +73,6 @@
 
     /* create db.log and db.bfr */
-    sprintf (TempDB, "%s.bfr", ImageDB);
-    sprintf (LogFile, "%s.log", ImageDB);
+    snprintf_nowarn (TempDB, MY_MAX_PATH, "%s.bfr", ImageDB);
+    snprintf_nowarn (LogFile, MY_MAX_PATH, "%s.log", ImageDB);
     
     /* check for daemon mode */
Index: /trunk/Ohana/src/imregister/imreg/iminfo.c
===================================================================
--- /trunk/Ohana/src/imregister/imreg/iminfo.c	(revision 42388)
+++ /trunk/Ohana/src/imregister/imreg/iminfo.c	(revision 42389)
@@ -91,11 +91,9 @@
   /* force strings to fit in available space (32 bytes) */
   gfits_scan (&header, CameraKeyword,     "%s", 1, line);
-  strncpy (image[0].instrument, line, 31);
-  image[0].instrument[31] = 0;
+  strncpy_nowarn (image[0].instrument, line, 31);
 
   gfits_scan (&header, FilterKeyword, "%s", 1, line);
   MatchFilterList (line);
-  strncpy (image[0].filter, line, 31);
-  image[0].filter[31] = 0;
+  strncpy_nowarn (image[0].filter, line, 31);
 
   /* header has RA & DEC in decimal degrees */
Index: /trunk/Ohana/src/imregister/imreg/modify.c
===================================================================
--- /trunk/Ohana/src/imregister/imreg/modify.c	(revision 42388)
+++ /trunk/Ohana/src/imregister/imreg/modify.c	(revision 42389)
@@ -69,5 +69,5 @@
 
     if (output.modify_filter) {
-      strncpy (image[i].filter, output.filter, 31);
+      strncpy_nowarn (image[i].filter, output.filter, 31);
     }
 
Index: /trunk/Ohana/src/imregister/include/imregister.h
===================================================================
--- /trunk/Ohana/src/imregister/include/imregister.h	(revision 42388)
+++ /trunk/Ohana/src/imregister/include/imregister.h	(revision 42389)
@@ -11,14 +11,16 @@
 */
 
-char ImstatFifo[256];
-char PtolemyFifo[256];
+# define MY_MAX_PATH 256
 
-char ImageDB[256];
-char DetrendDB[256];
-char PhotDB[256];
-char TransDB[256];
-char ImPhotDB[256];
-char TempDB[256];
-char LogFile[256];
+char ImstatFifo[MY_MAX_PATH];
+char PtolemyFifo[MY_MAX_PATH];
+
+char ImageDB[MY_MAX_PATH];
+char DetrendDB[MY_MAX_PATH];
+char PhotDB[MY_MAX_PATH];
+char TransDB[MY_MAX_PATH];
+char ImPhotDB[MY_MAX_PATH];
+char TempDB[MY_MAX_PATH];
+char LogFile[MY_MAX_PATH];
 char CONNECT[64];
 
@@ -26,9 +28,9 @@
 char **DetrendAltDB;
 
-char PhotCodeFile[256];
-char TempLogFile[256];
-char FilterList[256];
-char CameraConfig[256];
-char RecipeFile[256];
+char PhotCodeFile[MY_MAX_PATH];
+char TempLogFile[MY_MAX_PATH];
+char FilterList[MY_MAX_PATH];
+char CameraConfig[MY_MAX_PATH];
+char RecipeFile[MY_MAX_PATH];
 
 char DateKeyword[64];
Index: /trunk/Ohana/src/imregister/photreg/getImageData.c
===================================================================
--- /trunk/Ohana/src/imregister/photreg/getImageData.c	(revision 42388)
+++ /trunk/Ohana/src/imregister/photreg/getImageData.c	(revision 42389)
@@ -60,5 +60,5 @@
   }
 
-  sprintf (photcode, "%s.%s.%02d", detector, filter, ccd);
+  snprintf_nowarn (photcode, 64, "%s.%s.%02d", detector, filter, ccd);
   if (!(criteria.photcode = GetPhotcodeCodebyName (photcode))) {
     fprintf (stderr, "ERR: photcode not found table\n");
Index: /trunk/Ohana/src/imregister/src/photcode-table.c
===================================================================
--- /trunk/Ohana/src/imregister/src/photcode-table.c	(revision 42388)
+++ /trunk/Ohana/src/imregister/src/photcode-table.c	(revision 42389)
@@ -60,5 +60,5 @@
 
   char *config, *file;
-  char CATDIR[256];
+  char CATDIR[MY_MAX_PATH];
 
   /*** load configuration info ***/
@@ -76,5 +76,5 @@
   
   // set the CATDIR version based on CATDIR
-  sprintf (CatdirPhotcodeFile, "%s/Photcodes.dat", CATDIR);
+  snprintf_nowarn (CatdirPhotcodeFile, MY_MAX_PATH, "%s/Photcodes.dat", CATDIR);
 
   free (config);
Index: /trunk/Ohana/src/kapa2/cmaps/brewer.ygb.cm
===================================================================
--- /trunk/Ohana/src/kapa2/cmaps/brewer.ygb.cm	(revision 42389)
+++ /trunk/Ohana/src/kapa2/cmaps/brewer.ygb.cm	(revision 42389)
@@ -0,0 +1,11 @@
+0.00000, 1.00000, 1.00000, 1.00000
+0.09091, 0.99609, 0.99609, 0.84766
+0.18182, 0.92578, 0.96875, 0.69141
+0.27273, 0.77734, 0.91016, 0.70312
+0.36364, 0.49609, 0.80078, 0.73047
+0.45455, 0.25391, 0.71094, 0.76562
+0.54545, 0.11328, 0.56641, 0.75000
+0.63636, 0.13281, 0.36719, 0.65625
+0.72727, 0.14453, 0.20312, 0.57812
+0.81818, 0.03125, 0.11328, 0.34375
+1.00000, 0.00000, 0.00000, 0.00000
Index: /trunk/Ohana/src/kapa2/cmaps/brewer.ygb.rev.cm
===================================================================
--- /trunk/Ohana/src/kapa2/cmaps/brewer.ygb.rev.cm	(revision 42389)
+++ /trunk/Ohana/src/kapa2/cmaps/brewer.ygb.rev.cm	(revision 42389)
@@ -0,0 +1,13 @@
+0.00000, 0.00000, 0.00000, 0.00000
+0.09091, 0.03125, 0.11328, 0.34375
+0.18182, 0.14453, 0.20312, 0.57812
+0.27273, 0.13281, 0.36719, 0.65625
+0.36364, 0.11328, 0.56641, 0.75000
+0.45455, 0.25391, 0.71094, 0.76562
+0.54545, 0.49609, 0.80078, 0.73047
+0.75000, 0.77734, 0.91016, 0.70312
+0.85000, 0.92578, 0.96875, 0.69141
+0.95000, 0.99609, 0.99609, 0.84766
+1.00000, 0.99609, 0.99609, 0.95000
+# 1.00000, 1.00000, 1.00000, 1.00000
+# 1.00000, 0.99609, 0.99609, 0.84766
Index: /trunk/Ohana/src/kapa2/cmaps/cividis.cm
===================================================================
--- /trunk/Ohana/src/kapa2/cmaps/cividis.cm	(revision 42389)
+++ /trunk/Ohana/src/kapa2/cmaps/cividis.cm	(revision 42389)
@@ -0,0 +1,257 @@
+# https://arxiv.org/abs/1712.01662
+0.004 0.000 0.125 0.297
+0.008 0.000 0.125 0.305
+0.012 0.000 0.129 0.312
+0.016 0.000 0.133 0.316
+0.020 0.000 0.137 0.324
+0.023 0.000 0.137 0.332
+0.027 0.000 0.141 0.336
+0.031 0.000 0.145 0.344
+0.035 0.000 0.148 0.352
+0.039 0.000 0.148 0.355
+0.043 0.000 0.152 0.363
+0.047 0.000 0.156 0.371
+0.051 0.000 0.156 0.379
+0.055 0.000 0.160 0.387
+0.059 0.000 0.164 0.391
+0.062 0.000 0.164 0.398
+0.066 0.000 0.168 0.406
+0.070 0.000 0.172 0.414
+0.074 0.000 0.176 0.422
+0.078 0.000 0.176 0.426
+0.082 0.000 0.180 0.430
+0.086 0.000 0.180 0.434
+0.090 0.000 0.184 0.434
+0.094 0.000 0.184 0.434
+0.098 0.000 0.188 0.434
+0.102 0.000 0.191 0.434
+0.105 0.000 0.191 0.434
+0.109 0.000 0.195 0.430
+0.113 0.000 0.199 0.430
+0.117 0.000 0.203 0.430
+0.121 0.000 0.203 0.430
+0.125 0.004 0.207 0.430
+0.129 0.023 0.211 0.430
+0.133 0.039 0.215 0.426
+0.137 0.055 0.215 0.426
+0.141 0.070 0.219 0.426
+0.145 0.082 0.223 0.426
+0.148 0.090 0.223 0.426
+0.152 0.102 0.227 0.422
+0.156 0.109 0.230 0.422
+0.160 0.117 0.234 0.422
+0.164 0.125 0.234 0.422
+0.168 0.133 0.238 0.422
+0.172 0.141 0.242 0.422
+0.176 0.148 0.242 0.422
+0.180 0.152 0.246 0.422
+0.184 0.160 0.250 0.418
+0.188 0.168 0.254 0.418
+0.191 0.172 0.254 0.418
+0.195 0.180 0.258 0.418
+0.199 0.184 0.262 0.418
+0.203 0.191 0.266 0.418
+0.207 0.195 0.266 0.418
+0.211 0.199 0.270 0.418
+0.215 0.207 0.273 0.418
+0.219 0.211 0.273 0.418
+0.223 0.215 0.277 0.418
+0.227 0.219 0.281 0.418
+0.230 0.227 0.285 0.418
+0.234 0.230 0.285 0.418
+0.238 0.234 0.289 0.418
+0.242 0.238 0.293 0.418
+0.246 0.242 0.293 0.418
+0.250 0.250 0.297 0.418
+0.254 0.254 0.301 0.418
+0.258 0.258 0.305 0.418
+0.262 0.262 0.305 0.418
+0.266 0.266 0.309 0.418
+0.270 0.270 0.312 0.418
+0.273 0.273 0.312 0.418
+0.277 0.277 0.316 0.418
+0.281 0.281 0.320 0.418
+0.285 0.285 0.324 0.418
+0.289 0.289 0.324 0.418
+0.293 0.293 0.328 0.418
+0.297 0.297 0.332 0.418
+0.301 0.301 0.332 0.418
+0.305 0.305 0.336 0.418
+0.309 0.309 0.340 0.422
+0.312 0.312 0.344 0.422
+0.316 0.316 0.344 0.422
+0.320 0.320 0.348 0.422
+0.324 0.324 0.352 0.422
+0.328 0.328 0.352 0.422
+0.332 0.332 0.355 0.422
+0.336 0.336 0.359 0.422
+0.340 0.340 0.363 0.426
+0.344 0.344 0.363 0.426
+0.348 0.348 0.367 0.426
+0.352 0.352 0.371 0.426
+0.355 0.355 0.371 0.426
+0.359 0.359 0.375 0.426
+0.363 0.363 0.379 0.430
+0.367 0.367 0.383 0.430
+0.371 0.371 0.383 0.430
+0.375 0.371 0.387 0.430
+0.379 0.375 0.391 0.430
+0.383 0.379 0.395 0.434
+0.387 0.383 0.395 0.434
+0.391 0.387 0.398 0.434
+0.395 0.391 0.402 0.434
+0.398 0.395 0.402 0.434
+0.402 0.398 0.406 0.438
+0.406 0.402 0.410 0.438
+0.410 0.406 0.414 0.438
+0.414 0.406 0.414 0.438
+0.418 0.410 0.418 0.441
+0.422 0.414 0.422 0.441
+0.426 0.418 0.426 0.441
+0.430 0.422 0.426 0.445
+0.434 0.426 0.430 0.445
+0.438 0.430 0.434 0.445
+0.441 0.434 0.434 0.445
+0.445 0.434 0.438 0.449
+0.449 0.438 0.441 0.449
+0.453 0.441 0.445 0.449
+0.457 0.445 0.445 0.453
+0.461 0.449 0.449 0.453
+0.465 0.453 0.453 0.457
+0.469 0.457 0.457 0.457
+0.473 0.457 0.457 0.457
+0.477 0.461 0.461 0.461
+0.480 0.465 0.465 0.461
+0.484 0.469 0.469 0.461
+0.488 0.473 0.469 0.465
+0.492 0.477 0.473 0.465
+0.496 0.480 0.477 0.465
+0.500 0.480 0.480 0.469
+0.504 0.484 0.480 0.469
+0.508 0.488 0.484 0.469
+0.512 0.492 0.488 0.469
+0.516 0.496 0.492 0.469
+0.520 0.500 0.492 0.469
+0.523 0.504 0.496 0.469
+0.527 0.508 0.500 0.469
+0.531 0.512 0.504 0.469
+0.535 0.516 0.504 0.469
+0.539 0.520 0.508 0.469
+0.543 0.523 0.512 0.469
+0.547 0.527 0.516 0.469
+0.551 0.531 0.520 0.469
+0.555 0.535 0.520 0.469
+0.559 0.539 0.523 0.469
+0.562 0.543 0.527 0.469
+0.566 0.547 0.531 0.469
+0.570 0.551 0.531 0.469
+0.574 0.555 0.535 0.469
+0.578 0.559 0.539 0.469
+0.582 0.562 0.543 0.469
+0.586 0.566 0.547 0.469
+0.590 0.570 0.547 0.469
+0.594 0.574 0.551 0.469
+0.598 0.578 0.555 0.469
+0.602 0.582 0.559 0.469
+0.605 0.586 0.559 0.465
+0.609 0.590 0.562 0.465
+0.613 0.594 0.566 0.465
+0.617 0.598 0.570 0.465
+0.621 0.602 0.574 0.465
+0.625 0.605 0.574 0.465
+0.629 0.609 0.578 0.465
+0.633 0.613 0.582 0.465
+0.637 0.617 0.586 0.461
+0.641 0.621 0.590 0.461
+0.645 0.625 0.594 0.461
+0.648 0.629 0.594 0.461
+0.652 0.633 0.598 0.461
+0.656 0.637 0.602 0.457
+0.660 0.641 0.605 0.457
+0.664 0.645 0.609 0.457
+0.668 0.648 0.609 0.457
+0.672 0.652 0.613 0.457
+0.676 0.656 0.617 0.453
+0.680 0.660 0.621 0.453
+0.684 0.664 0.625 0.453
+0.688 0.668 0.629 0.453
+0.691 0.672 0.629 0.449
+0.695 0.676 0.633 0.449
+0.699 0.680 0.637 0.449
+0.703 0.684 0.641 0.449
+0.707 0.688 0.645 0.445
+0.711 0.691 0.648 0.445
+0.715 0.695 0.648 0.445
+0.719 0.703 0.652 0.441
+0.723 0.707 0.656 0.441
+0.727 0.711 0.660 0.441
+0.730 0.715 0.664 0.438
+0.734 0.719 0.668 0.438
+0.738 0.723 0.668 0.438
+0.742 0.727 0.672 0.434
+0.746 0.730 0.676 0.434
+0.750 0.734 0.680 0.430
+0.754 0.738 0.684 0.430
+0.758 0.742 0.688 0.430
+0.762 0.746 0.691 0.426
+0.766 0.750 0.691 0.426
+0.770 0.754 0.695 0.422
+0.773 0.758 0.699 0.422
+0.777 0.762 0.703 0.422
+0.781 0.770 0.707 0.418
+0.785 0.773 0.711 0.418
+0.789 0.777 0.715 0.414
+0.793 0.781 0.719 0.414
+0.797 0.785 0.719 0.410
+0.801 0.789 0.723 0.410
+0.805 0.793 0.727 0.406
+0.809 0.797 0.730 0.406
+0.812 0.801 0.734 0.402
+0.816 0.805 0.738 0.402
+0.820 0.812 0.742 0.398
+0.824 0.816 0.746 0.398
+0.828 0.820 0.750 0.395
+0.832 0.824 0.750 0.395
+0.836 0.828 0.754 0.391
+0.840 0.832 0.758 0.387
+0.844 0.836 0.762 0.387
+0.848 0.840 0.766 0.383
+0.852 0.844 0.770 0.379
+0.855 0.848 0.773 0.379
+0.859 0.855 0.777 0.375
+0.863 0.859 0.781 0.375
+0.867 0.863 0.785 0.371
+0.871 0.867 0.789 0.367
+0.875 0.871 0.793 0.363
+0.879 0.875 0.793 0.363
+0.883 0.879 0.797 0.359
+0.887 0.887 0.801 0.355
+0.891 0.891 0.805 0.355
+0.895 0.895 0.809 0.352
+0.898 0.898 0.812 0.348
+0.902 0.902 0.816 0.344
+0.906 0.906 0.820 0.340
+0.910 0.910 0.824 0.336
+0.914 0.918 0.828 0.336
+0.918 0.922 0.832 0.332
+0.922 0.926 0.836 0.328
+0.926 0.930 0.840 0.324
+0.930 0.934 0.844 0.320
+0.934 0.938 0.848 0.316
+0.938 0.941 0.852 0.312
+0.941 0.949 0.855 0.309
+0.945 0.953 0.859 0.305
+0.949 0.957 0.863 0.301
+0.953 0.961 0.867 0.297
+0.957 0.965 0.871 0.293
+0.961 0.973 0.875 0.285
+0.965 0.977 0.875 0.281
+0.969 0.980 0.879 0.277
+0.973 0.984 0.883 0.273
+0.977 0.988 0.887 0.270
+0.980 0.996 0.891 0.262
+0.984 0.996 0.895 0.258
+0.988 0.996 0.898 0.258
+0.992 0.996 0.902 0.262
+0.996 0.996 0.906 0.266
+1.000 0.996 0.910 0.270
Index: /trunk/Ohana/src/kapa2/cmaps/colormap.cm
===================================================================
--- /trunk/Ohana/src/kapa2/cmaps/colormap.cm	(revision 42389)
+++ /trunk/Ohana/src/kapa2/cmaps/colormap.cm	(revision 42389)
@@ -0,0 +1,3 @@
+0.00 1.0 1.0 1.0
+0.50 0.5 0.5 1.0
+1.00 0.0 0.0 1.0
Index: /trunk/Ohana/src/kapa2/cmaps/div.lanl.blueorange.cm
===================================================================
--- /trunk/Ohana/src/kapa2/cmaps/div.lanl.blueorange.cm	(revision 42389)
+++ /trunk/Ohana/src/kapa2/cmaps/div.lanl.blueorange.cm	(revision 42389)
@@ -0,0 +1,51 @@
+# LANL Asymmetric Blue/Orange Divergent W5
+# original order is rgb
+# NaN recommendation: r="0.250004" g="0" b="0"
+# 0.020833 0.349020  0.129412  0.000000
+0.000000 0.349020  0.129412  0.000000
+0.045000 0.400000  0.101961  0.003923
+0.069167 0.470588  0.090196  0.015686
+0.093333 0.549020  0.070588  0.027451
+0.117500 0.619608  0.043137  0.062745
+0.141667 0.690196  0.062745  0.125490
+0.165833 0.741176  0.074509  0.184314
+0.190000 0.788235  0.094117  0.266667
+0.214167 0.811765  0.113725  0.345098
+0.238333 0.831373  0.133333  0.411765
+0.262500 0.850980  0.145098  0.474510
+0.286667 0.870588  0.156863  0.549020
+0.310833 0.878431  0.168627  0.619608
+0.335000 0.890196  0.196078  0.658824
+0.359167 0.909804  0.235294  0.717647
+0.383333 0.929412  0.278431  0.776471
+0.403333 0.949020  0.321569  0.823529
+0.425833 0.968627  0.407843  0.874510
+0.450000 0.980392  0.509804  0.917647
+0.475000 0.988235  0.643137  0.956863
+#0.488333 0.992157  0.713725  0.964706
+#0.503333 0.988235  0.870588  0.980392
+# 0.504167 1.000000  1.000000  1.000000
+0.505000 0.913725  0.937255  0.988235
+0.520000 0.827451  0.886275  0.980392
+0.534167 0.764706  0.866667  0.980392
+0.549167 0.658824  0.843137  0.980392
+0.565833 0.572549  0.835294  0.964706
+0.589167 0.423529  0.874510  0.941176
+0.606667 0.262745  0.862745  0.901961
+0.630000 0.070588  0.870588  0.854902
+0.650833 0.050980  0.850980  0.800000
+0.680000 0.023529  0.831373  0.709804
+0.710000 0.031373  0.811765  0.615686
+0.745833 0.031373  0.788235  0.537255
+0.770000 0.039216  0.768627  0.466667
+0.794167 0.050980  0.741176  0.396078
+0.818333 0.054902  0.709804  0.317647
+0.842500 0.054902  0.678431  0.243137
+0.866667 0.043137  0.639216  0.164706
+0.890833 0.031373  0.600000  0.098039
+0.915000 0.039216  0.560784  0.039216
+0.939167 0.105882  0.509804  0.050980
+0.963333 0.113725  0.450980  0.023529
+1.000000 0.125490  0.380392  0.000000
+
+# 0.987500 0.125490  0.380392  0.000000
Index: /trunk/Ohana/src/kapa2/cmaps/div.redblack.cm
===================================================================
--- /trunk/Ohana/src/kapa2/cmaps/div.redblack.cm	(revision 42389)
+++ /trunk/Ohana/src/kapa2/cmaps/div.redblack.cm	(revision 42389)
@@ -0,0 +1,19 @@
+# create F 0 1.1 {1/11}
+# vlist B  31  43  77 130 199 255 224 186 135  77  26
+# vlist R 103 178 214 244 253 255 224 186 135  77  26
+# vlist G   0  24  96 165 219 255 224 186 135  77  26
+# set r = R / 256
+# set g = G / 256
+# set b = B / 256
+# print F r b g
+0.000000 0.402344 0.121094 0.000000 
+0.100000 0.695312 0.167969 0.093750 
+0.200000 0.835938 0.300781 0.375000 
+0.300000 0.953125 0.507812 0.644531 
+0.400000 0.988281 0.777344 0.855469 
+0.500000 0.996094 0.996094 0.996094 
+0.600000 0.875000 0.875000 0.875000 
+0.700000 0.726562 0.726562 0.726562 
+0.800000 0.527344 0.527344 0.527344 
+0.900000 0.300781 0.300781 0.300781 
+1.000000 0.101562 0.101562 0.101562 
Index: /trunk/Ohana/src/kapa2/cmaps/div.redblue.cm
===================================================================
--- /trunk/Ohana/src/kapa2/cmaps/div.redblue.cm	(revision 42389)
+++ /trunk/Ohana/src/kapa2/cmaps/div.redblue.cm	(revision 42389)
@@ -0,0 +1,11 @@
+0.000000 0.402344 0.121094 0.000000 
+0.100000 0.695312 0.167969 0.093750 
+0.200000 0.835938 0.300781 0.375000 
+0.300000 0.953125 0.507812 0.644531 
+0.400000 0.988281 0.777344 0.855469 
+0.500000 0.964844 0.964844 0.964844 
+0.600000 0.816406 0.937500 0.894531 
+0.700000 0.570312 0.867188 0.769531 
+0.800000 0.261719 0.761719 0.574219 
+0.900000 0.128906 0.671875 0.398438 
+1.000000 0.019531 0.378906 0.187500 
Index: /trunk/Ohana/src/kapa2/cmaps/fake_parula.cm
===================================================================
--- /trunk/Ohana/src/kapa2/cmaps/fake_parula.cm	(revision 42389)
+++ /trunk/Ohana/src/kapa2/cmaps/fake_parula.cm	(revision 42389)
@@ -0,0 +1,256 @@
+ 0.26710521,  0.03311059,  0.6188155 
+ 0.26493929,  0.04780926,  0.62261795
+ 0.26260545,  0.06084214,  0.62619176
+ 0.26009691,  0.07264411,  0.62951561
+ 0.25740785,  0.08360391,  0.63256745
+ 0.25453369,  0.09395358,  0.63532497
+ 0.25147146,  0.10384228,  0.6377661 
+ 0.24822014,  0.11337029,  0.6398697 
+ 0.24478105,  0.12260661,  0.64161629
+ 0.24115816,  0.131599  ,  0.6429888 
+ 0.23735836,  0.14038009,  0.64397346
+ 0.23339166,  0.14897137,  0.64456048
+ 0.22927127,  0.15738602,  0.64474476
+ 0.22501278,  0.16563165,  0.64452595
+ 0.22063349,  0.17371215,  0.64390834
+ 0.21616055,  0.18162302,  0.64290515
+ 0.21161851,  0.18936156,  0.64153295
+ 0.20703353,  0.19692415,  0.63981287
+ 0.20243273,  0.20430706,  0.63776986
+ 0.19784363,  0.211507  ,  0.63543183
+ 0.19329361,  0.21852157,  0.63282872
+ 0.18880937,  0.2253495 ,  0.62999156
+ 0.18442119,  0.23198815,  0.62695569
+ 0.18014936,  0.23844124,  0.62374886
+ 0.17601569,  0.24471172,  0.62040016
+ 0.17204028,  0.25080356,  0.61693715
+ 0.16824123,  0.25672163,  0.6133854 
+ 0.16463462,  0.26247158,  0.60976836
+ 0.16123449,  0.26805963,  0.60610723
+ 0.15805279,  0.27349243,  0.60242099
+ 0.15509948,  0.27877688,  0.59872645
+ 0.15238249,  0.28392004,  0.59503836
+ 0.14990781,  0.28892902,  0.59136956
+ 0.14767951,  0.29381086,  0.58773113
+ 0.14569979,  0.29857245,  0.58413255
+ 0.1439691 ,  0.30322055,  0.58058191
+ 0.14248613,  0.30776167,  0.57708599
+ 0.14124797,  0.31220208,  0.57365049
+ 0.14025018,  0.31654779,  0.57028011
+ 0.13948691,  0.32080454,  0.5669787 
+ 0.13895174,  0.32497744,  0.56375063
+ 0.13863958,  0.32907012,  0.56060453
+ 0.138537  ,  0.3330895 ,  0.55753513
+ 0.13863384,  0.33704026,  0.55454374
+ 0.13891931,  0.34092684,  0.55163126
+ 0.13938212,  0.34475344,  0.54879827
+ 0.14001061,  0.34852402,  0.54604503
+ 0.14079292,  0.35224233,  0.54337156
+ 0.14172091,  0.35590982,  0.54078769
+ 0.14277848,  0.35953205,  0.53828312
+ 0.14395358,  0.36311234,  0.53585661
+ 0.1452346 ,  0.36665374,  0.5335074 
+ 0.14661019,  0.3701591 ,  0.5312346 
+ 0.14807104,  0.37363011,  0.52904278
+ 0.1496059 ,  0.3770697 ,  0.52692951
+ 0.15120289,  0.3804813 ,  0.52488853
+ 0.15285214,  0.38386729,  0.52291854
+ 0.15454421,  0.38722991,  0.52101815
+ 0.15627225,  0.39056998,  0.5191937 
+ 0.15802555,  0.39389087,  0.5174364 
+ 0.15979549,  0.39719482,  0.51574311
+ 0.16157425,  0.40048375,  0.51411214
+ 0.16335571,  0.40375871,  0.51254622
+ 0.16513234,  0.40702178,  0.51104174
+ 0.1668964 ,  0.41027528,  0.50959299
+ 0.16864151,  0.41352084,  0.50819797
+ 0.17036277,  0.41675941,  0.50685814
+ 0.1720542 ,  0.41999269,  0.50557008
+ 0.17370932,  0.42322271,  0.50432818
+ 0.17532301,  0.42645082,  0.50313007
+ 0.17689176,  0.42967776,  0.50197686
+ 0.17841013,  0.43290523,  0.5008633 
+ 0.17987314,  0.43613477,  0.49978492
+ 0.18127676,  0.43936752,  0.49873901
+ 0.18261885,  0.44260392,  0.49772638
+ 0.18389409,  0.44584578,  0.49673978
+ 0.18509911,  0.44909409,  0.49577605
+ 0.18623135,  0.4523496 ,  0.494833  
+ 0.18728844,  0.45561305,  0.49390803
+ 0.18826671,  0.45888565,  0.49299567
+ 0.18916393,  0.46216809,  0.49209268
+ 0.18997879,  0.46546084,  0.49119678
+ 0.19070881,  0.46876472,  0.49030328
+ 0.19135221,  0.47208035,  0.48940827
+ 0.19190791,  0.47540815,  0.48850845
+ 0.19237491,  0.47874852,  0.4876002 
+ 0.19275204,  0.48210192,  0.48667935
+ 0.19303899,  0.48546858,  0.48574251
+ 0.19323526,  0.48884877,  0.48478573
+ 0.19334062,  0.49224271,  0.48380506
+ 0.19335574,  0.49565037,  0.4827974 
+ 0.19328143,  0.49907173,  0.48175948
+ 0.19311664,  0.50250719,  0.48068559
+ 0.192864  ,  0.50595628,  0.47957408
+ 0.19252521,  0.50941877,  0.47842186
+ 0.19210087,  0.51289469,  0.47722441
+ 0.19159194,  0.516384  ,  0.47597744
+ 0.19100267,  0.51988593,  0.47467988
+ 0.19033595,  0.52340005,  0.47332894
+ 0.18959113,  0.5269267 ,  0.47191795
+ 0.18877336,  0.530465  ,  0.47044603
+ 0.18788765,  0.53401416,  0.46891178
+ 0.18693822,  0.53757359,  0.46731272
+ 0.18592276,  0.54114404,  0.46563962
+ 0.18485204,  0.54472367,  0.46389595
+ 0.18373148,  0.5483118 ,  0.46207951
+ 0.18256585,  0.55190791,  0.4601871 
+ 0.18135481,  0.55551253,  0.45821002
+ 0.18011172,  0.55912361,  0.45615277
+ 0.17884392,  0.56274038,  0.45401341
+ 0.17755858,  0.56636217,  0.45178933
+ 0.17625543,  0.56998972,  0.44946971
+ 0.174952  ,  0.57362064,  0.44706119
+ 0.17365805,  0.57725408,  0.44456198
+ 0.17238403,  0.58088916,  0.4419703 
+ 0.17113321,  0.58452637,  0.43927576
+ 0.1699221 ,  0.58816399,  0.43648119
+ 0.1687662 ,  0.5918006 ,  0.43358772
+ 0.16767908,  0.59543526,  0.43059358
+ 0.16667511,  0.59906699,  0.42749697
+ 0.16575939,  0.60269653,  0.42428344
+ 0.16495764,  0.6063212 ,  0.42096245
+ 0.16428695,  0.60993988,  0.41753246
+ 0.16376481,  0.61355147,  0.41399151
+ 0.16340924,  0.61715487,  0.41033757
+ 0.16323549,  0.62074951,  0.40656329
+ 0.16326148,  0.62433443,  0.40266378
+ 0.16351136,  0.62790748,  0.39864431
+ 0.16400433,  0.63146734,  0.39450263
+ 0.16475937,  0.63501264,  0.39023638
+ 0.16579502,  0.63854196,  0.38584309
+ 0.16712921,  0.64205381,  0.38132023
+ 0.168779  ,  0.64554661,  0.37666513
+ 0.17075915,  0.64901912,  0.37186962
+ 0.17308572,  0.65246934,  0.36693299
+ 0.1757732 ,  0.65589512,  0.36185643
+ 0.17883344,  0.65929449,  0.3566372 
+ 0.18227669,  0.66266536,  0.35127251
+ 0.18611159,  0.66600553,  0.34575959
+ 0.19034516,  0.66931265,  0.34009571
+ 0.19498285,  0.67258423,  0.3342782 
+ 0.20002863,  0.67581761,  0.32830456
+ 0.20548509,  0.67900997,  0.3221725 
+ 0.21135348,  0.68215834,  0.31587999
+ 0.2176339 ,  0.68525954,  0.30942543
+ 0.22432532,  0.68831023,  0.30280771
+ 0.23142568,  0.69130688,  0.29602636
+ 0.23893914,  0.69424565,  0.28906643
+ 0.2468574 ,  0.69712255,  0.28194103
+ 0.25517514,  0.69993351,  0.27465372
+ 0.26388625,  0.70267437,  0.26720869
+ 0.27298333,  0.70534087,  0.25961196
+ 0.28246016,  0.70792854,  0.25186761
+ 0.29232159,  0.71043184,  0.2439642 
+ 0.30253943,  0.71284765,  0.23594089
+ 0.31309875,  0.71517209,  0.22781515
+ 0.32399522,  0.71740028,  0.21959115
+ 0.33520729,  0.71952906,  0.21129816
+ 0.3467003 ,  0.72155723,  0.20298257
+ 0.35846225,  0.72348143,  0.19466318
+ 0.3704552 ,  0.72530195,  0.18639333
+ 0.38264126,  0.72702007,  0.17822762
+ 0.39499483,  0.72863609,  0.17020921
+ 0.40746591,  0.73015499,  0.1624122 
+ 0.42001969,  0.73158058,  0.15489659
+ 0.43261504,  0.73291878,  0.14773267
+ 0.44521378,  0.73417623,  0.14099043
+ 0.45777768,  0.73536072,  0.13474173
+ 0.47028295,  0.73647823,  0.1290455 
+ 0.48268544,  0.73753985,  0.12397794
+ 0.49497773,  0.73854983,  0.11957878
+ 0.5071369 ,  0.73951621,  0.11589589
+ 0.51913764,  0.74044827,  0.11296861
+ 0.53098624,  0.74134823,  0.11080237
+ 0.5426701 ,  0.74222288,  0.10940411
+ 0.55417235,  0.74308049,  0.10876749
+ 0.56550904,  0.74392086,  0.10885609
+ 0.57667994,  0.74474781,  0.10963233
+ 0.58767906,  0.74556676,  0.11105089
+ 0.59850723,  0.74638125,  0.1130567 
+ 0.609179  ,  0.74719067,  0.11558918
+ 0.61969877,  0.74799703,  0.11859042
+ 0.63007148,  0.74880206,  0.12200388
+ 0.64030249,  0.74960714,  0.12577596
+ 0.65038997,  0.75041586,  0.12985641
+ 0.66034774,  0.75122659,  0.1342004 
+ 0.67018264,  0.75203968,  0.13876817
+ 0.67990043,  0.75285567,  0.14352456
+ 0.68950682,  0.75367492,  0.14843886
+ 0.69900745,  0.75449768,  0.15348445
+ 0.70840781,  0.75532408,  0.15863839
+ 0.71771325,  0.75615416,  0.16388098
+ 0.72692898,  0.75698787,  0.1691954 
+ 0.73606001,  0.75782508,  0.17456729
+ 0.74511119,  0.75866562,  0.17998443
+ 0.75408719,  0.75950924,  0.18543644
+ 0.76299247,  0.76035568,  0.19091446
+ 0.77183123,  0.76120466,  0.19641095
+ 0.78060815,  0.76205561,  0.20191973
+ 0.78932717,  0.76290815,  0.20743538
+ 0.79799213,  0.76376186,  0.21295324
+ 0.8066067 ,  0.76461631,  0.21846931
+ 0.81517444,  0.76547101,  0.22398014
+ 0.82369877,  0.76632547,  0.2294827 
+ 0.832183  ,  0.7671792 ,  0.2349743 
+ 0.8406303 ,  0.76803167,  0.24045248
+ 0.84904371,  0.76888236,  0.24591492
+ 0.85742615,  0.76973076,  0.25135935
+ 0.86578037,  0.77057636,  0.25678342
+ 0.87410891,  0.77141875,  0.2621846 
+ 0.88241406,  0.77225757,  0.26755999
+ 0.89070781,  0.77308772,  0.27291122
+ 0.89898836,  0.77391069,  0.27823228
+ 0.90725475,  0.77472764,  0.28351668
+ 0.91550775,  0.77553893,  0.28875751
+ 0.92375722,  0.7763404 ,  0.29395046
+ 0.9320227 ,  0.77712286,  0.29909267
+ 0.94027715,  0.7779011 ,  0.30415428
+ 0.94856742,  0.77865213,  0.3091325 
+ 0.95686038,  0.7793949 ,  0.31397459
+ 0.965222  ,  0.7800975 ,  0.31864342
+ 0.97365189,  0.78076521,  0.32301107
+ 0.98227405,  0.78134549,  0.32678728
+ 0.99136564,  0.78176999,  0.3281624 
+ 0.99505988,  0.78542889,  0.32106514
+ 0.99594185,  0.79046888,  0.31648808
+ 0.99646635,  0.79566972,  0.31244662
+ 0.99681528,  0.80094905,  0.30858532
+ 0.9970578 ,  0.80627441,  0.30479247
+ 0.99724883,  0.81161757,  0.30105328
+ 0.99736711,  0.81699344,  0.29725528
+ 0.99742254,  0.82239736,  0.29337235
+ 0.99744736,  0.82781159,  0.28943391
+ 0.99744951,  0.83323244,  0.28543062
+ 0.9973953 ,  0.83867931,  0.2812767 
+ 0.99727248,  0.84415897,  0.27692897
+ 0.99713953,  0.84963903,  0.27248698
+ 0.99698641,  0.85512544,  0.26791703
+ 0.99673736,  0.86065927,  0.26304767
+ 0.99652358,  0.86616957,  0.25813608
+ 0.99622774,  0.87171946,  0.25292044
+ 0.99590494,  0.87727931,  0.24750009
+ 0.99555225,  0.88285068,  0.2418514 
+ 0.99513763,  0.8884501 ,  0.23588062
+ 0.99471252,  0.89405076,  0.2296837 
+ 0.99421873,  0.89968246,  0.2230963 
+ 0.99370185,  0.90532165,  0.21619768
+ 0.99313786,  0.91098038,  0.2088926 
+ 0.99250707,  0.91666811,  0.20108214
+ 0.99187888,  0.92235023,  0.19290417
+ 0.99110991,  0.92809686,  0.18387963
+ 0.99042108,  0.93379995,  0.17458127
+ 0.98958484,  0.93956962,  0.16420166
+ 0.98873988,  0.94533859,  0.15303117
+ 0.98784836,  0.95112482,  0.14074826
+ 0.98680727,  0.95697596,  0.12661626
Index: /trunk/Ohana/src/kapa2/cmaps/inferno.cm
===================================================================
--- /trunk/Ohana/src/kapa2/cmaps/inferno.cm	(revision 42389)
+++ /trunk/Ohana/src/kapa2/cmaps/inferno.cm	(revision 42389)
@@ -0,0 +1,256 @@
+0.001462, 0.000466, 0.013866
+0.002267, 0.001270, 0.018570
+0.003299, 0.002249, 0.024239
+0.004547, 0.003392, 0.030909
+0.006006, 0.004692, 0.038558
+0.007676, 0.006136, 0.046836
+0.009561, 0.007713, 0.055143
+0.011663, 0.009417, 0.063460
+0.013995, 0.011225, 0.071862
+0.016561, 0.013136, 0.080282
+0.019373, 0.015133, 0.088767
+0.022447, 0.017199, 0.097327
+0.025793, 0.019331, 0.105930
+0.029432, 0.021503, 0.114621
+0.033385, 0.023702, 0.123397
+0.037668, 0.025921, 0.132232
+0.042253, 0.028139, 0.141141
+0.046915, 0.030324, 0.150164
+0.051644, 0.032474, 0.159254
+0.056449, 0.034569, 0.168414
+0.061340, 0.036590, 0.177642
+0.066331, 0.038504, 0.186962
+0.071429, 0.040294, 0.196354
+0.076637, 0.041905, 0.205799
+0.081962, 0.043328, 0.215289
+0.087411, 0.044556, 0.224813
+0.092990, 0.045583, 0.234358
+0.098702, 0.046402, 0.243904
+0.104551, 0.047008, 0.253430
+0.110536, 0.047399, 0.262912
+0.116656, 0.047574, 0.272321
+0.122908, 0.047536, 0.281624
+0.129285, 0.047293, 0.290788
+0.135778, 0.046856, 0.299776
+0.142378, 0.046242, 0.308553
+0.149073, 0.045468, 0.317085
+0.155850, 0.044559, 0.325338
+0.162689, 0.043554, 0.333277
+0.169575, 0.042489, 0.340874
+0.176493, 0.041402, 0.348111
+0.183429, 0.040329, 0.354971
+0.190367, 0.039309, 0.361447
+0.197297, 0.038400, 0.367535
+0.204209, 0.037632, 0.373238
+0.211095, 0.037030, 0.378563
+0.217949, 0.036615, 0.383522
+0.224763, 0.036405, 0.388129
+0.231538, 0.036405, 0.392400
+0.238273, 0.036621, 0.396353
+0.244967, 0.037055, 0.400007
+0.251620, 0.037705, 0.403378
+0.258234, 0.038571, 0.406485
+0.264810, 0.039647, 0.409345
+0.271347, 0.040922, 0.411976
+0.277850, 0.042353, 0.414392
+0.284321, 0.043933, 0.416608
+0.290763, 0.045644, 0.418637
+0.297178, 0.047470, 0.420491
+0.303568, 0.049396, 0.422182
+0.309935, 0.051407, 0.423721
+0.316282, 0.053490, 0.425116
+0.322610, 0.055634, 0.426377
+0.328921, 0.057827, 0.427511
+0.335217, 0.060060, 0.428524
+0.341500, 0.062325, 0.429425
+0.347771, 0.064616, 0.430217
+0.354032, 0.066925, 0.430906
+0.360284, 0.069247, 0.431497
+0.366529, 0.071579, 0.431994
+0.372768, 0.073915, 0.432400
+0.379001, 0.076253, 0.432719
+0.385228, 0.078591, 0.432955
+0.391453, 0.080927, 0.433109
+0.397674, 0.083257, 0.433183
+0.403894, 0.085580, 0.433179
+0.410113, 0.087896, 0.433098
+0.416331, 0.090203, 0.432943
+0.422549, 0.092501, 0.432714
+0.428768, 0.094790, 0.432412
+0.434987, 0.097069, 0.432039
+0.441207, 0.099338, 0.431594
+0.447428, 0.101597, 0.431080
+0.453651, 0.103848, 0.430498
+0.459875, 0.106089, 0.429846
+0.466100, 0.108322, 0.429125
+0.472328, 0.110547, 0.428334
+0.478558, 0.112764, 0.427475
+0.484789, 0.114974, 0.426548
+0.491022, 0.117179, 0.425552
+0.497257, 0.119379, 0.424488
+0.503493, 0.121575, 0.423356
+0.509730, 0.123769, 0.422156
+0.515967, 0.125960, 0.420887
+0.522206, 0.128150, 0.419549
+0.528444, 0.130341, 0.418142
+0.534683, 0.132534, 0.416667
+0.540920, 0.134729, 0.415123
+0.547157, 0.136929, 0.413511
+0.553392, 0.139134, 0.411829
+0.559624, 0.141346, 0.410078
+0.565854, 0.143567, 0.408258
+0.572081, 0.145797, 0.406369
+0.578304, 0.148039, 0.404411
+0.584521, 0.150294, 0.402385
+0.590734, 0.152563, 0.400290
+0.596940, 0.154848, 0.398125
+0.603139, 0.157151, 0.395891
+0.609330, 0.159474, 0.393589
+0.615513, 0.161817, 0.391219
+0.621685, 0.164184, 0.388781
+0.627847, 0.166575, 0.386276
+0.633998, 0.168992, 0.383704
+0.640135, 0.171438, 0.381065
+0.646260, 0.173914, 0.378359
+0.652369, 0.176421, 0.375586
+0.658463, 0.178962, 0.372748
+0.664540, 0.181539, 0.369846
+0.670599, 0.184153, 0.366879
+0.676638, 0.186807, 0.363849
+0.682656, 0.189501, 0.360757
+0.688653, 0.192239, 0.357603
+0.694627, 0.195021, 0.354388
+0.700576, 0.197851, 0.351113
+0.706500, 0.200728, 0.347777
+0.712396, 0.203656, 0.344383
+0.718264, 0.206636, 0.340931
+0.724103, 0.209670, 0.337424
+0.729909, 0.212759, 0.333861
+0.735683, 0.215906, 0.330245
+0.741423, 0.219112, 0.326576
+0.747127, 0.222378, 0.322856
+0.752794, 0.225706, 0.319085
+0.758422, 0.229097, 0.315266
+0.764010, 0.232554, 0.311399
+0.769556, 0.236077, 0.307485
+0.775059, 0.239667, 0.303526
+0.780517, 0.243327, 0.299523
+0.785929, 0.247056, 0.295477
+0.791293, 0.250856, 0.291390
+0.796607, 0.254728, 0.287264
+0.801871, 0.258674, 0.283099
+0.807082, 0.262692, 0.278898
+0.812239, 0.266786, 0.274661
+0.817341, 0.270954, 0.270390
+0.822386, 0.275197, 0.266085
+0.827372, 0.279517, 0.261750
+0.832299, 0.283913, 0.257383
+0.837165, 0.288385, 0.252988
+0.841969, 0.292933, 0.248564
+0.846709, 0.297559, 0.244113
+0.851384, 0.302260, 0.239636
+0.855992, 0.307038, 0.235133
+0.860533, 0.311892, 0.230606
+0.865006, 0.316822, 0.226055
+0.869409, 0.321827, 0.221482
+0.873741, 0.326906, 0.216886
+0.878001, 0.332060, 0.212268
+0.882188, 0.337287, 0.207628
+0.886302, 0.342586, 0.202968
+0.890341, 0.347957, 0.198286
+0.894305, 0.353399, 0.193584
+0.898192, 0.358911, 0.188860
+0.902003, 0.364492, 0.184116
+0.905735, 0.370140, 0.179350
+0.909390, 0.375856, 0.174563
+0.912966, 0.381636, 0.169755
+0.916462, 0.387481, 0.164924
+0.919879, 0.393389, 0.160070
+0.923215, 0.399359, 0.155193
+0.926470, 0.405389, 0.150292
+0.929644, 0.411479, 0.145367
+0.932737, 0.417627, 0.140417
+0.935747, 0.423831, 0.135440
+0.938675, 0.430091, 0.130438
+0.941521, 0.436405, 0.125409
+0.944285, 0.442772, 0.120354
+0.946965, 0.449191, 0.115272
+0.949562, 0.455660, 0.110164
+0.952075, 0.462178, 0.105031
+0.954506, 0.468744, 0.099874
+0.956852, 0.475356, 0.094695
+0.959114, 0.482014, 0.089499
+0.961293, 0.488716, 0.084289
+0.963387, 0.495462, 0.079073
+0.965397, 0.502249, 0.073859
+0.967322, 0.509078, 0.068659
+0.969163, 0.515946, 0.063488
+0.970919, 0.522853, 0.058367
+0.972590, 0.529798, 0.053324
+0.974176, 0.536780, 0.048392
+0.975677, 0.543798, 0.043618
+0.977092, 0.550850, 0.039050
+0.978422, 0.557937, 0.034931
+0.979666, 0.565057, 0.031409
+0.980824, 0.572209, 0.028508
+0.981895, 0.579392, 0.026250
+0.982881, 0.586606, 0.024661
+0.983779, 0.593849, 0.023770
+0.984591, 0.601122, 0.023606
+0.985315, 0.608422, 0.024202
+0.985952, 0.615750, 0.025592
+0.986502, 0.623105, 0.027814
+0.986964, 0.630485, 0.030908
+0.987337, 0.637890, 0.034916
+0.987622, 0.645320, 0.039886
+0.987819, 0.652773, 0.045581
+0.987926, 0.660250, 0.051750
+0.987945, 0.667748, 0.058329
+0.987874, 0.675267, 0.065257
+0.987714, 0.682807, 0.072489
+0.987464, 0.690366, 0.079990
+0.987124, 0.697944, 0.087731
+0.986694, 0.705540, 0.095694
+0.986175, 0.713153, 0.103863
+0.985566, 0.720782, 0.112229
+0.984865, 0.728427, 0.120785
+0.984075, 0.736087, 0.129527
+0.983196, 0.743758, 0.138453
+0.982228, 0.751442, 0.147565
+0.981173, 0.759135, 0.156863
+0.980032, 0.766837, 0.166353
+0.978806, 0.774545, 0.176037
+0.977497, 0.782258, 0.185923
+0.976108, 0.789974, 0.196018
+0.974638, 0.797692, 0.206332
+0.973088, 0.805409, 0.216877
+0.971468, 0.813122, 0.227658
+0.969783, 0.820825, 0.238686
+0.968041, 0.828515, 0.249972
+0.966243, 0.836191, 0.261534
+0.964394, 0.843848, 0.273391
+0.962517, 0.851476, 0.285546
+0.960626, 0.859069, 0.298010
+0.958720, 0.866624, 0.310820
+0.956834, 0.874129, 0.323974
+0.954997, 0.881569, 0.337475
+0.953215, 0.888942, 0.351369
+0.951546, 0.896226, 0.365627
+0.950018, 0.903409, 0.380271
+0.948683, 0.910473, 0.395289
+0.947594, 0.917399, 0.410665
+0.946809, 0.924168, 0.426373
+0.946392, 0.930761, 0.442367
+0.946403, 0.937159, 0.458592
+0.946903, 0.943348, 0.474970
+0.947937, 0.949318, 0.491426
+0.949545, 0.955063, 0.507860
+0.951740, 0.960587, 0.524203
+0.954529, 0.965896, 0.540361
+0.957896, 0.971003, 0.556275
+0.961812, 0.975924, 0.571925
+0.966249, 0.980678, 0.587206
+0.971162, 0.985282, 0.602154
+0.976511, 0.989753, 0.616760
+0.982257, 0.994109, 0.631017
+0.988362, 0.998364, 0.644924
Index: /trunk/Ohana/src/kapa2/cmaps/magma.cm
===================================================================
--- /trunk/Ohana/src/kapa2/cmaps/magma.cm	(revision 42389)
+++ /trunk/Ohana/src/kapa2/cmaps/magma.cm	(revision 42389)
@@ -0,0 +1,256 @@
+0.001462, 0.000466, 0.013866
+0.002258, 0.001295, 0.018331
+0.003279, 0.002305, 0.023708
+0.004512, 0.003490, 0.029965
+0.005950, 0.004843, 0.037130
+0.007588, 0.006356, 0.044973
+0.009426, 0.008022, 0.052844
+0.011465, 0.009828, 0.060750
+0.013708, 0.011771, 0.068667
+0.016156, 0.013840, 0.076603
+0.018815, 0.016026, 0.084584
+0.021692, 0.018320, 0.092610
+0.024792, 0.020715, 0.100676
+0.028123, 0.023201, 0.108787
+0.031696, 0.025765, 0.116965
+0.035520, 0.028397, 0.125209
+0.039608, 0.031090, 0.133515
+0.043830, 0.033830, 0.141886
+0.048062, 0.036607, 0.150327
+0.052320, 0.039407, 0.158841
+0.056615, 0.042160, 0.167446
+0.060949, 0.044794, 0.176129
+0.065330, 0.047318, 0.184892
+0.069764, 0.049726, 0.193735
+0.074257, 0.052017, 0.202660
+0.078815, 0.054184, 0.211667
+0.083446, 0.056225, 0.220755
+0.088155, 0.058133, 0.229922
+0.092949, 0.059904, 0.239164
+0.097833, 0.061531, 0.248477
+0.102815, 0.063010, 0.257854
+0.107899, 0.064335, 0.267289
+0.113094, 0.065492, 0.276784
+0.118405, 0.066479, 0.286321
+0.123833, 0.067295, 0.295879
+0.129380, 0.067935, 0.305443
+0.135053, 0.068391, 0.315000
+0.140858, 0.068654, 0.324538
+0.146785, 0.068738, 0.334011
+0.152839, 0.068637, 0.343404
+0.159018, 0.068354, 0.352688
+0.165308, 0.067911, 0.361816
+0.171713, 0.067305, 0.370771
+0.178212, 0.066576, 0.379497
+0.184801, 0.065732, 0.387973
+0.191460, 0.064818, 0.396152
+0.198177, 0.063862, 0.404009
+0.204935, 0.062907, 0.411514
+0.211718, 0.061992, 0.418647
+0.218512, 0.061158, 0.425392
+0.225302, 0.060445, 0.431742
+0.232077, 0.059889, 0.437695
+0.238826, 0.059517, 0.443256
+0.245543, 0.059352, 0.448436
+0.252220, 0.059415, 0.453248
+0.258857, 0.059706, 0.457710
+0.265447, 0.060237, 0.461840
+0.271994, 0.060994, 0.465660
+0.278493, 0.061978, 0.469190
+0.284951, 0.063168, 0.472451
+0.291366, 0.064553, 0.475462
+0.297740, 0.066117, 0.478243
+0.304081, 0.067835, 0.480812
+0.310382, 0.069702, 0.483186
+0.316654, 0.071690, 0.485380
+0.322899, 0.073782, 0.487408
+0.329114, 0.075972, 0.489287
+0.335308, 0.078236, 0.491024
+0.341482, 0.080564, 0.492631
+0.347636, 0.082946, 0.494121
+0.353773, 0.085373, 0.495501
+0.359898, 0.087831, 0.496778
+0.366012, 0.090314, 0.497960
+0.372116, 0.092816, 0.499053
+0.378211, 0.095332, 0.500067
+0.384299, 0.097855, 0.501002
+0.390384, 0.100379, 0.501864
+0.396467, 0.102902, 0.502658
+0.402548, 0.105420, 0.503386
+0.408629, 0.107930, 0.504052
+0.414709, 0.110431, 0.504662
+0.420791, 0.112920, 0.505215
+0.426877, 0.115395, 0.505714
+0.432967, 0.117855, 0.506160
+0.439062, 0.120298, 0.506555
+0.445163, 0.122724, 0.506901
+0.451271, 0.125132, 0.507198
+0.457386, 0.127522, 0.507448
+0.463508, 0.129893, 0.507652
+0.469640, 0.132245, 0.507809
+0.475780, 0.134577, 0.507921
+0.481929, 0.136891, 0.507989
+0.488088, 0.139186, 0.508011
+0.494258, 0.141462, 0.507988
+0.500438, 0.143719, 0.507920
+0.506629, 0.145958, 0.507806
+0.512831, 0.148179, 0.507648
+0.519045, 0.150383, 0.507443
+0.525270, 0.152569, 0.507192
+0.531507, 0.154739, 0.506895
+0.537755, 0.156894, 0.506551
+0.544015, 0.159033, 0.506159
+0.550287, 0.161158, 0.505719
+0.556571, 0.163269, 0.505230
+0.562866, 0.165368, 0.504692
+0.569172, 0.167454, 0.504105
+0.575490, 0.169530, 0.503466
+0.581819, 0.171596, 0.502777
+0.588158, 0.173652, 0.502035
+0.594508, 0.175701, 0.501241
+0.600868, 0.177743, 0.500394
+0.607238, 0.179779, 0.499492
+0.613617, 0.181811, 0.498536
+0.620005, 0.183840, 0.497524
+0.626401, 0.185867, 0.496456
+0.632805, 0.187893, 0.495332
+0.639216, 0.189921, 0.494150
+0.645633, 0.191952, 0.492910
+0.652056, 0.193986, 0.491611
+0.658483, 0.196027, 0.490253
+0.664915, 0.198075, 0.488836
+0.671349, 0.200133, 0.487358
+0.677786, 0.202203, 0.485819
+0.684224, 0.204286, 0.484219
+0.690661, 0.206384, 0.482558
+0.697098, 0.208501, 0.480835
+0.703532, 0.210638, 0.479049
+0.709962, 0.212797, 0.477201
+0.716387, 0.214982, 0.475290
+0.722805, 0.217194, 0.473316
+0.729216, 0.219437, 0.471279
+0.735616, 0.221713, 0.469180
+0.742004, 0.224025, 0.467018
+0.748378, 0.226377, 0.464794
+0.754737, 0.228772, 0.462509
+0.761077, 0.231214, 0.460162
+0.767398, 0.233705, 0.457755
+0.773695, 0.236249, 0.455289
+0.779968, 0.238851, 0.452765
+0.786212, 0.241514, 0.450184
+0.792427, 0.244242, 0.447543
+0.798608, 0.247040, 0.444848
+0.804752, 0.249911, 0.442102
+0.810855, 0.252861, 0.439305
+0.816914, 0.255895, 0.436461
+0.822926, 0.259016, 0.433573
+0.828886, 0.262229, 0.430644
+0.834791, 0.265540, 0.427671
+0.840636, 0.268953, 0.424666
+0.846416, 0.272473, 0.421631
+0.852126, 0.276106, 0.418573
+0.857763, 0.279857, 0.415496
+0.863320, 0.283729, 0.412403
+0.868793, 0.287728, 0.409303
+0.874176, 0.291859, 0.406205
+0.879464, 0.296125, 0.403118
+0.884651, 0.300530, 0.400047
+0.889731, 0.305079, 0.397002
+0.894700, 0.309773, 0.393995
+0.899552, 0.314616, 0.391037
+0.904281, 0.319610, 0.388137
+0.908884, 0.324755, 0.385308
+0.913354, 0.330052, 0.382563
+0.917689, 0.335500, 0.379915
+0.921884, 0.341098, 0.377376
+0.925937, 0.346844, 0.374959
+0.929845, 0.352734, 0.372677
+0.933606, 0.358764, 0.370541
+0.937221, 0.364929, 0.368567
+0.940687, 0.371224, 0.366762
+0.944006, 0.377643, 0.365136
+0.947180, 0.384178, 0.363701
+0.950210, 0.390820, 0.362468
+0.953099, 0.397563, 0.361438
+0.955849, 0.404400, 0.360619
+0.958464, 0.411324, 0.360014
+0.960949, 0.418323, 0.359630
+0.963310, 0.425390, 0.359469
+0.965549, 0.432519, 0.359529
+0.967671, 0.439703, 0.359810
+0.969680, 0.446936, 0.360311
+0.971582, 0.454210, 0.361030
+0.973381, 0.461520, 0.361965
+0.975082, 0.468861, 0.363111
+0.976690, 0.476226, 0.364466
+0.978210, 0.483612, 0.366025
+0.979645, 0.491014, 0.367783
+0.981000, 0.498428, 0.369734
+0.982279, 0.505851, 0.371874
+0.983485, 0.513280, 0.374198
+0.984622, 0.520713, 0.376698
+0.985693, 0.528148, 0.379371
+0.986700, 0.535582, 0.382210
+0.987646, 0.543015, 0.385210
+0.988533, 0.550446, 0.388365
+0.989363, 0.557873, 0.391671
+0.990138, 0.565296, 0.395122
+0.990871, 0.572706, 0.398714
+0.991558, 0.580107, 0.402441
+0.992196, 0.587502, 0.406299
+0.992785, 0.594891, 0.410283
+0.993326, 0.602275, 0.414390
+0.993834, 0.609644, 0.418613
+0.994309, 0.616999, 0.422950
+0.994738, 0.624350, 0.427397
+0.995122, 0.631696, 0.431951
+0.995480, 0.639027, 0.436607
+0.995810, 0.646344, 0.441361
+0.996096, 0.653659, 0.446213
+0.996341, 0.660969, 0.451160
+0.996580, 0.668256, 0.456192
+0.996775, 0.675541, 0.461314
+0.996925, 0.682828, 0.466526
+0.997077, 0.690088, 0.471811
+0.997186, 0.697349, 0.477182
+0.997254, 0.704611, 0.482635
+0.997325, 0.711848, 0.488154
+0.997351, 0.719089, 0.493755
+0.997351, 0.726324, 0.499428
+0.997341, 0.733545, 0.505167
+0.997285, 0.740772, 0.510983
+0.997228, 0.747981, 0.516859
+0.997138, 0.755190, 0.522806
+0.997019, 0.762398, 0.528821
+0.996898, 0.769591, 0.534892
+0.996727, 0.776795, 0.541039
+0.996571, 0.783977, 0.547233
+0.996369, 0.791167, 0.553499
+0.996162, 0.798348, 0.559820
+0.995932, 0.805527, 0.566202
+0.995680, 0.812706, 0.572645
+0.995424, 0.819875, 0.579140
+0.995131, 0.827052, 0.585701
+0.994851, 0.834213, 0.592307
+0.994524, 0.841387, 0.598983
+0.994222, 0.848540, 0.605696
+0.993866, 0.855711, 0.612482
+0.993545, 0.862859, 0.619299
+0.993170, 0.870024, 0.626189
+0.992831, 0.877168, 0.633109
+0.992440, 0.884330, 0.640099
+0.992089, 0.891470, 0.647116
+0.991688, 0.898627, 0.654202
+0.991332, 0.905763, 0.661309
+0.990930, 0.912915, 0.668481
+0.990570, 0.920049, 0.675675
+0.990175, 0.927196, 0.682926
+0.989815, 0.934329, 0.690198
+0.989434, 0.941470, 0.697519
+0.989077, 0.948604, 0.704863
+0.988717, 0.955742, 0.712242
+0.988367, 0.962878, 0.719649
+0.988033, 0.970012, 0.727077
+0.987691, 0.977154, 0.734536
+0.987387, 0.984288, 0.742002
+0.987053, 0.991438, 0.749504
Index: /trunk/Ohana/src/kapa2/cmaps/magma2.cm
===================================================================
--- /trunk/Ohana/src/kapa2/cmaps/magma2.cm	(revision 42389)
+++ /trunk/Ohana/src/kapa2/cmaps/magma2.cm	(revision 42389)
@@ -0,0 +1,256 @@
+0.001462,0.000466,0.0184388297872,
+0.002258,0.001295,0.0243763297872,
+0.003279,0.002305,0.0315265957447,
+0.004512,0.00349,0.0398470744681,
+0.00595,0.004843,0.049375,
+0.007588,0.006356,0.0598045212766,
+0.009426,0.008022,0.0702712765957,
+0.011465,0.009828,0.0807845744681,
+0.013708,0.011771,0.0913125,
+0.016156,0.01384,0.101865691489,
+0.018815,0.016026,0.112478723404,
+0.021692,0.01832,0.123151595745,
+0.024792,0.020715,0.133877659574,
+0.028123,0.023201,0.14466356383,
+0.031696,0.025765,0.15553856383,
+0.03552,0.028397,0.166501329787,
+0.039608,0.03109,0.177546542553,
+0.04383,0.03383,0.188678191489,
+0.048062,0.036607,0.199902925532,
+0.05232,0.039407,0.211224734043,
+0.056615,0.04216,0.222667553191,
+0.060949,0.044794,0.234214095745,
+0.06533,0.047318,0.245867021277,
+0.069764,0.049726,0.257626329787,
+0.074257,0.052017,0.269494680851,
+0.078815,0.054184,0.281472074468,
+0.083446,0.056225,0.293557180851,
+0.088155,0.058133,0.305747340426,
+0.092949,0.059904,0.318037234043,
+0.097833,0.061531,0.330421542553,
+0.102815,0.06301,0.342890957447,
+0.107899,0.064335,0.3554375,
+0.113094,0.065492,0.368063829787,
+0.118405,0.066479,0.380746010638,
+0.123833,0.067295,0.393456117021,
+0.12938,0.067935,0.406174202128,
+0.135053,0.068391,0.418882978723,
+0.140858,0.068654,0.431566489362,
+0.146785,0.068738,0.44416356383,
+0.152839,0.068637,0.456654255319,
+0.159018,0.068354,0.469,
+0.165308,0.067911,0.481138297872,
+0.171713,0.067305,0.493046542553,
+0.178212,0.066576,0.504650265957,
+0.184801,0.065732,0.515921542553,
+0.19146,0.064818,0.52679787234,
+0.198177,0.063862,0.537246010638,
+0.204935,0.062907,0.54722606383,
+0.211718,0.061992,0.55671143617,
+0.218512,0.061158,0.565680851064,
+0.225302,0.060445,0.574125,
+0.232077,0.059889,0.582041223404,
+0.238826,0.059517,0.589436170213,
+0.245543,0.059352,0.596324468085,
+0.25222,0.059415,0.602723404255,
+0.258857,0.059706,0.608656914894,
+0.265447,0.060237,0.61414893617,
+0.271994,0.060994,0.619228723404,
+0.278493,0.061978,0.62392287234,
+0.284951,0.063168,0.628259308511,
+0.291366,0.064553,0.632263297872,
+0.29774,0.066117,0.63596143617,
+0.304081,0.067835,0.639377659574,
+0.310382,0.069702,0.642534574468,
+0.316654,0.07169,0.64545212766,
+0.322899,0.073782,0.64814893617,
+0.329114,0.075972,0.650647606383,
+0.335308,0.078236,0.652957446809,
+0.341482,0.080564,0.655094414894,
+0.347636,0.082946,0.657075797872,
+0.353773,0.085373,0.658910904255,
+0.359898,0.087831,0.660609042553,
+0.366012,0.090314,0.662180851064,
+0.372116,0.092816,0.663634308511,
+0.378211,0.095332,0.664982712766,
+0.384299,0.097855,0.66622606383,
+0.390384,0.100379,0.667372340426,
+0.396467,0.102902,0.668428191489,
+0.402548,0.10542,0.669396276596,
+0.408629,0.10793,0.670281914894,
+0.414709,0.110431,0.671093085106,
+0.420791,0.11292,0.671828457447,
+0.426877,0.115395,0.672492021277,
+0.432967,0.117855,0.673085106383,
+0.439062,0.120298,0.67361037234,
+0.445163,0.122724,0.674070478723,
+0.451271,0.125132,0.674465425532,
+0.457386,0.127522,0.67479787234,
+0.463508,0.129893,0.675069148936,
+0.46964,0.132245,0.675277925532,
+0.47578,0.134577,0.675426861702,
+0.481929,0.136891,0.675517287234,
+0.488088,0.139186,0.675546542553,
+0.494258,0.141462,0.675515957447,
+0.500438,0.143719,0.675425531915,
+0.506629,0.145958,0.67527393617,
+0.512831,0.148179,0.675063829787,
+0.519045,0.150383,0.674791223404,
+0.52527,0.152569,0.674457446809,
+0.531507,0.154739,0.6740625,
+0.537755,0.156894,0.673605053191,
+0.544015,0.159033,0.673083776596,
+0.550287,0.161158,0.672498670213,
+0.556571,0.163269,0.671848404255,
+0.562866,0.165368,0.671132978723,
+0.569172,0.167454,0.670352393617,
+0.57549,0.16953,0.669502659574,
+0.581819,0.171596,0.66858643617,
+0.588158,0.173652,0.667599734043,
+0.594508,0.175701,0.666543882979,
+0.600868,0.177743,0.665417553191,
+0.607238,0.179779,0.664218085106,
+0.613617,0.181811,0.662946808511,
+0.620005,0.18384,0.66160106383,
+0.626401,0.185867,0.660180851064,
+0.632805,0.187893,0.658686170213,
+0.639216,0.189921,0.657114361702,
+0.645633,0.191952,0.655465425532,
+0.652056,0.193986,0.653738031915,
+0.658483,0.196027,0.651932180851,
+0.664915,0.198075,0.65004787234,
+0.671349,0.200133,0.648082446809,
+0.677786,0.202203,0.646035904255,
+0.684224,0.204286,0.643908244681,
+0.690661,0.206384,0.641699468085,
+0.697098,0.208501,0.639408244681,
+0.703532,0.210638,0.637033244681,
+0.709962,0.212797,0.634575797872,
+0.716387,0.214982,0.632034574468,
+0.722805,0.217194,0.629409574468,
+0.729216,0.219437,0.626700797872,
+0.735616,0.221713,0.623909574468,
+0.742004,0.224025,0.621034574468,
+0.748378,0.226377,0.61807712766,
+0.754737,0.228772,0.61503856383,
+0.761077,0.231214,0.611917553191,
+0.767398,0.233705,0.608716755319,
+0.773695,0.236249,0.6054375,
+0.779968,0.238851,0.602081117021,
+0.786212,0.241514,0.59864893617,
+0.792427,0.244242,0.595136968085,
+0.798608,0.24704,0.591553191489,
+0.804752,0.249911,0.587901595745,
+0.810855,0.252861,0.584182180851,
+0.816914,0.255895,0.580400265957,
+0.822926,0.259016,0.576559840426,
+0.828886,0.262229,0.572664893617,
+0.834791,0.26554,0.56871143617,
+0.840636,0.268953,0.564715425532,
+0.846416,0.272473,0.560679521277,
+0.852126,0.276106,0.556613031915,
+0.857763,0.279857,0.552521276596,
+0.86332,0.283729,0.548408244681,
+0.868793,0.287728,0.544285904255,
+0.874176,0.291859,0.540166223404,
+0.879464,0.296125,0.536061170213,
+0.884651,0.30053,0.531977393617,
+0.889731,0.305079,0.527928191489,
+0.8947,0.309773,0.523929521277,
+0.899552,0.314616,0.519996010638,
+0.904281,0.31961,0.51613962766,
+0.908884,0.324755,0.512377659574,
+0.913354,0.330052,0.508727393617,
+0.917689,0.3355,0.505206117021,
+0.921884,0.341098,0.501829787234,
+0.925937,0.346844,0.498615691489,
+0.929845,0.352734,0.495581117021,
+0.933606,0.358764,0.492740691489,
+0.937221,0.364929,0.490115691489,
+0.940687,0.371224,0.487715425532,
+0.944006,0.377643,0.485553191489,
+0.94718,0.384178,0.483644946809,
+0.95021,0.39082,0.482005319149,
+0.953099,0.397563,0.480635638298,
+0.955849,0.4044,0.479546542553,
+0.958464,0.411324,0.478742021277,
+0.960949,0.418323,0.478231382979,
+0.96331,0.42539,0.478017287234,
+0.965549,0.432519,0.478097074468,
+0.967671,0.439703,0.478470744681,
+0.96968,0.446936,0.479136968085,
+0.971582,0.45421,0.480093085106,
+0.973381,0.46152,0.48133643617,
+0.975082,0.468861,0.48286037234,
+0.97669,0.476226,0.484662234043,
+0.97821,0.483612,0.48673537234,
+0.979645,0.491014,0.489073138298,
+0.981,0.498428,0.491667553191,
+0.982279,0.505851,0.494513297872,
+0.983485,0.51328,0.497603723404,
+0.984622,0.520713,0.500928191489,
+0.985693,0.528148,0.504482712766,
+0.9867,0.535582,0.508257978723,
+0.987646,0.543015,0.512247340426,
+0.988533,0.550446,0.516442819149,
+0.989363,0.557873,0.520839095745,
+0.990138,0.565296,0.525428191489,
+0.990871,0.572706,0.530204787234,
+0.991558,0.580107,0.535160904255,
+0.992196,0.587502,0.540291223404,
+0.992785,0.594891,0.545589095745,
+0.993326,0.602275,0.551050531915,
+0.993834,0.609644,0.556666223404,
+0.994309,0.616999,0.562433510638,
+0.994738,0.62435,0.568347074468,
+0.995122,0.631696,0.574402925532,
+0.99548,0.639027,0.580594414894,
+0.99581,0.646344,0.586916223404,
+0.996096,0.653659,0.593368351064,
+0.996341,0.660969,0.599946808511,
+0.99658,0.668256,0.606638297872,
+0.996775,0.675541,0.613449468085,
+0.996925,0.682828,0.620380319149,
+0.997077,0.690088,0.627408244681,
+0.997186,0.697349,0.634550531915,
+0.997254,0.704611,0.641801861702,
+0.997325,0.711848,0.649140957447,
+0.997351,0.719089,0.656589095745,
+0.997351,0.726324,0.664132978723,
+0.997341,0.733545,0.67176462766,
+0.997285,0.740772,0.679498670213,
+0.997228,0.747981,0.6873125,
+0.997138,0.75519,0.695220744681,
+0.997019,0.762398,0.703219414894,
+0.996898,0.769591,0.711292553191,
+0.996727,0.776795,0.719466755319,
+0.996571,0.783977,0.727703457447,
+0.996369,0.791167,0.736035904255,
+0.996162,0.798348,0.744441489362,
+0.995932,0.805527,0.752928191489,
+0.99568,0.812706,0.761496010638,
+0.995424,0.819875,0.770132978723,
+0.995131,0.827052,0.778857712766,
+0.994851,0.834213,0.787642287234,
+0.994524,0.841387,0.796519946809,
+0.994222,0.84854,0.805446808511,
+0.993866,0.855711,0.814470744681,
+0.993545,0.862859,0.823535904255,
+0.99317,0.870024,0.832698138298,
+0.992831,0.877168,0.841900265957,
+0.99244,0.88433,0.851195478723,
+0.992089,0.89147,0.860526595745,
+0.991688,0.898627,0.869949468085,
+0.991332,0.905763,0.879400265957,
+0.99093,0.912915,0.8889375,
+0.99057,0.920049,0.898503989362,
+0.990175,0.927196,0.908146276596,
+0.989815,0.934329,0.917816489362,
+0.989434,0.94147,0.927551861702,
+0.989077,0.948604,0.937317819149,
+0.988717,0.955742,0.947130319149,
+0.988367,0.962878,0.956980053191,
+0.988033,0.970012,0.966857712766,
+0.987691,0.977154,0.976776595745,
+0.987387,0.984288,0.986704787234,
+0.987053,0.991438,0.996680851064,
Index: /trunk/Ohana/src/kapa2/cmaps/plasma.cm
===================================================================
--- /trunk/Ohana/src/kapa2/cmaps/plasma.cm	(revision 42389)
+++ /trunk/Ohana/src/kapa2/cmaps/plasma.cm	(revision 42389)
@@ -0,0 +1,256 @@
+0.050383, 0.029803, 0.527975
+0.063536, 0.028426, 0.533124
+0.075353, 0.027206, 0.538007
+0.086222, 0.026125, 0.542658
+0.096379, 0.025165, 0.547103
+0.105980, 0.024309, 0.551368
+0.115124, 0.023556, 0.555468
+0.123903, 0.022878, 0.559423
+0.132381, 0.022258, 0.563250
+0.140603, 0.021687, 0.566959
+0.148607, 0.021154, 0.570562
+0.156421, 0.020651, 0.574065
+0.164070, 0.020171, 0.577478
+0.171574, 0.019706, 0.580806
+0.178950, 0.019252, 0.584054
+0.186213, 0.018803, 0.587228
+0.193374, 0.018354, 0.590330
+0.200445, 0.017902, 0.593364
+0.207435, 0.017442, 0.596333
+0.214350, 0.016973, 0.599239
+0.221197, 0.016497, 0.602083
+0.227983, 0.016007, 0.604867
+0.234715, 0.015502, 0.607592
+0.241396, 0.014979, 0.610259
+0.248032, 0.014439, 0.612868
+0.254627, 0.013882, 0.615419
+0.261183, 0.013308, 0.617911
+0.267703, 0.012716, 0.620346
+0.274191, 0.012109, 0.622722
+0.280648, 0.011488, 0.625038
+0.287076, 0.010855, 0.627295
+0.293478, 0.010213, 0.629490
+0.299855, 0.009561, 0.631624
+0.306210, 0.008902, 0.633694
+0.312543, 0.008239, 0.635700
+0.318856, 0.007576, 0.637640
+0.325150, 0.006915, 0.639512
+0.331426, 0.006261, 0.641316
+0.337683, 0.005618, 0.643049
+0.343925, 0.004991, 0.644710
+0.350150, 0.004382, 0.646298
+0.356359, 0.003798, 0.647810
+0.362553, 0.003243, 0.649245
+0.368733, 0.002724, 0.650601
+0.374897, 0.002245, 0.651876
+0.381047, 0.001814, 0.653068
+0.387183, 0.001434, 0.654177
+0.393304, 0.001114, 0.655199
+0.399411, 0.000859, 0.656133
+0.405503, 0.000678, 0.656977
+0.411580, 0.000577, 0.657730
+0.417642, 0.000564, 0.658390
+0.423689, 0.000646, 0.658956
+0.429719, 0.000831, 0.659425
+0.435734, 0.001127, 0.659797
+0.441732, 0.001540, 0.660069
+0.447714, 0.002080, 0.660240
+0.453677, 0.002755, 0.660310
+0.459623, 0.003574, 0.660277
+0.465550, 0.004545, 0.660139
+0.471457, 0.005678, 0.659897
+0.477344, 0.006980, 0.659549
+0.483210, 0.008460, 0.659095
+0.489055, 0.010127, 0.658534
+0.494877, 0.011990, 0.657865
+0.500678, 0.014055, 0.657088
+0.506454, 0.016333, 0.656202
+0.512206, 0.018833, 0.655209
+0.517933, 0.021563, 0.654109
+0.523633, 0.024532, 0.652901
+0.529306, 0.027747, 0.651586
+0.534952, 0.031217, 0.650165
+0.540570, 0.034950, 0.648640
+0.546157, 0.038954, 0.647010
+0.551715, 0.043136, 0.645277
+0.557243, 0.047331, 0.643443
+0.562738, 0.051545, 0.641509
+0.568201, 0.055778, 0.639477
+0.573632, 0.060028, 0.637349
+0.579029, 0.064296, 0.635126
+0.584391, 0.068579, 0.632812
+0.589719, 0.072878, 0.630408
+0.595011, 0.077190, 0.627917
+0.600266, 0.081516, 0.625342
+0.605485, 0.085854, 0.622686
+0.610667, 0.090204, 0.619951
+0.615812, 0.094564, 0.617140
+0.620919, 0.098934, 0.614257
+0.625987, 0.103312, 0.611305
+0.631017, 0.107699, 0.608287
+0.636008, 0.112092, 0.605205
+0.640959, 0.116492, 0.602065
+0.645872, 0.120898, 0.598867
+0.650746, 0.125309, 0.595617
+0.655580, 0.129725, 0.592317
+0.660374, 0.134144, 0.588971
+0.665129, 0.138566, 0.585582
+0.669845, 0.142992, 0.582154
+0.674522, 0.147419, 0.578688
+0.679160, 0.151848, 0.575189
+0.683758, 0.156278, 0.571660
+0.688318, 0.160709, 0.568103
+0.692840, 0.165141, 0.564522
+0.697324, 0.169573, 0.560919
+0.701769, 0.174005, 0.557296
+0.706178, 0.178437, 0.553657
+0.710549, 0.182868, 0.550004
+0.714883, 0.187299, 0.546338
+0.719181, 0.191729, 0.542663
+0.723444, 0.196158, 0.538981
+0.727670, 0.200586, 0.535293
+0.731862, 0.205013, 0.531601
+0.736019, 0.209439, 0.527908
+0.740143, 0.213864, 0.524216
+0.744232, 0.218288, 0.520524
+0.748289, 0.222711, 0.516834
+0.752312, 0.227133, 0.513149
+0.756304, 0.231555, 0.509468
+0.760264, 0.235976, 0.505794
+0.764193, 0.240396, 0.502126
+0.768090, 0.244817, 0.498465
+0.771958, 0.249237, 0.494813
+0.775796, 0.253658, 0.491171
+0.779604, 0.258078, 0.487539
+0.783383, 0.262500, 0.483918
+0.787133, 0.266922, 0.480307
+0.790855, 0.271345, 0.476706
+0.794549, 0.275770, 0.473117
+0.798216, 0.280197, 0.469538
+0.801855, 0.284626, 0.465971
+0.805467, 0.289057, 0.462415
+0.809052, 0.293491, 0.458870
+0.812612, 0.297928, 0.455338
+0.816144, 0.302368, 0.451816
+0.819651, 0.306812, 0.448306
+0.823132, 0.311261, 0.444806
+0.826588, 0.315714, 0.441316
+0.830018, 0.320172, 0.437836
+0.833422, 0.324635, 0.434366
+0.836801, 0.329105, 0.430905
+0.840155, 0.333580, 0.427455
+0.843484, 0.338062, 0.424013
+0.846788, 0.342551, 0.420579
+0.850066, 0.347048, 0.417153
+0.853319, 0.351553, 0.413734
+0.856547, 0.356066, 0.410322
+0.859750, 0.360588, 0.406917
+0.862927, 0.365119, 0.403519
+0.866078, 0.369660, 0.400126
+0.869203, 0.374212, 0.396738
+0.872303, 0.378774, 0.393355
+0.875376, 0.383347, 0.389976
+0.878423, 0.387932, 0.386600
+0.881443, 0.392529, 0.383229
+0.884436, 0.397139, 0.379860
+0.887402, 0.401762, 0.376494
+0.890340, 0.406398, 0.373130
+0.893250, 0.411048, 0.369768
+0.896131, 0.415712, 0.366407
+0.898984, 0.420392, 0.363047
+0.901807, 0.425087, 0.359688
+0.904601, 0.429797, 0.356329
+0.907365, 0.434524, 0.352970
+0.910098, 0.439268, 0.349610
+0.912800, 0.444029, 0.346251
+0.915471, 0.448807, 0.342890
+0.918109, 0.453603, 0.339529
+0.920714, 0.458417, 0.336166
+0.923287, 0.463251, 0.332801
+0.925825, 0.468103, 0.329435
+0.928329, 0.472975, 0.326067
+0.930798, 0.477867, 0.322697
+0.933232, 0.482780, 0.319325
+0.935630, 0.487712, 0.315952
+0.937990, 0.492667, 0.312575
+0.940313, 0.497642, 0.309197
+0.942598, 0.502639, 0.305816
+0.944844, 0.507658, 0.302433
+0.947051, 0.512699, 0.299049
+0.949217, 0.517763, 0.295662
+0.951344, 0.522850, 0.292275
+0.953428, 0.527960, 0.288883
+0.955470, 0.533093, 0.285490
+0.957469, 0.538250, 0.282096
+0.959424, 0.543431, 0.278701
+0.961336, 0.548636, 0.275305
+0.963203, 0.553865, 0.271909
+0.965024, 0.559118, 0.268513
+0.966798, 0.564396, 0.265118
+0.968526, 0.569700, 0.261721
+0.970205, 0.575028, 0.258325
+0.971835, 0.580382, 0.254931
+0.973416, 0.585761, 0.251540
+0.974947, 0.591165, 0.248151
+0.976428, 0.596595, 0.244767
+0.977856, 0.602051, 0.241387
+0.979233, 0.607532, 0.238013
+0.980556, 0.613039, 0.234646
+0.981826, 0.618572, 0.231287
+0.983041, 0.624131, 0.227937
+0.984199, 0.629718, 0.224595
+0.985301, 0.635330, 0.221265
+0.986345, 0.640969, 0.217948
+0.987332, 0.646633, 0.214648
+0.988260, 0.652325, 0.211364
+0.989128, 0.658043, 0.208100
+0.989935, 0.663787, 0.204859
+0.990681, 0.669558, 0.201642
+0.991365, 0.675355, 0.198453
+0.991985, 0.681179, 0.195295
+0.992541, 0.687030, 0.192170
+0.993032, 0.692907, 0.189084
+0.993456, 0.698810, 0.186041
+0.993814, 0.704741, 0.183043
+0.994103, 0.710698, 0.180097
+0.994324, 0.716681, 0.177208
+0.994474, 0.722691, 0.174381
+0.994553, 0.728728, 0.171622
+0.994561, 0.734791, 0.168938
+0.994495, 0.740880, 0.166335
+0.994355, 0.746995, 0.163821
+0.994141, 0.753137, 0.161404
+0.993851, 0.759304, 0.159092
+0.993482, 0.765499, 0.156891
+0.993033, 0.771720, 0.154808
+0.992505, 0.777967, 0.152855
+0.991897, 0.784239, 0.151042
+0.991209, 0.790537, 0.149377
+0.990439, 0.796859, 0.147870
+0.989587, 0.803205, 0.146529
+0.988648, 0.809579, 0.145357
+0.987621, 0.815978, 0.144363
+0.986509, 0.822401, 0.143557
+0.985314, 0.828846, 0.142945
+0.984031, 0.835315, 0.142528
+0.982653, 0.841812, 0.142303
+0.981190, 0.848329, 0.142279
+0.979644, 0.854866, 0.142453
+0.977995, 0.861432, 0.142808
+0.976265, 0.868016, 0.143351
+0.974443, 0.874622, 0.144061
+0.972530, 0.881250, 0.144923
+0.970533, 0.887896, 0.145919
+0.968443, 0.894564, 0.147014
+0.966271, 0.901249, 0.148180
+0.964021, 0.907950, 0.149370
+0.961681, 0.914672, 0.150520
+0.959276, 0.921407, 0.151566
+0.956808, 0.928152, 0.152409
+0.954287, 0.934908, 0.152921
+0.951726, 0.941671, 0.152925
+0.949151, 0.948435, 0.152178
+0.946602, 0.955190, 0.150328
+0.944152, 0.961916, 0.146861
+0.941896, 0.968590, 0.140956
+0.940015, 0.975158, 0.131326
Index: /trunk/Ohana/src/kapa2/cmaps/test.redshades.cm
===================================================================
--- /trunk/Ohana/src/kapa2/cmaps/test.redshades.cm	(revision 42389)
+++ /trunk/Ohana/src/kapa2/cmaps/test.redshades.cm	(revision 42389)
@@ -0,0 +1,11 @@
+0.00000, 0.00000, 0.00000, 0.00000, 
+0.09091, 0.34375, 0.11328, 0.03125, 
+0.18182, 0.57812, 0.20312, 0.14453, 
+0.27273, 0.65625, 0.36719, 0.13281, 
+0.36364, 0.75000, 0.56641, 0.11328, 
+0.45455, 0.76562, 0.71094, 0.25391, 
+0.54545, 0.73047, 0.80078, 0.49609, 
+0.75000, 0.70312, 0.91016, 0.77734, 
+0.85000, 0.69141, 0.96875, 0.92578, 
+0.95000, 0.84766, 0.99609, 0.99609, 
+1.00000, 0.95000, 0.99609, 0.99609, 
Index: /trunk/Ohana/src/kapa2/cmaps/viridis.cm
===================================================================
--- /trunk/Ohana/src/kapa2/cmaps/viridis.cm	(revision 42389)
+++ /trunk/Ohana/src/kapa2/cmaps/viridis.cm	(revision 42389)
@@ -0,0 +1,256 @@
+0.267004, 0.004874, 0.329415
+0.268510, 0.009605, 0.335427
+0.269944, 0.014625, 0.341379
+0.271305, 0.019942, 0.347269
+0.272594, 0.025563, 0.353093
+0.273809, 0.031497, 0.358853
+0.274952, 0.037752, 0.364543
+0.276022, 0.044167, 0.370164
+0.277018, 0.050344, 0.375715
+0.277941, 0.056324, 0.381191
+0.278791, 0.062145, 0.386592
+0.279566, 0.067836, 0.391917
+0.280267, 0.073417, 0.397163
+0.280894, 0.078907, 0.402329
+0.281446, 0.084320, 0.407414
+0.281924, 0.089666, 0.412415
+0.282327, 0.094955, 0.417331
+0.282656, 0.100196, 0.422160
+0.282910, 0.105393, 0.426902
+0.283091, 0.110553, 0.431554
+0.283197, 0.115680, 0.436115
+0.283229, 0.120777, 0.440584
+0.283187, 0.125848, 0.444960
+0.283072, 0.130895, 0.449241
+0.282884, 0.135920, 0.453427
+0.282623, 0.140926, 0.457517
+0.282290, 0.145912, 0.461510
+0.281887, 0.150881, 0.465405
+0.281412, 0.155834, 0.469201
+0.280868, 0.160771, 0.472899
+0.280255, 0.165693, 0.476498
+0.279574, 0.170599, 0.479997
+0.278826, 0.175490, 0.483397
+0.278012, 0.180367, 0.486697
+0.277134, 0.185228, 0.489898
+0.276194, 0.190074, 0.493001
+0.275191, 0.194905, 0.496005
+0.274128, 0.199721, 0.498911
+0.273006, 0.204520, 0.501721
+0.271828, 0.209303, 0.504434
+0.270595, 0.214069, 0.507052
+0.269308, 0.218818, 0.509577
+0.267968, 0.223549, 0.512008
+0.266580, 0.228262, 0.514349
+0.265145, 0.232956, 0.516599
+0.263663, 0.237631, 0.518762
+0.262138, 0.242286, 0.520837
+0.260571, 0.246922, 0.522828
+0.258965, 0.251537, 0.524736
+0.257322, 0.256130, 0.526563
+0.255645, 0.260703, 0.528312
+0.253935, 0.265254, 0.529983
+0.252194, 0.269783, 0.531579
+0.250425, 0.274290, 0.533103
+0.248629, 0.278775, 0.534556
+0.246811, 0.283237, 0.535941
+0.244972, 0.287675, 0.537260
+0.243113, 0.292092, 0.538516
+0.241237, 0.296485, 0.539709
+0.239346, 0.300855, 0.540844
+0.237441, 0.305202, 0.541921
+0.235526, 0.309527, 0.542944
+0.233603, 0.313828, 0.543914
+0.231674, 0.318106, 0.544834
+0.229739, 0.322361, 0.545706
+0.227802, 0.326594, 0.546532
+0.225863, 0.330805, 0.547314
+0.223925, 0.334994, 0.548053
+0.221989, 0.339161, 0.548752
+0.220057, 0.343307, 0.549413
+0.218130, 0.347432, 0.550038
+0.216210, 0.351535, 0.550627
+0.214298, 0.355619, 0.551184
+0.212395, 0.359683, 0.551710
+0.210503, 0.363727, 0.552206
+0.208623, 0.367752, 0.552675
+0.206756, 0.371758, 0.553117
+0.204903, 0.375746, 0.553533
+0.203063, 0.379716, 0.553925
+0.201239, 0.383670, 0.554294
+0.199430, 0.387607, 0.554642
+0.197636, 0.391528, 0.554969
+0.195860, 0.395433, 0.555276
+0.194100, 0.399323, 0.555565
+0.192357, 0.403199, 0.555836
+0.190631, 0.407061, 0.556089
+0.188923, 0.410910, 0.556326
+0.187231, 0.414746, 0.556547
+0.185556, 0.418570, 0.556753
+0.183898, 0.422383, 0.556944
+0.182256, 0.426184, 0.557120
+0.180629, 0.429975, 0.557282
+0.179019, 0.433756, 0.557430
+0.177423, 0.437527, 0.557565
+0.175841, 0.441290, 0.557685
+0.174274, 0.445044, 0.557792
+0.172719, 0.448791, 0.557885
+0.171176, 0.452530, 0.557965
+0.169646, 0.456262, 0.558030
+0.168126, 0.459988, 0.558082
+0.166617, 0.463708, 0.558119
+0.165117, 0.467423, 0.558141
+0.163625, 0.471133, 0.558148
+0.162142, 0.474838, 0.558140
+0.160665, 0.478540, 0.558115
+0.159194, 0.482237, 0.558073
+0.157729, 0.485932, 0.558013
+0.156270, 0.489624, 0.557936
+0.154815, 0.493313, 0.557840
+0.153364, 0.497000, 0.557724
+0.151918, 0.500685, 0.557587
+0.150476, 0.504369, 0.557430
+0.149039, 0.508051, 0.557250
+0.147607, 0.511733, 0.557049
+0.146180, 0.515413, 0.556823
+0.144759, 0.519093, 0.556572
+0.143343, 0.522773, 0.556295
+0.141935, 0.526453, 0.555991
+0.140536, 0.530132, 0.555659
+0.139147, 0.533812, 0.555298
+0.137770, 0.537492, 0.554906
+0.136408, 0.541173, 0.554483
+0.135066, 0.544853, 0.554029
+0.133743, 0.548535, 0.553541
+0.132444, 0.552216, 0.553018
+0.131172, 0.555899, 0.552459
+0.129933, 0.559582, 0.551864
+0.128729, 0.563265, 0.551229
+0.127568, 0.566949, 0.550556
+0.126453, 0.570633, 0.549841
+0.125394, 0.574318, 0.549086
+0.124395, 0.578002, 0.548287
+0.123463, 0.581687, 0.547445
+0.122606, 0.585371, 0.546557
+0.121831, 0.589055, 0.545623
+0.121148, 0.592739, 0.544641
+0.120565, 0.596422, 0.543611
+0.120092, 0.600104, 0.542530
+0.119738, 0.603785, 0.541400
+0.119512, 0.607464, 0.540218
+0.119423, 0.611141, 0.538982
+0.119483, 0.614817, 0.537692
+0.119699, 0.618490, 0.536347
+0.120081, 0.622161, 0.534946
+0.120638, 0.625828, 0.533488
+0.121380, 0.629492, 0.531973
+0.122312, 0.633153, 0.530398
+0.123444, 0.636809, 0.528763
+0.124780, 0.640461, 0.527068
+0.126326, 0.644107, 0.525311
+0.128087, 0.647749, 0.523491
+0.130067, 0.651384, 0.521608
+0.132268, 0.655014, 0.519661
+0.134692, 0.658636, 0.517649
+0.137339, 0.662252, 0.515571
+0.140210, 0.665859, 0.513427
+0.143303, 0.669459, 0.511215
+0.146616, 0.673050, 0.508936
+0.150148, 0.676631, 0.506589
+0.153894, 0.680203, 0.504172
+0.157851, 0.683765, 0.501686
+0.162016, 0.687316, 0.499129
+0.166383, 0.690856, 0.496502
+0.170948, 0.694384, 0.493803
+0.175707, 0.697900, 0.491033
+0.180653, 0.701402, 0.488189
+0.185783, 0.704891, 0.485273
+0.191090, 0.708366, 0.482284
+0.196571, 0.711827, 0.479221
+0.202219, 0.715272, 0.476084
+0.208030, 0.718701, 0.472873
+0.214000, 0.722114, 0.469588
+0.220124, 0.725509, 0.466226
+0.226397, 0.728888, 0.462789
+0.232815, 0.732247, 0.459277
+0.239374, 0.735588, 0.455688
+0.246070, 0.738910, 0.452024
+0.252899, 0.742211, 0.448284
+0.259857, 0.745492, 0.444467
+0.266941, 0.748751, 0.440573
+0.274149, 0.751988, 0.436601
+0.281477, 0.755203, 0.432552
+0.288921, 0.758394, 0.428426
+0.296479, 0.761561, 0.424223
+0.304148, 0.764704, 0.419943
+0.311925, 0.767822, 0.415586
+0.319809, 0.770914, 0.411152
+0.327796, 0.773980, 0.406640
+0.335885, 0.777018, 0.402049
+0.344074, 0.780029, 0.397381
+0.352360, 0.783011, 0.392636
+0.360741, 0.785964, 0.387814
+0.369214, 0.788888, 0.382914
+0.377779, 0.791781, 0.377939
+0.386433, 0.794644, 0.372886
+0.395174, 0.797475, 0.367757
+0.404001, 0.800275, 0.362552
+0.412913, 0.803041, 0.357269
+0.421908, 0.805774, 0.351910
+0.430983, 0.808473, 0.346476
+0.440137, 0.811138, 0.340967
+0.449368, 0.813768, 0.335384
+0.458674, 0.816363, 0.329727
+0.468053, 0.818921, 0.323998
+0.477504, 0.821444, 0.318195
+0.487026, 0.823929, 0.312321
+0.496615, 0.826376, 0.306377
+0.506271, 0.828786, 0.300362
+0.515992, 0.831158, 0.294279
+0.525776, 0.833491, 0.288127
+0.535621, 0.835785, 0.281908
+0.545524, 0.838039, 0.275626
+0.555484, 0.840254, 0.269281
+0.565498, 0.842430, 0.262877
+0.575563, 0.844566, 0.256415
+0.585678, 0.846661, 0.249897
+0.595839, 0.848717, 0.243329
+0.606045, 0.850733, 0.236712
+0.616293, 0.852709, 0.230052
+0.626579, 0.854645, 0.223353
+0.636902, 0.856542, 0.216620
+0.647257, 0.858400, 0.209861
+0.657642, 0.860219, 0.203082
+0.668054, 0.861999, 0.196293
+0.678489, 0.863742, 0.189503
+0.688944, 0.865448, 0.182725
+0.699415, 0.867117, 0.175971
+0.709898, 0.868751, 0.169257
+0.720391, 0.870350, 0.162603
+0.730889, 0.871916, 0.156029
+0.741388, 0.873449, 0.149561
+0.751884, 0.874951, 0.143228
+0.762373, 0.876424, 0.137064
+0.772852, 0.877868, 0.131109
+0.783315, 0.879285, 0.125405
+0.793760, 0.880678, 0.120005
+0.804182, 0.882046, 0.114965
+0.814576, 0.883393, 0.110347
+0.824940, 0.884720, 0.106217
+0.835270, 0.886029, 0.102646
+0.845561, 0.887322, 0.099702
+0.855810, 0.888601, 0.097452
+0.866013, 0.889868, 0.095953
+0.876168, 0.891125, 0.095250
+0.886271, 0.892374, 0.095374
+0.896320, 0.893616, 0.096335
+0.906311, 0.894855, 0.098125
+0.916242, 0.896091, 0.100717
+0.926106, 0.897330, 0.104071
+0.935904, 0.898570, 0.108131
+0.945636, 0.899815, 0.112838
+0.955300, 0.901065, 0.118128
+0.964894, 0.902323, 0.123941
+0.974417, 0.903590, 0.130215
+0.983868, 0.904867, 0.136897
+0.993248, 0.906157, 0.143936
Index: /trunk/Ohana/src/kapa2/cmaps/vista.cm
===================================================================
--- /trunk/Ohana/src/kapa2/cmaps/vista.cm	(revision 42389)
+++ /trunk/Ohana/src/kapa2/cmaps/vista.cm	(revision 42389)
@@ -0,0 +1,7 @@
+0.10 0.5 0.8 0.0
+0.28 0.0 1.0 0.2
+0.35 0.2 1.0 0.7
+0.45 0.0 0.0 1.0
+0.60 1.0 0.0 0.9
+0.75 0.6 0.0 0.0
+0.90 0.8 0.0 0.0
Index: /trunk/Ohana/src/kapa2/src/LoadLabels.c
===================================================================
--- /trunk/Ohana/src/kapa2/src/LoadLabels.c	(revision 42388)
+++ /trunk/Ohana/src/kapa2/src/LoadLabels.c	(revision 42389)
@@ -23,6 +23,5 @@
 
   Nbytes = MIN (strlen(label), LABEL_MAXLEN - 1);
-  strncpy (graph[0].label[mode].text, label, Nbytes);
-  label[Nbytes] = 0;
+  strncpy_nowarn (graph[0].label[mode].text, label, Nbytes);
   
   FREE (label);
Index: /trunk/Ohana/src/kapa2/src/LoadTickmarks.c
===================================================================
--- /trunk/Ohana/src/kapa2/src/LoadTickmarks.c	(revision 42388)
+++ /trunk/Ohana/src/kapa2/src/LoadTickmarks.c	(revision 42389)
@@ -47,6 +47,5 @@
       line[128] = 0; 
       ALLOCATE (image[0].tickmarks.objects[Nobjects].text, char, (int) dx + 1);
-      strncpy (image[0].tickmarks.objects[Nobjects].text, line, (int) dx);
-      image[0].tickmarks.objects[Nobjects].text[(int)dx] = 0;
+      strncpy_nowarn (image[0].tickmarks.objects[Nobjects].text, line, (int) dx);
     }      
     
Index: /trunk/Ohana/src/libdvo/include/dvodb.h
===================================================================
--- /trunk/Ohana/src/libdvo/include/dvodb.h	(revision 42388)
+++ /trunk/Ohana/src/libdvo/include/dvodb.h	(revision 42389)
@@ -150,5 +150,5 @@
 
 /* measure fields */
-enum {MEAS_ZERO, 
+typedef enum {MEAS_ZERO, 
       MEAS_GLON, 
       MEAS_GLAT, 
@@ -312,5 +312,5 @@
 
 /* average fields */
-enum {AVE_ZERO, 
+typedef enum {AVE_ZERO, 
       AVE_RA, 
       AVE_DEC, 
@@ -376,5 +376,5 @@
 //       AVE_Xm, 
 
-enum {IMAGE_ZERO, 
+typedef enum {IMAGE_ZERO, 
       IMAGE_RA, 
       IMAGE_DEC, 
Index: /trunk/Ohana/src/libdvo/src/coordops.c
===================================================================
--- /trunk/Ohana/src/libdvo/src/coordops.c	(revision 42388)
+++ /trunk/Ohana/src/libdvo/src/coordops.c	(revision 42389)
@@ -888,5 +888,5 @@
   
   int OldAIPS;
-  char csys[16], ctype[16];
+  char csys[16], ctype[32];
   double rotate, Lambda;
 
@@ -906,5 +906,5 @@
     if (!strncmp (coords[0].ctype, "SLAT", 4)) strcpy (csys, "SLON");
     if (!strcmp (csys, "NONE")) return (FALSE);
-    snprintf (ctype, 16, "%s-%s", csys, &coords[0].ctype[5]);
+    snprintf (ctype, 32, "%s-%s", csys, &coords[0].ctype[5]);
     gfits_modify (header, "CTYPE1",   "%s",  1, ctype);
   }    
Index: /trunk/Ohana/src/libdvo/src/dbFields.c
===================================================================
--- /trunk/Ohana/src/libdvo/src/dbFields.c	(revision 42388)
+++ /trunk/Ohana/src/libdvo/src/dbFields.c	(revision 42389)
@@ -640,4 +640,7 @@
   if (!strcasecmp (fieldName, "PSF_QF"))     	 ESCAPE (MEAS_PSF_QF,         OPIHI_FLT);
   if (!strcasecmp (fieldName, "PSF_QF_PERFECT")) ESCAPE (MEAS_PSF_QF_PERFECT, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "PSFQF"))     	 ESCAPE (MEAS_PSF_QF,         OPIHI_FLT);
+  if (!strcasecmp (fieldName, "PSFQF_PERFECT"))  ESCAPE (MEAS_PSF_QF_PERFECT, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "PSFQFPERFECT"))   ESCAPE (MEAS_PSF_QF_PERFECT, OPIHI_FLT);
   if (!strcasecmp (fieldName, "PSF_CHISQ"))  	 ESCAPE (MEAS_PSF_CHISQ,      OPIHI_FLT);
   if (!strcasecmp (fieldName, "PSF_NDOF"))  	 ESCAPE (MEAS_PSF_NDOF,       OPIHI_INT);
Index: /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_1.c
===================================================================
--- /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_1.c	(revision 42388)
+++ /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_1.c	(revision 42389)
@@ -230,6 +230,5 @@
 
     // RAW_IMAGE_NAME_LEN < DVO_IMAGE_NAME_LEN
-    strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
-    out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
 
     out[i].tzero    	    = in[i].tzero;
@@ -302,6 +301,5 @@
 
     // RAW_IMAGE_NAME_LEN < DVO_IMAGE_NAME_LEN
-    strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
-    out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
 
     out[i].tzero    	    = in[i].tzero;
@@ -358,6 +356,5 @@
 
   for (i = 0; i < Nvalues; i++) {
-    strncpy (out[i].name, in[i].name, 31); // out[32], in[32]
-    out[i].name[31] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32]
 
     out[i].code  = in[i].code;         
@@ -397,6 +394,5 @@
 
   for (i = 0; i < Nvalues; i++) {
-    strncpy (out[i].name, in[i].name, 31); // out[32], in[32]
-    out[i].name[31] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32]
 
     out[i].code = in[i].code;         
Index: /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_2.c
===================================================================
--- /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_2.c	(revision 42388)
+++ /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_2.c	(revision 42389)
@@ -225,6 +225,5 @@
 
     // RAW_IMAGE_NAME_LEN < DVO_IMAGE_NAME_LEN
-    strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
-    out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
 
     out[i].tzero    	    = in[i].tzero;
@@ -294,6 +293,5 @@
 
     // RAW_IMAGE_NAME_LEN < DVO_IMAGE_NAME_LEN
-    strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
-    out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
 
     out[i].tzero    	    = in[i].tzero;
@@ -353,6 +351,5 @@
 
   for (i = 0; i < Nvalues; i++) {
-    strncpy (out[i].name, in[i].name, 31); // out[32], in[32]
-    out[i].name[31] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32]
 
     out[i].code  = in[i].code;         
@@ -390,6 +387,5 @@
 
   for (i = 0; i < Nvalues; i++) {
-    strncpy (out[i].name, in[i].name, 31); // out[32], in[32]
-    out[i].name[31] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32]
 
     out[i].code  = in[i].code;         
Index: /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_3.c
===================================================================
--- /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_3.c	(revision 42388)
+++ /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_3.c	(revision 42389)
@@ -24,6 +24,5 @@
 
     // RAW_IMAGE_NAME_LEN > DVO_IMAGE_NAME_LEN
-    strncpy (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1);
-    out[i].name[DVO_IMAGE_NAME_LEN - 1] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1);
 
     out[i].tzero    	    = in[i].tzero;
@@ -88,6 +87,5 @@
 
     // RAW_IMAGE_NAME_LEN > DVO_IMAGE_NAME_LEN
-    strncpy (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1);
-    out[i].name[DVO_IMAGE_NAME_LEN - 1] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1);
 
     out[i].tzero    	    = in[i].tzero;
@@ -146,6 +144,5 @@
 
   for (i = 0; i < Nvalues; i++) {
-    strncpy (out[i].name, in[i].name, 31); // out[32], in[32]
-    out[i].name[31] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32]
 
     out[i].code  = in[i].code;         
@@ -182,6 +179,5 @@
 
   for (i = 0; i < Nvalues; i++) {
-    strncpy (out[i].name, in[i].name, 31); // out[32], in[32]
-    out[i].name[31] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32]
 
     out[i].code  = in[i].code;         
Index: /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_REF.c
===================================================================
--- /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_REF.c	(revision 42388)
+++ /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_REF.c	(revision 42389)
@@ -153,6 +153,5 @@
 
     // RAW_IMAGE_NAME_LEN > DVO_IMAGE_NAME_LEN
-    strncpy (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1);
-    out[i].name[DVO_IMAGE_NAME_LEN - 1] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1);
 
     out[i].tzero    	    = in[i].tzero;
@@ -220,6 +219,5 @@
 
     // RAW_IMAGE_NAME_LEN > DVO_IMAGE_NAME_LEN
-    strncpy (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1);
-    out[i].name[DVO_IMAGE_NAME_LEN - 1] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1);
 
     out[i].tzero    	    = in[i].tzero;
@@ -277,6 +275,5 @@
 
   for (i = 0; i < Nvalues; i++) {
-    strncpy (out[i].name, in[i].name, 31); // out[32], in[32]
-    out[i].name[31] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32]
 
     out[i].code  = in[i].code;         
@@ -313,6 +310,5 @@
 
   for (i = 0; i < Nvalues; i++) {
-    strncpy (out[i].name, in[i].name, 31); // out[32], in[32]
-    out[i].name[31] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32]
 
     out[i].code  = in[i].code;         
Index: /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_SIM.c
===================================================================
--- /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_SIM.c	(revision 42388)
+++ /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_SIM.c	(revision 42389)
@@ -313,6 +313,5 @@
 
     // RAW_IMAGE_NAME_LEN == DVO_IMAGE_NAME_LEN
-    strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
-    out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
 
     out[i].tzero    	    = in[i].tzero;
@@ -382,6 +381,5 @@
 
     // RAW_IMAGE_NAME_LEN == DVO_IMAGE_NAME_LEN
-    strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
-    out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
 
     out[i].tzero    	    = in[i].tzero;
Index: /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V1.c
===================================================================
--- /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V1.c	(revision 42388)
+++ /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V1.c	(revision 42389)
@@ -249,6 +249,5 @@
 
     // RAW_IMAGE_NAME_LEN > DVO_IMAGE_NAME_LEN
-    strncpy (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1);
-    out[i].name[DVO_IMAGE_NAME_LEN - 1] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1);
 
     out[i].tzero    	    = in[i].tzero;
@@ -317,6 +316,5 @@
 
     // RAW_IMAGE_NAME_LEN > DVO_IMAGE_NAME_LEN
-    strncpy (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1);
-    out[i].name[DVO_IMAGE_NAME_LEN - 1] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1);
 
     out[i].tzero    	    = in[i].tzero;
@@ -375,6 +373,5 @@
 
   for (i = 0; i < Nvalues; i++) {
-    strncpy (out[i].name, in[i].name, 31); // out[32], in[32]
-    out[i].name[31] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32]
 
     out[i].code  = in[i].code;         
@@ -411,6 +408,5 @@
 
   for (i = 0; i < Nvalues; i++) {
-    strncpy (out[i].name, in[i].name, 31); // out[32], in[32]
-    out[i].name[31] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32]
 
     out[i].code  = in[i].code;         
Index: /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V2.c
===================================================================
--- /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V2.c	(revision 42388)
+++ /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V2.c	(revision 42389)
@@ -260,6 +260,5 @@
 
     // RAW_IMAGE_NAME_LEN > DVO_IMAGE_NAME_LEN
-    strncpy (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1);
-    out[i].name[DVO_IMAGE_NAME_LEN - 1] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1);
 
     out[i].tzero    	    = in[i].tzero;
@@ -328,6 +327,5 @@
 
     // RAW_IMAGE_NAME_LEN > DVO_IMAGE_NAME_LEN
-    strncpy (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1);
-    out[i].name[DVO_IMAGE_NAME_LEN - 1] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1);
 
     out[i].tzero    	    = in[i].tzero;
@@ -391,6 +389,5 @@
 
   for (i = 0; i < Nvalues; i++) {
-    strncpy (out[i].name, in[i].name, 31); // out[32], in[32]
-    out[i].name[31] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32]
 
     out[i].code  = in[i].code;         
@@ -427,6 +424,5 @@
 
   for (i = 0; i < Nvalues; i++) {
-    strncpy (out[i].name, in[i].name, 31); // out[32], in[32]
-    out[i].name[31] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32]
 
     out[i].code  = in[i].code;         
Index: /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V3.c
===================================================================
--- /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V3.c	(revision 42388)
+++ /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V3.c	(revision 42389)
@@ -270,6 +270,5 @@
 
     // RAW_IMAGE_NAME_LEN > DVO_IMAGE_NAME_LEN
-    strncpy (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1);
-    out[i].name[DVO_IMAGE_NAME_LEN - 1] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1);
 
     out[i].tzero    	    = in[i].tzero;
@@ -338,6 +337,5 @@
 
     // RAW_IMAGE_NAME_LEN > DVO_IMAGE_NAME_LEN
-    strncpy (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1);
-    out[i].name[DVO_IMAGE_NAME_LEN - 1] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1);
 
     out[i].tzero    	    = in[i].tzero;
@@ -401,6 +399,5 @@
 
   for (i = 0; i < Nvalues; i++) {
-    strncpy (out[i].name, in[i].name, 31); // out[32], in[32]
-    out[i].name[31] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32]
 
     out[i].code  = in[i].code;         
@@ -437,6 +434,5 @@
 
   for (i = 0; i < Nvalues; i++) {
-    strncpy (out[i].name, in[i].name, 31); // out[32], in[32]
-    out[i].name[31] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32]
 
     out[i].code  = in[i].code;         
Index: /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V4.c
===================================================================
--- /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V4.c	(revision 42388)
+++ /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V4.c	(revision 42389)
@@ -308,6 +308,5 @@
 
     // RAW_IMAGE_NAME_LEN > DVO_IMAGE_NAME_LEN
-    strncpy (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1);
-    out[i].name[DVO_IMAGE_NAME_LEN - 1] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1);
 
     out[i].tzero    	    = in[i].tzero;
@@ -376,6 +375,5 @@
 
     // RAW_IMAGE_NAME_LEN > DVO_IMAGE_NAME_LEN
-    strncpy (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1);
-    out[i].name[DVO_IMAGE_NAME_LEN - 1] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1);
 
     out[i].tzero    	    = in[i].tzero;
@@ -439,6 +437,5 @@
 
   for (i = 0; i < Nvalues; i++) {
-    strncpy (out[i].name, in[i].name, 31); // out[32], in[32]
-    out[i].name[31] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32]
 
     out[i].code  = in[i].code;         
@@ -475,6 +472,5 @@
 
   for (i = 0; i < Nvalues; i++) {
-    strncpy (out[i].name, in[i].name, 31); // out[32], in[32]
-    out[i].name[31] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32]
 
     out[i].code  = in[i].code;         
Index: /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V5.c
===================================================================
--- /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V5.c	(revision 42388)
+++ /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V5.c	(revision 42389)
@@ -1134,6 +1134,5 @@
 
     // RAW_IMAGE_NAME_LEN == DVO_IMAGE_NAME_LEN
-    strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
-    out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
 
     out[i].tzero    	    = in[i].tzero;
@@ -1203,6 +1202,5 @@
 
     // RAW_IMAGE_NAME_LEN == DVO_IMAGE_NAME_LEN
-    strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
-    out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
 
     out[i].tzero    	    = in[i].tzero;
@@ -1267,6 +1265,5 @@
 
   for (i = 0; i < Nvalues; i++) {
-    strncpy (out[i].name, in[i].name, 31); // out[32], in[32]
-    out[i].name[31] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32]
 
     out[i].code  = in[i].code;         
@@ -1303,6 +1300,5 @@
 
   for (i = 0; i < Nvalues; i++) {
-    strncpy (out[i].name, in[i].name, 31); // out[32], in[32]
-    out[i].name[31] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32]
 
     out[i].code  = in[i].code;         
Index: /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V5_LOAD.c
===================================================================
--- /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V5_LOAD.c	(revision 42388)
+++ /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V5_LOAD.c	(revision 42389)
@@ -645,6 +645,5 @@
 
     // RAW_IMAGE_NAME_LEN == DVO_IMAGE_NAME_LEN
-    strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
-    out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
 
     out[i].tzero    	    = in[i].tzero;
@@ -714,6 +713,5 @@
 
     // RAW_IMAGE_NAME_LEN == DVO_IMAGE_NAME_LEN
-    strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
-    out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
 
     out[i].tzero    	    = in[i].tzero;
@@ -778,6 +776,5 @@
 
   for (i = 0; i < Nvalues; i++) {
-    strncpy (out[i].name, in[i].name, 31); // out[32], in[32]
-    out[i].name[31] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32]
 
     out[i].code  = in[i].code;         
@@ -814,6 +811,5 @@
 
   for (i = 0; i < Nvalues; i++) {
-    strncpy (out[i].name, in[i].name, 31); // out[32], in[32]
-    out[i].name[31] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32]
 
     out[i].code  = in[i].code;         
Index: /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V6.c
===================================================================
--- /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V6.c	(revision 42388)
+++ /trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V6.c	(revision 42389)
@@ -860,6 +860,5 @@
 
     // RAW_IMAGE_NAME_LEN == DVO_IMAGE_NAME_LEN
-    strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
-    out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
 
     out[i].tzero    	    = in[i].tzero;
@@ -927,6 +926,5 @@
 
     // RAW_IMAGE_NAME_LEN == DVO_IMAGE_NAME_LEN
-    strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
-    out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
 
     out[i].tzero    	    = in[i].tzero;
@@ -990,6 +988,5 @@
 
   for (i = 0; i < Nvalues; i++) {
-    strncpy (out[i].name, in[i].name, 31); // out[32], in[32]
-    out[i].name[31] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32]
 
     out[i].code  = in[i].code;         
@@ -1026,6 +1023,5 @@
 
   for (i = 0; i < Nvalues; i++) {
-    strncpy (out[i].name, in[i].name, 31); // out[32], in[32]
-    out[i].name[31] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32]
 
     out[i].code  = in[i].code;         
Index: /trunk/Ohana/src/libdvo/src/dvo_convert_elixir.c
===================================================================
--- /trunk/Ohana/src/libdvo/src/dvo_convert_elixir.c	(revision 42388)
+++ /trunk/Ohana/src/libdvo/src/dvo_convert_elixir.c	(revision 42389)
@@ -217,6 +217,5 @@
 
     // RAW_IMAGE_NAME_LEN < DVO_IMAGE_NAME_LEN
-    strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
-    out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
 
     out[i].tzero    	    = in[i].tzero;
@@ -291,6 +290,5 @@
 
     // RAW_IMAGE_NAME_LEN < DVO_IMAGE_NAME_LEN
-    strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
-    out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
 
     out[i].tzero    	    = in[i].tzero;
@@ -346,6 +344,5 @@
 
   for (i = 0; i < Nvalues; i++) {
-    strncpy (out[i].name, in[i].name, 31); // out[32], in[32]
-    out[i].name[31] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32]
 
     out[i].code  = in[i].code;         
@@ -386,6 +383,5 @@
 
   for (i = 0; i < Nvalues; i++) {
-    strncpy (out[i].name, in[i].name, 31); // out[32], in[32]
-    out[i].name[31] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32]
 
     out[i].code  = in[i].code;         
Index: /trunk/Ohana/src/libdvo/src/dvo_convert_loneos.c
===================================================================
--- /trunk/Ohana/src/libdvo/src/dvo_convert_loneos.c	(revision 42388)
+++ /trunk/Ohana/src/libdvo/src/dvo_convert_loneos.c	(revision 42389)
@@ -195,6 +195,5 @@
 
     // RAW_IMAGE_NAME_LEN < DVO_IMAGE_NAME_LEN
-    strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
-    out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
 
     out[i].tzero    	    = in[i].tzero;
@@ -270,6 +269,5 @@
 
     // RAW_IMAGE_NAME_LEN < DVO_IMAGE_NAME_LEN
-    strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
-    out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
 
     out[i].tzero    	    = in[i].tzero;
Index: /trunk/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_0.c
===================================================================
--- /trunk/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_0.c	(revision 42388)
+++ /trunk/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_0.c	(revision 42389)
@@ -238,6 +238,5 @@
 
     // RAW_IMAGE_NAME_LEN < DVO_IMAGE_NAME_LEN
-    strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
-    out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
 
     out[i].tzero    	    = in[i].tzero;
@@ -312,6 +311,5 @@
 
     // RAW_IMAGE_NAME_LEN < DVO_IMAGE_NAME_LEN
-    strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
-    out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
 
     out[i].tzero    	    = in[i].tzero;
Index: /trunk/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_1.c
===================================================================
--- /trunk/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_1.c	(revision 42388)
+++ /trunk/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_1.c	(revision 42389)
@@ -238,6 +238,5 @@
 
     // RAW_IMAGE_NAME_LEN < DVO_IMAGE_NAME_LEN
-    strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
-    out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
 
     out[i].tzero    	    = in[i].tzero;
@@ -312,6 +311,5 @@
 
     // RAW_IMAGE_NAME_LEN < DVO_IMAGE_NAME_LEN
-    strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
-    out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination
+    strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1);
 
     out[i].tzero    	    = in[i].tzero;
Index: /trunk/Ohana/src/libdvo/src/skydb.c
===================================================================
--- /trunk/Ohana/src/libdvo/src/skydb.c	(revision 42388)
+++ /trunk/Ohana/src/libdvo/src/skydb.c	(revision 42389)
@@ -275,5 +275,5 @@
       new[Nnew].depth = 2;
       new[Nnew].child = FALSE;
-      strncpy (root, db[i].name, 5); root[5] = 0;
+      strncpy_nowarn (root, db[i].name, 5); 
       myAssert (snprintf (new[Nnew].name, 18, "%s/r%04d.cpt", root, Rnumber) < 18, "overflow");
       Rnumber ++;      
@@ -364,5 +364,5 @@
 	db[N].depth = 3;
 	db[N].child = FALSE;
-	strncpy (root, db[i].name, 10); root[10] = 0;
+	strncpy_nowarn (root, db[i].name, 10); 
 	myAssert (snprintf (db[N].name, 18, "%s.%02d.cpt", root, Rnumber) < 18, "overflow");
 	Rnumber ++;
Index: /trunk/Ohana/src/libdvo/src/skyregion_gsc.c
===================================================================
--- /trunk/Ohana/src/libdvo/src/skyregion_gsc.c	(revision 42388)
+++ /trunk/Ohana/src/libdvo/src/skyregion_gsc.c	(revision 42389)
@@ -247,5 +247,5 @@
   int i;
   double Rmin, Rmax, Dmin, Dmax;
-  char temp[80], name[80];
+  char temp[50], name[80];
   SkyTable *band;
   SkyRegion *regions;
@@ -254,6 +254,5 @@
   ALLOCATE (regions, SkyRegion, Nregions);
   for (i = 0; i < Nregions; i++) {
-    strncpy (temp, &buffer[i*48], 48);
-    temp[48] = 0;
+    strncpy_nowarn (temp, &buffer[i*48], 48);
     hstgsc_hms_to_deg (&Rmin, &Rmax, &Dmin, &Dmax, &temp[7]);
     if (Dmax < Dmin) SWAP (Dmin, Dmax);
Index: /trunk/Ohana/src/libfits/header/F_convert_H.c
===================================================================
--- /trunk/Ohana/src/libfits/header/F_convert_H.c	(revision 42388)
+++ /trunk/Ohana/src/libfits/header/F_convert_H.c	(revision 42389)
@@ -11,5 +11,5 @@
   Ns = strlen (line);
   No = 80 - Ns;
-  strncpy (header->buffer, line, Ns);
+  strncpy_nowarn (header->buffer, line, Ns);
   memset (&header->buffer[Ns], ' ', No);
 
@@ -27,5 +27,5 @@
   Ns = strlen (line);
   No = 80 - Ns;
-  strncpy (header->buffer, line, Ns);
+  strncpy_nowarn (header->buffer, line, Ns);
   memset (&header->buffer[Ns], ' ', No);
 
@@ -46,5 +46,5 @@
   Ns = strlen (line);
   No = 80 - Ns;
-  strncpy (header->buffer, line, Ns);
+  strncpy_nowarn (header->buffer, line, Ns);
   memset (&header->buffer[Ns], ' ', No);
 
Index: /trunk/Ohana/src/libfits/header/F_create_H.c
===================================================================
--- /trunk/Ohana/src/libfits/header/F_create_H.c	(revision 42388)
+++ /trunk/Ohana/src/libfits/header/F_create_H.c	(revision 42389)
@@ -12,8 +12,10 @@
 
   ALLOCATE (header[0].buffer, char, NBYTES);
+  bzero (header[0].buffer, NBYTES);
 
-  for (i = 0; i < NBYTES; i++) 
-    header[0].buffer[i] = ' ';
-  strncpy (header[0].buffer, "END", 3);
+  for (i = 0; i < NBYTES; i++) header[0].buffer[i] = ' ';
+  header[0].buffer[0] = 'E';
+  header[0].buffer[1] = 'N';
+  header[0].buffer[2] = 'D';
 
   gfits_modify_alt (header, "SIMPLE", "%t", 1, header[0].simple);
@@ -22,5 +24,5 @@
 				       
   for (i = 0; i < header[0].Naxes; i++) {
-    snprintf (axis, 10, "NAXIS%d", i + 1);
+    snprintf_nowarn (axis, 10, "NAXIS%d", i + 1);
     gfits_modify (header,  axis, OFF_T_FMT, 1,  header[0].Naxis[i]);
   }
Index: /trunk/Ohana/src/libfits/header/F_modify.c
===================================================================
--- /trunk/Ohana/src/libfits/header/F_modify.c	(revision 42388)
+++ /trunk/Ohana/src/libfits/header/F_modify.c	(revision 42389)
@@ -8,5 +8,7 @@
   /* this function is extremely similar to gfits_print, except it allows for changing an existing field. */
 
-  char comment[82], string[82], data[82];
+  // the output string needs to be long enough to keep the compiler from
+  // complaining, even though the string cannot be more than 80 chars
+  char comment[82], string[200], data[82];
   char *p, *qe;
   va_list argp;
@@ -14,5 +16,5 @@
   va_start (argp, N);
   bzero (data, 82);
-  bzero (string, 82);
+  bzero (string, 200);
   bzero (comment, 82);
 
@@ -46,25 +48,25 @@
     qe += 3;
     qe = MIN (p + 80, qe);
-    strncpy (comment, qe, p + 80 - qe);
+    strncpy_nowarn (comment, qe, p + 80 - qe);
   }
   gfits_pad_ending (comment, 0x20, 82);  /* comment must contain spaces to the end */
 
   /* write the numeric modes */
-  if (!strcmp (mode, "%d"))   { snprintf (string, 81, "%-8s= %20d / %-s ",    field, va_arg (argp, int),       	      	comment); goto found_it; }
-  if (!strcmp (mode, "%ld"))  { snprintf (string, 81, "%-8s= %20ld / %-s ",   field, va_arg (argp, long),      	      	comment); goto found_it; }
-  if (!strcmp (mode, "%lld")) { snprintf (string, 81, "%-8s= %20lld / %-s ",  field, va_arg (argp, long long), 	      	comment); goto found_it; }
-  if (!strcmp (mode, "%Ld"))  { snprintf (string, 81, "%-8s= %20lld / %-s ",  field, va_arg (argp, long long), 	      	comment); goto found_it; }
-  if (!strcmp (mode, "%u"))   { snprintf (string, 81, "%-8s= %20u / %-s ",    field, va_arg (argp, unsigned),  	      	comment); goto found_it; }
-  if (!strcmp (mode, "%lu"))  { snprintf (string, 81, "%-8s= %20lu / %-s ",   field, va_arg (argp, unsigned long),      comment); goto found_it; }
-  if (!strcmp (mode, "%llu")) { snprintf (string, 81, "%-8s= %20llu / %-s ",  field, va_arg (argp, unsigned long long), comment); goto found_it; }
-  if (!strcmp (mode, "%Lu"))  { snprintf (string, 81, "%-8s= %20llu / %-s ",  field, va_arg (argp, unsigned long long), comment); goto found_it; }
-  if (!strcmp (mode, "%hd"))  { snprintf (string, 81, "%-8s= %20d / %-s ",    field, va_arg (argp, int),      	        comment); goto found_it; } 
-  if (!strcmp (mode, "%f"))   { snprintf (string, 81, "%-8s= %20.10f / %-s ", field, va_arg (argp, double),   	        comment); goto found_it; } 
-  if (!strcmp (mode, "%lf"))  { snprintf (string, 81, "%-8s= %20.10f / %-s ", field, va_arg (argp, double),   	        comment); goto found_it; } 
-  if (!strcmp (mode, "%e"))   { snprintf (string, 81, "%-8s= %20.10E / %-s ", field, va_arg (argp, double),   	        comment); goto found_it; } 
-  if (!strcmp (mode, "%le"))  { snprintf (string, 81, "%-8s= %20.10E / %-s ", field, va_arg (argp, double),   	        comment); goto found_it; } 
-  if (!strcmp (mode, "%g"))   { snprintf (string, 81, "%-8s= %20.10G / %-s ", field, va_arg (argp, double),   	        comment); goto found_it; } 
-  if (!strcmp (mode, "%lg"))  { snprintf (string, 81, "%-8s= %20.10G / %-s ", field, va_arg (argp, double),   	        comment); goto found_it; } 
-  if (!strcmp (mode, "%jd"))  { snprintf (string, 81, "%-8s= %20jd / %-s ",   field, va_arg (argp, intmax_t), 	        comment); goto found_it; }
+  if (!strcmp (mode, "%d"))   { snprintf (string, 200, "%-8s= %20d / %-s ",    field, va_arg (argp, int),       	 comment); goto found_it; }
+  if (!strcmp (mode, "%ld"))  { snprintf (string, 200, "%-8s= %20ld / %-s ",   field, va_arg (argp, long),      	 comment); goto found_it; }
+  if (!strcmp (mode, "%lld")) { snprintf (string, 200, "%-8s= %20lld / %-s ",  field, va_arg (argp, long long), 	 comment); goto found_it; }
+  if (!strcmp (mode, "%Ld"))  { snprintf (string, 200, "%-8s= %20lld / %-s ",  field, va_arg (argp, long long), 	 comment); goto found_it; }
+  if (!strcmp (mode, "%u"))   { snprintf (string, 200, "%-8s= %20u / %-s ",    field, va_arg (argp, unsigned),  	 comment); goto found_it; }
+  if (!strcmp (mode, "%lu"))  { snprintf (string, 200, "%-8s= %20lu / %-s ",   field, va_arg (argp, unsigned long),      comment); goto found_it; }
+  if (!strcmp (mode, "%llu")) { snprintf (string, 200, "%-8s= %20llu / %-s ",  field, va_arg (argp, unsigned long long), comment); goto found_it; }
+  if (!strcmp (mode, "%Lu"))  { snprintf (string, 200, "%-8s= %20llu / %-s ",  field, va_arg (argp, unsigned long long), comment); goto found_it; }
+  if (!strcmp (mode, "%hd"))  { snprintf (string, 200, "%-8s= %20d / %-s ",    field, va_arg (argp, int),      	         comment); goto found_it; } 
+  if (!strcmp (mode, "%f"))   { snprintf (string, 200, "%-8s= %20.10f / %-s ", field, va_arg (argp, double),   	         comment); goto found_it; } 
+  if (!strcmp (mode, "%lf"))  { snprintf (string, 200, "%-8s= %20.10f / %-s ", field, va_arg (argp, double),   	         comment); goto found_it; } 
+  if (!strcmp (mode, "%e"))   { snprintf (string, 200, "%-8s= %20.10E / %-s ", field, va_arg (argp, double),   	         comment); goto found_it; } 
+  if (!strcmp (mode, "%le"))  { snprintf (string, 200, "%-8s= %20.10E / %-s ", field, va_arg (argp, double),   	         comment); goto found_it; } 
+  if (!strcmp (mode, "%g"))   { snprintf (string, 200, "%-8s= %20.10G / %-s ", field, va_arg (argp, double),   	         comment); goto found_it; } 
+  if (!strcmp (mode, "%lg"))  { snprintf (string, 200, "%-8s= %20.10G / %-s ", field, va_arg (argp, double),   	         comment); goto found_it; } 
+  if (!strcmp (mode, "%jd"))  { snprintf (string, 200, "%-8s= %20jd / %-s ",   field, va_arg (argp, intmax_t), 	         comment); goto found_it; }
 
   /* string value.  Quotes must be at least 8 chars apart */
@@ -72,6 +74,6 @@
     char *ptr = va_arg (argp, char *);
     if (!ptr) goto invalid;
-    strncpy (data, ptr, 68);
-    snprintf (string, 81, "%-8s= '%-8s' / %-s ", field, data, comment);
+    strncpy_nowarn (data, ptr, 68);
+    snprintf (string, 200, "%-8s= '%-8s' / %-s ", field, data, comment);
     goto found_it;
   }
@@ -83,5 +85,5 @@
 
 found_it:
-  strncpy (p, string, 80);
+  memcpy (p, string, 80); // do not use strncpy_nowarn: do NOT set last byte to NULL
   va_end (argp);
   return (TRUE);
@@ -94,5 +96,5 @@
   /* this function is extremely similar to gfits_print, except it allows for changing an existing field. */
 
-  char comment[82], string[82], data[82];
+  char comment[82], string[200], data[82];
   char *p, *qs, *qe;
   va_list argp;
@@ -100,6 +102,6 @@
   va_start (argp, N);
   bzero (data, 82);
-  bzero (string, 82);
   bzero (comment, 82);
+  bzero (string, 200);
 
   if (mode[0] != '%') {
@@ -132,5 +134,5 @@
     qe += 3;
     qe = MIN (p + 80, qe);
-    strncpy (comment, qe, p + 80 - qe);
+    strncpy_nowarn (comment, qe, p + 80 - qe);
   }
   gfits_pad_ending (comment, 0x20, 82);  /* comment must contain spaces to the end */
@@ -139,7 +141,7 @@
   if (!strcmp (mode, "%t")) {
     if (va_arg (argp, int)) 
-      snprintf (string, 81, "%-8s= %18s T / %-s ", field, " ", comment);
+      snprintf (string, 200, "%-8s= %18s T / %-s ", field, " ", comment);
     else
-      snprintf (string, 81, "%-8s= %18s F / %-s ", field, " ", comment);
+      snprintf (string, 200, "%-8s= %18s F / %-s ", field, " ", comment);
   }
 
@@ -148,6 +150,6 @@
     char *ptr = va_arg (argp, char *);
     if (!ptr) goto invalid;
-    strncpy (data, ptr, 71);
-    snprintf (string, 81, "%-8s %-71s", field, data);
+    strncpy_nowarn (data, ptr, 71);
+    snprintf (string, 200, "%-8s %-71s", field, data);
   }  
 
@@ -161,15 +163,15 @@
     if (qs[-1] == 0x27) qs --;
 
-    strncpy (data, qs, MAX (MIN (qe - qs, 71), 0));
+    strncpy_nowarn (data, qs, MAX (MIN (qe - qs, 71), 0));
 
     char *ptr = va_arg (argp, char *);
     if (!ptr) goto invalid;
-    strncpy (comment, ptr, 80);
+    strncpy_nowarn (comment, ptr, 80);
     gfits_pad_ending (comment, 0x20, 82);  /* comment must contain spaces to the end */
-    snprintf (string, 81, "%-8s= %s / %-s", field, data, comment);
+    snprintf (string, 200, "%-8s= %s / %-s", field, data, comment);
     /* this will keep the original line, but truncate the comment */
   }
 
-  strncpy (p, string, 80);
+  memcpy (p, string, 80); // do not use strncpy_nowarn: do NOT set last byte to NULL
   va_end (argp);
   return (TRUE);
Index: /trunk/Ohana/src/libfits/header/F_print.c
===================================================================
--- /trunk/Ohana/src/libfits/header/F_print.c	(revision 42388)
+++ /trunk/Ohana/src/libfits/header/F_print.c	(revision 42389)
@@ -8,5 +8,5 @@
 
   static char blank[] = " ";
-  char string[82], line[80];
+  char string[200], line[80];
   char *p;
   va_list argp;  
@@ -46,20 +46,20 @@
 
   /* write the numeric modes */
-  if (!strcmp (mode, "%d"))  { snprintf (string, 81, "%-8s= %20d / %46s ",    field, va_arg (argp, int),                blank); goto found_it; }
-  if (!strcmp (mode, "%ld")) { snprintf (string, 81, "%-8s= %20ld / %46s ",   field, va_arg (argp, long),               blank); goto found_it; }
-  if (!strcmp (mode, "%lld")){ snprintf (string, 81, "%-8s= %20lld / %46s ",  field, va_arg (argp, long long),          blank); goto found_it; }
-  if (!strcmp (mode, "%Ld")) { snprintf (string, 81, "%-8s= %20lld / %46s ",  field, va_arg (argp, long long),          blank); goto found_it; }
-  if (!strcmp (mode, "%u"))  { snprintf (string, 81, "%-8s= %20u / %46s ",    field, va_arg (argp, unsigned),           blank); goto found_it; }
-  if (!strcmp (mode, "%lu")) { snprintf (string, 81, "%-8s= %20lu / %46s ",   field, va_arg (argp, unsigned long),      blank); goto found_it; }
-  if (!strcmp (mode, "%llu")){ snprintf (string, 81, "%-8s= %20llu / %46s ",  field, va_arg (argp, unsigned long long), blank); goto found_it; }
-  if (!strcmp (mode, "%Lu")) { snprintf (string, 81, "%-8s= %20llu / %46s ",  field, va_arg (argp, unsigned long long), blank); goto found_it; }
-  if (!strcmp (mode, "%hd")) { snprintf (string, 81, "%-8s= %20d / %46s ",    field, va_arg (argp, int),                blank); goto found_it; }
-  if (!strcmp (mode, "%f"))  { snprintf (string, 81, "%-8s= %20.10f / %46s ", field, va_arg (argp, double),             blank); goto found_it; }
-  if (!strcmp (mode, "%lf")) { snprintf (string, 81, "%-8s= %20.10f / %46s ", field, va_arg (argp, double),             blank); goto found_it; }
-  if (!strcmp (mode, "%e"))  { snprintf (string, 81, "%-8s= %20.10E / %46s ", field, va_arg (argp, double),             blank); goto found_it; }
-  if (!strcmp (mode, "%le")) { snprintf (string, 81, "%-8s= %20.10E / %46s ", field, va_arg (argp, double),             blank); goto found_it; }
-  if (!strcmp (mode, "%g"))  { snprintf (string, 81, "%-8s= %20.10G / %46s ", field, va_arg (argp, double),             blank); goto found_it; }
-  if (!strcmp (mode, "%lg")) { snprintf (string, 81, "%-8s= %20.10G / %46s ", field, va_arg (argp, double),             blank); goto found_it; }
-  if (!strcmp (mode, "%jd")) { snprintf (string, 81, "%-8s= %20jd / %46s ",   field, va_arg (argp, intmax_t),           blank); goto found_it; }
+  if (!strcmp (mode, "%d"))  { snprintf (string, 200, "%-8s= %20d / %46s ",    field, va_arg (argp, int),                blank); goto found_it; }
+  if (!strcmp (mode, "%ld")) { snprintf (string, 200, "%-8s= %20ld / %46s ",   field, va_arg (argp, long),               blank); goto found_it; }
+  if (!strcmp (mode, "%lld")){ snprintf (string, 200, "%-8s= %20lld / %46s ",  field, va_arg (argp, long long),          blank); goto found_it; }
+  if (!strcmp (mode, "%Ld")) { snprintf (string, 200, "%-8s= %20lld / %46s ",  field, va_arg (argp, long long),          blank); goto found_it; }
+  if (!strcmp (mode, "%u"))  { snprintf (string, 200, "%-8s= %20u / %46s ",    field, va_arg (argp, unsigned),           blank); goto found_it; }
+  if (!strcmp (mode, "%lu")) { snprintf (string, 200, "%-8s= %20lu / %46s ",   field, va_arg (argp, unsigned long),      blank); goto found_it; }
+  if (!strcmp (mode, "%llu")){ snprintf (string, 200, "%-8s= %20llu / %46s ",  field, va_arg (argp, unsigned long long), blank); goto found_it; }
+  if (!strcmp (mode, "%Lu")) { snprintf (string, 200, "%-8s= %20llu / %46s ",  field, va_arg (argp, unsigned long long), blank); goto found_it; }
+  if (!strcmp (mode, "%hd")) { snprintf (string, 200, "%-8s= %20d / %46s ",    field, va_arg (argp, int),                blank); goto found_it; }
+  if (!strcmp (mode, "%f"))  { snprintf (string, 200, "%-8s= %20.10f / %46s ", field, va_arg (argp, double),             blank); goto found_it; }
+  if (!strcmp (mode, "%lf")) { snprintf (string, 200, "%-8s= %20.10f / %46s ", field, va_arg (argp, double),             blank); goto found_it; }
+  if (!strcmp (mode, "%e"))  { snprintf (string, 200, "%-8s= %20.10E / %46s ", field, va_arg (argp, double),             blank); goto found_it; }
+  if (!strcmp (mode, "%le")) { snprintf (string, 200, "%-8s= %20.10E / %46s ", field, va_arg (argp, double),             blank); goto found_it; }
+  if (!strcmp (mode, "%g"))  { snprintf (string, 200, "%-8s= %20.10G / %46s ", field, va_arg (argp, double),             blank); goto found_it; }
+  if (!strcmp (mode, "%lg")) { snprintf (string, 200, "%-8s= %20.10G / %46s ", field, va_arg (argp, double),             blank); goto found_it; }
+  if (!strcmp (mode, "%jd")) { snprintf (string, 200, "%-8s= %20jd / %46s ",   field, va_arg (argp, intmax_t),           blank); goto found_it; }
 
   /* string value.  Quotes must be at least 8 chars apart.  Longer lines will this should be fixed to allow arbitrary string lengths, up to 69 chars */
@@ -69,5 +69,5 @@
     strcpy (line, ptr);
     line[68] = 0;
-    snprintf (string, 81, "%-8s= '%-8s' / %46s ", field, line, blank);
+    snprintf (string, 200, "%-8s= '%-8s' / %46s ", field, line, blank);
     goto found_it;
   }
@@ -78,5 +78,5 @@
 
 found_it:
-  strncpy (p, string, 80);
+  memcpy (p, string, 80); // do not use strncpy_nowarn: do NOT set last byte to NULL
   va_end (argp);
   return (TRUE);
@@ -89,5 +89,5 @@
 
   static char blank[] = " ";
-  char string[82], line[80];
+  char string[200], line[80];
   char *p, a;
   va_list argp;  
@@ -126,7 +126,7 @@
     a = va_arg (argp, int);
     if (a == 1)
-      snprintf (string, 81, "%-8s= %18s T / %46s ", field, blank, blank);
+      snprintf (string, 200, "%-8s= %18s T / %46s ", field, blank, blank);
     else
-      snprintf (string, 81, "%-8s= %18s F / %46s ", field, blank, blank);
+      snprintf (string, 200, "%-8s= %18s F / %46s ", field, blank, blank);
   }
 
@@ -137,6 +137,6 @@
     if (!ptr) goto invalid;
     bzero (line, 80);
-    strncpy (line, ptr, 71);
-    snprintf (string, 81, "%-8s %-71s", field, line);
+    strncpy_nowarn (line, ptr, 71);
+    snprintf (string, 200, "%-8s %-71s", field, line);
   }  
 
@@ -154,5 +154,5 @@
   if (!strcmp (mode, "%C")) goto invalid;
 
-  strncpy (p, string, 80);
+  memcpy (p, string, 80); // do not use strncpy_nowarn: do NOT set last byte to NULL
   
   va_end (argp);
Index: /trunk/Ohana/src/libfits/header/F_scan.c
===================================================================
--- /trunk/Ohana/src/libfits/header/F_scan.c	(revision 42388)
+++ /trunk/Ohana/src/libfits/header/F_scan.c	(revision 42389)
@@ -111,5 +111,5 @@
   /* non-data entry (COMMENT, HISTORY) */
   if (!strcmp (mode, "%S")) {
-    strncpy (va_arg (argp, char *), p + 8, FT_HISTORY_LENGTH);
+    strncpy_nowarn (va_arg (argp, char *), p + 8, FT_HISTORY_LENGTH);
     return (TRUE);
   }
Index: /trunk/Ohana/src/libfits/matrix/F_compress_M.c
===================================================================
--- /trunk/Ohana/src/libfits/matrix/F_compress_M.c	(revision 42388)
+++ /trunk/Ohana/src/libfits/matrix/F_compress_M.c	(revision 42389)
@@ -86,10 +86,10 @@
   char keyword[11];
   for (i = 0; i < header[0].Naxes; i++) {
-    snprintf (keyword, 10, "ZNAXIS%d", i + 1);
+    snprintf_nowarn (keyword, 10, "ZNAXIS%d", i + 1);
     if (!gfits_modify (theader, keyword, OFF_T_FMT, 1,  header[0].Naxis[i])) ESCAPE;
   }
 
   for (i = 0; i < header->Naxes; i++) {
-    snprintf (keyword, 10, "ZTILE%d", i + 1);
+    snprintf_nowarn (keyword, 10, "ZTILE%d", i + 1);
     if (!gfits_modify (theader, keyword, "%lu", 1, ztile[i])) ESCAPE;
   }
@@ -131,8 +131,8 @@
   // note the difference between the keywords (1 indexed) and the variables (0 indexed)
   for (i = 0; i < Noptions; i++) {
-    snprintf (key, 10, "ZNAME%d", i + 1);
+    snprintf_nowarn (key, 10, "ZNAME%d", i + 1);
     if (!gfits_modify (header, key, "%s", 1, optname[i])) break;
 
-    snprintf (key, 10, "ZVAL%d", i + 1);
+    snprintf_nowarn (key, 10, "ZVAL%d", i + 1);
     if (!gfits_modify (header, key, "%s", 1, optvalue[i])) break;
   }
Index: /trunk/Ohana/src/libfits/matrix/F_uncompress_M.c
===================================================================
--- /trunk/Ohana/src/libfits/matrix/F_uncompress_M.c	(revision 42388)
+++ /trunk/Ohana/src/libfits/matrix/F_uncompress_M.c	(revision 42389)
@@ -90,6 +90,6 @@
   int axis;
   for (axis = 0; axis < header->Naxes; axis++) {
-    snprintf (zaxis, 10, "ZNAXIS%d", axis + 1);
-    snprintf (naxis, 10, "NAXIS%d", axis + 1);
+    snprintf_nowarn (zaxis, 10, "ZNAXIS%d", axis + 1);
+    snprintf_nowarn (naxis, 10, "NAXIS%d",  axis + 1);
     MOD_KEYWORD_REQUIRED (zaxis,  naxis,  OFF_T_FMT,  &header->Naxis[axis],  header->Naxis[axis]);
   }    
@@ -108,5 +108,5 @@
     // if ZTILE1 exists, all ZTILEn must exist:
     for (axis = 1; axis < header->Naxes; axis++) {
-      snprintf (key, 10, "ZTILE%d", axis + 1); 
+      snprintf_nowarn (key, 10, "ZTILE%d", axis + 1); 
       if (!gfits_scan (header, key, "%lu", 1, &ztile[axis])) ESCAPE;
       gfits_delete (header, key, 1);
Index: /trunk/Ohana/src/libfits/table/F_create_TH.c
===================================================================
--- /trunk/Ohana/src/libfits/table/F_create_TH.c	(revision 42388)
+++ /trunk/Ohana/src/libfits/table/F_create_TH.c	(revision 42389)
@@ -17,8 +17,10 @@
   myAssert (!header->buffer, "failed to init header or free buffer?");
   ALLOCATE (header[0].buffer, char, NBYTES);
+  bzero (header[0].buffer, NBYTES);
   
-  for (i = 0; i < NBYTES; i++) 
-  header[0].buffer[i] = ' ';
-  strncpy (header[0].buffer, "END", 3);
+  for (i = 0; i < NBYTES; i++) header[0].buffer[i] = ' ';
+  header[0].buffer[0] = 'E';
+  header[0].buffer[1] = 'N';
+  header[0].buffer[2] = 'D';
   
   gfits_modify (header, "XTENSION", "%s", 1, type);
Index: /trunk/Ohana/src/libfits/table/F_get_T_column.c
===================================================================
--- /trunk/Ohana/src/libfits/table/F_get_T_column.c	(revision 42388)
+++ /trunk/Ohana/src/libfits/table/F_get_T_column.c	(revision 42389)
@@ -32,6 +32,5 @@
     ALLOCATE (Ivalues, int, table[0].Naxis[1]);
     for (i = 0; i < table[0].Naxis[1]; i++) {
-      strncpy (tmp, &table[0].buffer[i*table[0].Naxis[0] + start], Nchar);
-      tmp[Nchar] = 0;
+      strncpy_nowarn (tmp, &table[0].buffer[i*table[0].Naxis[0] + start], Nchar);
       Ivalues[i] = atof (tmp);
     }
@@ -41,6 +40,5 @@
     ALLOCATE (Dvalues, double, table[0].Naxis[1]);
     for (i = 0; i < table[0].Naxis[1]; i++) {
-      strncpy (tmp, &table[0].buffer[i*table[0].Naxis[0] + start], Nchar);
-      tmp[Nchar] = 0;
+      strncpy_nowarn (tmp, &table[0].buffer[i*table[0].Naxis[0] + start], Nchar);
       Dvalues[i] = atof (tmp);
     }
@@ -53,6 +51,5 @@
     for (i = 0; i < table[0].Naxis[1]; i++) {
       ALLOCATE (Cvalues[i], char, N + 1);
-      strncpy (Cvalues[i], &table[0].buffer[i*table[0].Naxis[0] + start], N);
-      Cvalues[i][N] = 0;
+      strncpy_nowarn (Cvalues[i], &table[0].buffer[i*table[0].Naxis[0] + start], N);
     }
     values[0] = (char *) Cvalues;
Index: /trunk/Ohana/src/libfits/table/F_get_T_value.c
===================================================================
--- /trunk/Ohana/src/libfits/table/F_get_T_value.c	(revision 42388)
+++ /trunk/Ohana/src/libfits/table/F_get_T_value.c	(revision 42389)
@@ -26,6 +26,5 @@
   
   byte = Y*table[0].Naxis[0] + start;
-  strncpy (tmp, &table[0].buffer[byte], Nchar);
-  tmp[Nchar] = 0;
+  strncpy_nowarn (tmp, &table[0].buffer[byte], Nchar);
 
   if (!strcmp (mode, "%d"))  *(int      *) value = (int)      atof (tmp);
Index: /trunk/Ohana/src/libfits/table/F_table_column.c
===================================================================
--- /trunk/Ohana/src/libfits/table/F_table_column.c	(revision 42388)
+++ /trunk/Ohana/src/libfits/table/F_table_column.c	(revision 42389)
@@ -72,6 +72,5 @@
 
   for (i = 0; i < table[0].Naxis[1]; i++) {
-    strncpy (temp, &table[0].buffer[i*table[0].Naxis[0] + start - 1], width);
-    temp[width] = 0;
+    strncpy_nowarn (temp, &table[0].buffer[i*table[0].Naxis[0] + start - 1], width);
     switch (M) {
     case 0:
Index: /trunk/Ohana/src/libkapa/src/RotFont.c
===================================================================
--- /trunk/Ohana/src/libkapa/src/RotFont.c	(revision 42388)
+++ /trunk/Ohana/src/libkapa/src/RotFont.c	(revision 42389)
@@ -30,5 +30,5 @@
   currentfont = RotFonts[DEFFONT].font;
   currentscale = 1.0;
-  strncpy (currentname, RotFonts[DEFFONT].name, 63); currentname[63] = 0;
+  strncpy_nowarn (currentname, RotFonts[DEFFONT].name, 63); 
   currentsize = RotFonts[DEFFONT].size;
 }
@@ -79,5 +79,5 @@
     currentsize = size;
     if (name != currentname) {
-      strncpy (currentname, name, 63); currentname[63] = 0;
+      strncpy_nowarn (currentname, name, 63); 
     }
     return (TRUE);
Index: /trunk/Ohana/src/libohana/include/ohana.h
===================================================================
--- /trunk/Ohana/src/libohana/include/ohana.h	(revision 42388)
+++ /trunk/Ohana/src/libohana/include/ohana.h	(revision 42389)
@@ -296,4 +296,5 @@
 char   *strcreate              PROTO((char *string));
 char   *strncreate             PROTO((char *string, int n));
+char   *strncpy_nowarn         PROTO((char *dest, char *src, size_t n));
 int     strextend              PROTO((char **input, char *format,...)) OHANA_FORMAT(printf, 2, 3);
 int     scan_line              PROTO((FILE *f, char *line)); 
Index: /trunk/Ohana/src/libohana/src/findexec.c
===================================================================
--- /trunk/Ohana/src/libohana/src/findexec.c	(revision 42388)
+++ /trunk/Ohana/src/libohana/src/findexec.c	(revision 42389)
@@ -256,8 +256,10 @@
 }
 
+# define OHANA_MAX_PATH 1024
+# define OHANA_MAX_NAME 1280
 char *findexec (int argc, char **argv) {
 
   int i, N, done, status;
-  char *c, *e, *dir, path[1024], name[1024];
+  char *c, *e, *dir, path[OHANA_MAX_PATH], name[OHANA_MAX_NAME];
 
   /* if given an absolute or relative path, use it */
@@ -286,14 +288,14 @@
     i = 0;
     while (!done) {
-      bzero (path, 1024);
+      bzero (path, OHANA_MAX_PATH);
       if (e == (char *) NULL) {
 	done = TRUE;
-	strncpy (path, c, strlen(c));
+	strncpy_nowarn (path, c, strlen(c));
       } else {
-	strncpy (path, c, e-c);
+	strncpy_nowarn (path, c, e-c);
 	c = e+1;
 	e = strchr (c, ':');
       }
-      snprintf (name, 1024, "%s/%s", path, argv[0]);
+      snprintf (name, OHANA_MAX_NAME, "%s/%s", path, argv[0]);
       status = check_file_exec (name);
 
Index: /trunk/Ohana/src/libohana/src/string.c
===================================================================
--- /trunk/Ohana/src/libohana/src/string.c	(revision 42388)
+++ /trunk/Ohana/src/libohana/src/string.c	(revision 42389)
@@ -42,4 +42,20 @@
   
   return (value);
+}
+
+// gcc (Ubuntu 20.04) complains when strncpy is used to copy a fraction of a buffer,
+// potentially skipping the ending NULL.  To avoid the error, manually copy
+// and (to ensure the buffer ends in a NULL) set the last + 1 byte to NUL: 
+// WARNING : len(dest) must be >= n + 1
+char *strncpy_nowarn (char *dest, char *src, size_t n) {
+
+  size_t i;
+  
+  char *d = dest;
+  char *s = src;
+  for (i = 0; i < n && *s != 0; i++, d++, s++) { *d = *s; }
+  for ( ; i <= n; i++, d++) { *d = 0; }
+  
+  return dest;
 }
 
@@ -125,8 +141,7 @@
   ALLOCATE (out, char, N1 + N2 + N3 + 1);
 
-  strncpy (out, string, N1);
-  strncpy (&out[N1], with, N2);
-  strncpy (&out[N1+N2], ext, N3);
-  out[N1+N2+N3] = 0;
+  strncpy_nowarn (&out[0],     string, N1);
+  strncpy_nowarn (&out[N1],    with,   N2);
+  strncpy_nowarn (&out[N1+N2], ext,    N3);
 
   return out;
Index: /trunk/Ohana/src/misc/src/cfhtlog.c
===================================================================
--- /trunk/Ohana/src/misc/src/cfhtlog.c	(revision 42388)
+++ /trunk/Ohana/src/misc/src/cfhtlog.c	(revision 42389)
@@ -303,6 +303,5 @@
 		           year, month,day,hour,min);
 		    for (j = 0; j < nprobes; j++) {
-		        strncpy(bufstr, data + (14 + probes[j]*9), 9);
-		        bufstr[9] =0;
+		        strncpy_nowarn(bufstr, data + (14 + probes[j]*9), 9);
 		        printf("%s ", bufstr);
 		    }
Index: /trunk/Ohana/src/misc/src/fakecmp.c
===================================================================
--- /trunk/Ohana/src/misc/src/fakecmp.c	(revision 42388)
+++ /trunk/Ohana/src/misc/src/fakecmp.c	(revision 42389)
@@ -81,5 +81,5 @@
     line[80] = 0;
     bzero (keyword, 10);
-    strncpy (keyword, line, 8);
+    strncpy_nowarn (keyword, line, 8);
     
     /* replace existing keywords, unless this is a COMMENT or HISTORY field */
@@ -87,5 +87,5 @@
       p = gfits_header_field (&header, keyword, 1);
       if (p != (char *) NULL) {
-	strncpy (p, line, 80);
+	strncpy_nowarn (p, line, 80);
 	continue;
       }
@@ -106,5 +106,5 @@
 
     /* insert the new line here */
-    strncpy (p, line, 80);
+    strncpy_nowarn (p, line, 80);
   }
 
Index: /trunk/Ohana/src/misc/src/gtfringetable.c
===================================================================
--- /trunk/Ohana/src/misc/src/gtfringetable.c	(revision 42388)
+++ /trunk/Ohana/src/misc/src/gtfringetable.c	(revision 42389)
@@ -72,5 +72,5 @@
       N = strlen (p);
 
-    strncpy (line, p, N);
+    strncpy_nowarn (line, p, N);
 
     fprintf (stderr, "%s\n", line);
Index: /trunk/Ohana/src/misc/src/mkfringetable.c
===================================================================
--- /trunk/Ohana/src/misc/src/mkfringetable.c	(revision 42388)
+++ /trunk/Ohana/src/misc/src/mkfringetable.c	(revision 42389)
@@ -200,5 +200,5 @@
       N = strlen (p);
 
-    strncpy (line, p, N);
+    strncpy_nowarn (line, p, N);
 
     fprintf (stderr, "%s\n", line);
Index: /trunk/Ohana/src/mosastro/src/getstone.c
===================================================================
--- /trunk/Ohana/src/mosastro/src/getstone.c	(revision 42388)
+++ /trunk/Ohana/src/mosastro/src/getstone.c	(revision 42389)
@@ -28,5 +28,5 @@
 	    &regions[Nregion].RA[0], &regions[Nregion].RA[1], 
 	    &regions[Nregion].DEC[0], &regions[Nregion].DEC[1]);
-    sprintf (line, "%s/%s", StoneRegions, filename);
+    snprintf_nowarn (line, 1024, "%s/%s", StoneRegions, filename);
     regname[Nregion] = strcreate (line);
     Nregion ++;
Index: /trunk/Ohana/src/mosastro/src/getusno.c
===================================================================
--- /trunk/Ohana/src/mosastro/src/getusno.c	(revision 42388)
+++ /trunk/Ohana/src/mosastro/src/getusno.c	(revision 42389)
@@ -9,4 +9,6 @@
   1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10};
 
+# define MY_MAX_PATH 256
+
 StarData *getusno (CatStats *catstats, int *Nstars) {
 
@@ -15,5 +17,5 @@
   float hours[100];
   int start[100], number[100], *buffer, *buf;
-  char filename[128];
+  char filename[MY_MAX_PATH];
   FILE *f;
   int iRA0, iRA1, iDEC0, iDEC1;
@@ -59,5 +61,5 @@
     
     /* load accelerator file */
-    sprintf (filename, "%s/zone%04d.acc", USNO_A_DIR, spd); 
+    snprintf_nowarn (filename, MY_MAX_PATH, "%s/zone%04d.acc", USNO_A_DIR, spd); 
     if (VERBOSE) fprintf (stderr, "reading from %s\n", filename);
     f = fopen (filename, "r");
@@ -82,5 +84,5 @@
     
     /* open data file */
-    sprintf (filename, "%s/zone%04d.cat", USNO_A_DIR, spd);
+    snprintf_nowarn (filename, MY_MAX_PATH, "%s/zone%04d.cat", USNO_A_DIR, spd);
     if (VERBOSE) fprintf (stderr, "reading from %s\n", filename);
     f = fopen (filename, "r");
Index: /trunk/Ohana/src/mosastro/src/getusnob.c
===================================================================
--- /trunk/Ohana/src/mosastro/src/getusnob.c	(revision 42388)
+++ /trunk/Ohana/src/mosastro/src/getusnob.c	(revision 42389)
@@ -2,4 +2,6 @@
 # define NBYTE   4
 # define NELEM  20
+
+# define MY_MAX_PATH 256
 
 StarData *getusnob (CatStats *catstats, int *Nstars) {
@@ -9,5 +11,5 @@
   float hours[100];
   int start[100], number[100], *buffer, *buf;
-  char filename[128];
+  char filename[MY_MAX_PATH];
   FILE *f;
   double DEC1;
@@ -42,5 +44,5 @@
     
     /* load accelerator file */
-    sprintf (filename, "%s/%03d/b%04d.acc", USNO_B_DIR, (int)(spd/10), spd); 
+    snprintf_nowarn (filename, MY_MAX_PATH, "%s/%03d/b%04d.acc", USNO_B_DIR, (int)(spd/10), spd); 
     fprintf (stderr, "reading from %s\n", filename);
     f = fopen (filename, "r");
@@ -65,5 +67,5 @@
     
     /* open data file */
-    sprintf (filename, "%s/%03d/b%04d.cat", USNO_B_DIR, (int)(spd/10), spd); 
+    snprintf_nowarn (filename, MY_MAX_PATH, "%s/%03d/b%04d.cat", USNO_B_DIR, (int)(spd/10), spd); 
     fprintf (stderr, "reading from %s\n", filename);
     f = fopen (filename, "r");
Index: /trunk/Ohana/src/mosastro/src/output.c
===================================================================
--- /trunk/Ohana/src/mosastro/src/output.c	(revision 42388)
+++ /trunk/Ohana/src/mosastro/src/output.c	(revision 42389)
@@ -17,5 +17,5 @@
 
     bzero (outname, 256);
-    strncpy (outname, chip[i].file, N);
+    strncpy_nowarn (outname, chip[i].file, N);
 
     strcat (outname, ext);
Index: /trunk/Ohana/src/nightd/include/nightd.h
===================================================================
--- /trunk/Ohana/src/nightd/include/nightd.h	(revision 42388)
+++ /trunk/Ohana/src/nightd/include/nightd.h	(revision 42389)
@@ -3,18 +3,20 @@
 # include <errno.h>
 
+# define MY_MAX_PATH 256
+
 FILE *LogFile;
 char *Program;
 
-char logfile[256];
+char logfile[MY_MAX_PATH];
 char **MainCommand;
 char **InitCommand;
 char **DoneCommand;
 
-char TestCommand[256];
+char TestCommand[MY_MAX_PATH];
 
-char DateStr[256];
-char TimeStr[256];
+char DateStr[MY_MAX_PATH];
+char TimeStr[MY_MAX_PATH];
 
-char PIDFile[256];
+char PIDFile[MY_MAX_PATH];
 
 float NightStart;
Index: /trunk/Ohana/src/nightd/src/GetStatus.c
===================================================================
--- /trunk/Ohana/src/nightd/src/GetStatus.c	(revision 42388)
+++ /trunk/Ohana/src/nightd/src/GetStatus.c	(revision 42389)
@@ -23,5 +23,5 @@
 int ResetConfig () {
 
-  char user[256], machine[256], line[256];
+  char user[MY_MAX_PATH], machine[MY_MAX_PATH], line[MY_MAX_PATH];
   pid_t pid;
 
@@ -32,5 +32,5 @@
   }
 
-  sprintf (line, "rsh %s kill -USR1 %d", machine, pid);
+  snprintf_nowarn (line, MY_MAX_PATH, "rsh %s kill -USR1 %d", machine, pid);
   if (system (line) == -1) {
     fprintf (stderr, "failed to send signal\n");
@@ -42,5 +42,5 @@
 int SendShutdown () {
 
-  char user[256], machine[256], line[256];
+  char user[MY_MAX_PATH], machine[MY_MAX_PATH], line[MY_MAX_PATH];
   pid_t pid;
 
@@ -51,5 +51,5 @@
   }
 
-  sprintf (line, "rsh %s kill -TERM %d", machine, pid);
+  snprintf_nowarn (line, MY_MAX_PATH, "rsh %s kill -TERM %d", machine, pid);
   if (system (line) == -1) {
     fprintf (stderr, "failed to send signal\n");
Index: /trunk/Ohana/src/nightd/src/misc.c
===================================================================
--- /trunk/Ohana/src/nightd/src/misc.c	(revision 42388)
+++ /trunk/Ohana/src/nightd/src/misc.c	(revision 42389)
@@ -208,6 +208,5 @@
     Nchar = e - p;
     ALLOCATE (args[N], char, Nchar + 1);
-    strncpy (args[N], p, Nchar);
-    args[N][Nchar] = 0;
+    strncpy_nowarn (args[N], p, Nchar);
     p = e;
     for (; isspace (*p); p++);
Index: /trunk/Ohana/src/opihi/Makefile.Common
===================================================================
--- /trunk/Ohana/src/opihi/Makefile.Common	(revision 42388)
+++ /trunk/Ohana/src/opihi/Makefile.Common	(revision 42389)
@@ -42,5 +42,6 @@
 	@if [ ! -d $(LIB) ]; then mkdir -p $(LIB); fi
 	rm -f $@
-	gcc -shared -Wl,-soname,$*.so -o $@ $^ -lc
+#	gcc -shared -Wl,-soname,$*.so -o $@ $^ -lc
+	gcc -shared -Wl,-soname,$*.so -o $@ $^ -lc -Wl,--allow-multiple-definition
 
 $(DESTLIB)/%.so: $(LIB)/%.$(ARCH).so
Index: /trunk/Ohana/src/opihi/cmd.basic/list.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/list.c	(revision 42388)
+++ /trunk/Ohana/src/opihi/cmd.basic/list.c	(revision 42389)
@@ -111,5 +111,5 @@
       set_str_variable (line, argv[i+3]);
     }
-    snprintf (line, MAX_LINE_LENGTH, "%s:n", argv[1]);
+    snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:n", argv[1]);
     set_int_variable (line, i);
 
@@ -133,5 +133,5 @@
     int isFound;
 
-    snprintf (line, MAX_LINE_LENGTH, "%s:n", argv[1]);
+    snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:n", argv[1]);
     int nList = get_int_variable (line, &isFound);
     if (!isFound) {
@@ -145,11 +145,11 @@
 
     for (i = start; i < nList; i++) {
-      snprintf (line, MAX_LINE_LENGTH, "%s:%d", argv[1], i);
+      snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:%d", argv[1], i);
       char *word = get_variable (line);
       if (!word) break;
       if (i > 0) {
-	snprintf (output, MAX_LINE_LENGTH, "%s %s", tmpline, word);
+	snprintf_nowarn (output, MAX_LINE_LENGTH, "%s %s", tmpline, word);
       } else {
-	snprintf (output, MAX_LINE_LENGTH, "%s", word);
+	snprintf_nowarn (output, MAX_LINE_LENGTH, "%s", word);
       }
       strcpy (tmpline, output);
@@ -179,5 +179,5 @@
     
     // old list must exist, or give an error
-    snprintf (line, MAX_LINE_LENGTH, "%s:n", argv[3]);
+    snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:n", argv[3]);
     N = get_int_variable (line, &found);
     if (!found) {
@@ -188,10 +188,10 @@
       
 
-    snprintf (line, MAX_LINE_LENGTH, "%s:n", argv[1]);
+    snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:n", argv[1]);
     set_int_variable (line, N);
     for (i = 0; i < N; i++) {
-      snprintf (line, MAX_LINE_LENGTH, "%s:%d", argv[3], i);
+      snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:%d", argv[3], i);
       value = get_variable (line);
-      // snprintf (line, MAX_LINE_LENGTH, "%s:%d", argv[1], i);
+      // snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:%d", argv[1], i);
       set_list_varname (line, argv[1], i, EXCEL_STYLE);
       set_str_variable (line, value);
@@ -207,12 +207,12 @@
     }
     
-    snprintf (line, MAX_LINE_LENGTH, "%s:n", argv[1]);
+    snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:n", argv[1]);
     N = get_int_variable (line, &found);
     for (i = 0; i < argc - 3; i++) {
-      // snprintf (line, MAX_LINE_LENGTH, "%s:%d", argv[1], N + i);
+      // snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:%d", argv[1], N + i);
       set_list_varname (line, argv[1], N + i, EXCEL_STYLE);
       set_str_variable (line, argv[i+3]);
     }
-    snprintf (line, MAX_LINE_LENGTH, "%s:n", argv[1]);
+    snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:n", argv[1]);
     set_int_variable (line, N + i);
 
@@ -231,10 +231,10 @@
     char line2[MAX_LINE_LENGTH];
 
-    snprintf (line, MAX_LINE_LENGTH, "%s:n", argv[1]); // line = LIST:n
+    snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:n", argv[1]); // line = LIST:n
     N = get_int_variable (line, &found);
 
     // loop over all list elements:
     for (i = 0; i < N; i++) {
-      // snprintf (line, MAX_LINE_LENGTH, "%s:%d", argv[1], i);
+      // snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:%d", argv[1], i);
       set_list_varname (line, argv[1], i, EXCEL_STYLE); // line = LIST:i
       value = get_variable (line);
@@ -245,5 +245,5 @@
 	free (value);
 	for (j = i + 1; j < N; j++) {
-	  // snprintf (line, MAX_LINE_LENGTH, "%s:%d", argv[1], j);
+	  // snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:%d", argv[1], j);
 	  set_list_varname (line2, argv[1], j, EXCEL_STYLE); // line2 = LIST:j
 	  next_value = get_variable (line2);
@@ -252,5 +252,5 @@
 	}
 	DeleteNamedScalar (line); // line = LIST:(N-1)
-	snprintf (line, MAX_LINE_LENGTH, "%s:n", argv[1]); // line = LIST:n (new value of n)
+	snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:n", argv[1]); // line = LIST:n (new value of n)
 	set_int_variable (line, N - 1);
 	return (TRUE);
@@ -309,5 +309,5 @@
       depth --;
       if (depth < 0) { /* we hit the last "END", loop is done */
-	snprintf (line, MAX_LINE_LENGTH, "%s:n", argv[1]);
+	snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:n", argv[1]);
 	set_int_variable (line, i);
 	free (input);
@@ -317,5 +317,5 @@
 
     if (*input) { 
-      // snprintf (line, MAX_LINE_LENGTH, "%s:%d", argv[1], i);
+      // snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:%d", argv[1], i);
       set_list_varname (line, argv[1], i, EXCEL_STYLE);
       set_str_variable (line, input);
@@ -381,5 +381,5 @@
   free (val);
     
-  snprintf (line, MAX_LINE_LENGTH, "%s:n", listname);
+  snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:n", listname);
   set_int_variable (line, i);
   return (TRUE);
@@ -399,5 +399,5 @@
   // otherwise save all glob matches
   if (globList.gl_pathc == 0) {
-    snprintf (line, MAX_LINE_LENGTH, "%s:n", listname);
+    snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:n", listname);
     set_int_variable (line, 0);
     return TRUE;
@@ -409,5 +409,5 @@
     set_str_variable (line, globList.gl_pathv[i]);
   }
-  snprintf (line, MAX_LINE_LENGTH, "%s:n", listname);
+  snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:n", listname);
   set_int_variable (line, Nfile);
   return (TRUE);
@@ -430,5 +430,5 @@
     Nline ++;
   }
-  snprintf (varname, MAX_LINE_LENGTH, "%s:n", listname);
+  snprintf_nowarn (varname, MAX_LINE_LENGTH, "%s:n", listname);
   set_int_variable (varname, Nline);
   return TRUE;
@@ -463,5 +463,5 @@
     FREE (new);
   }
-  snprintf (line, MAX_LINE_LENGTH, "%s:n", argv[1]);
+  snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:n", argv[1]);
   set_int_variable (line, nWords);
 
Index: /trunk/Ohana/src/opihi/cmd.basic/memory.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/memory.c	(revision 42388)
+++ /trunk/Ohana/src/opihi/cmd.basic/memory.c	(revision 42389)
@@ -27,4 +27,12 @@
   if (!strcasecmp (argv[1], "checkfree")) {
     ohana_memcheck (1);
+    return (TRUE);
+  }
+  if (!strcasecmp (argv[1], "stats")) {
+    OhanaMemstats memstats = ohana_memstats (0);
+    set_variable ("memory:Ntotal", memstats.Ntotal);
+    set_variable ("memory:Nbytes", memstats.Nbytes);
+    set_variable ("memory:Ngood",  memstats.Ngood);
+    set_variable ("memory:Nbad",   memstats.Nbad);
     return (TRUE);
   }
Index: /trunk/Ohana/src/opihi/cmd.basic/run_while.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/run_while.c	(revision 42388)
+++ /trunk/Ohana/src/opihi/cmd.basic/run_while.c	(revision 42389)
@@ -72,5 +72,6 @@
   // test the logic once before running the loop
   logic_line = strcreate (argv[1]);
-  logic_line = expand_vars (logic_line);
+  logic_line = expand_vars (logic_line); // recalculates scalar elements
+  logic_line = expand_vectors (logic_line); // recalculates vector/matrix elements (e.g., vec[])
   val = dvomath (1, &logic_line, &size, 0);
   free (logic_line);
@@ -90,5 +91,6 @@
 
     logic_line = strcreate (argv[1]);
-    logic_line = expand_vars (logic_line);
+    logic_line = expand_vars (logic_line); // recalculates scalar elements
+    logic_line = expand_vectors (logic_line); // recalculates vector/matrix elements (e.g., vec[])
     val = dvomath (1, &logic_line, &size, 0);
     free (logic_line);
Index: unk/Ohana/src/opihi/cmd.basic/test/stackmath.sh
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/test/stackmath.sh	(revision 42388)
+++ 	(revision )
@@ -1,128 +1,0 @@
-
-input tap.sh
-
-macro go
- plan {14 + 14}
- test1
- test2
- done
-end
-
-# test unary scalar ops
-macro test1
- $x = 5;                 ok ($x == 5) "scalar equality"
- $x = abs(-3);           ok ($x == 3) "scalar abs"
- $x = int(5.23);         ok ($x == 5) "scalar int"
- $x = floor(7.1234);     ok ($x == 7) "scalar floor"
- $x = floor(7.9876);     ok ($x == 7) "scalar floor"
- $x = ceil(7.1234);      ok ($x == 8) "scalar ceil"
- $x = ceil(7.9876);      ok ($x == 8) "scalar ceil"
-		         
- $x = exp(1.0);          ok ($x == 2.71828182846) "scalar exp"
- $x = ten(3.0);          ok ($x == 1000) "scalar ten"
- $x = log(10000);        ok ($x == 4) "scalar log"
- $x = ln(2.71828182846); ok ($x == 1) "scalar ln"
- $x = sqrt(9);           ok ($x == 3) "scalar sqrt"
- $x = dsin(30);          ok ($x == 0.5) "scalar dsin"
- $x = sin($M_PI/6);      ok ($x == 0.5) "scalar sin"
-end
-
-# test unary vector ops
-macro test2
- create x -3 3
-
- set y = x;                 ok (y[1] == -2) "vector equality"
- set y = abs(x);            ok (y[1] ==  2) "vector abs"
- 
- set y = ten(x);            ok (y[1] == 0.01) "vector ten"
-       	 		    ok (y[5] == 100) "vector ten"
- set z = log(y);            ok (z[5] == 2) "vector log"
-       	 		    ok (z[1] == -2) "vector ten"
-
- set y = exp(x);            ok (y[4] == 2.71828182846) "vector exp"
-       	 		    ok (y[2] == 0.367879441171) "vector exp"
- set z = ln(y);             ok (z[2] == -1) "vector ln"
-                            ok (z[4] == 1) "vector ln"
- create x 0 26
- set y = sqrt(x);           ok (y[4] == 2) "vector sqrt"
-       	 		    ok (y[9] == 3) "vector sqrt"
-
- create x 0 360 30
- set y = dsin(x);           ok (y[1] == 0.5) "vector dsin"
-                            ok (y[3] == 1.0) "vector dsin"
-end
-
-# here are all defined unary functions
-# SVM =
-# SVM abs    
-# SVM int    
-# SVM floor  
-#     round  
-# SVM ceil   
-#     rint   
-# SVM exp    
-# SVM ten    
-# SVM log    
-# SVM ln     
-# SVM sqrt   
-# SVM erf    
-# SVM sinh   
-# SVM cosh   
-# SVM asinh  
-# SVM acosh  
-# SVM sin    
-# SVM cos    
-# SVM tan    
-# SVM dsin   
-# SVM dcos   
-# SVM dtan   
-# SVM asin   
-# SVM acos   
-# SVM atan   
-# SVM dasin  
-# SVM dacos  
-# SVM datan  
-# SVM lgamma 
-# SVM rnd    
-# SVM drnd   
-# SVM lrnd   
-# SVM mrnd   
-# SVM not    
-# SVM negate
-# SVM isinf  
-# SVM isnan  
-#  VM ramp   
-#  VM xramp  
-#  VM yramp  
-#  VM zramp  
-#  VM zero   
-
-## tests are not reporting an error when using one of the unimplemented functions
-
-# here are all defined binary functions
-
-# V "^"
-# V max     "U"
-# V min     "D"
-# V atan2   "a"
-# V datan2  "d"
-# * <-      "l"
-# * ->      "r"
-# V @       
-# V /       
-# V *       
-# V %       
-# V +       
-# V -       
-# V &       
-# V |       
-# V <       
-# V >       
-# V ==      "E"
-# V !=      "N"
-# V <=      "L"
-# V >=      "G"
-# V >>      "U"
-# V <<      "D"
-# V &&      "A"
-# V ||      "O"
Index: /trunk/Ohana/src/opihi/cmd.basic/test/stackmath.tp
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/test/stackmath.tp	(revision 42389)
+++ /trunk/Ohana/src/opihi/cmd.basic/test/stackmath.tp	(revision 42389)
@@ -0,0 +1,128 @@
+
+input ../../test/tap.tp
+
+macro go
+ plan {14 + 14}
+ test1
+ test2
+ done
+end
+
+# test unary scalar ops
+macro test1
+ $x = 5;                 ok ($x == 5) "scalar equality"
+ $x = abs(-3);           ok ($x == 3) "scalar abs"
+ $x = int(5.23);         ok ($x == 5) "scalar int"
+ $x = floor(7.1234);     ok ($x == 7) "scalar floor"
+ $x = floor(7.9876);     ok ($x == 7) "scalar floor"
+ $x = ceil(7.1234);      ok ($x == 8) "scalar ceil"
+ $x = ceil(7.9876);      ok ($x == 8) "scalar ceil"
+		         
+ $x = exp(1.0);          ok ($x == 2.71828182846) "scalar exp"
+ $x = ten(3.0);          ok ($x == 1000) "scalar ten"
+ $x = log(10000);        ok ($x == 4) "scalar log"
+ $x = ln(2.71828182846); ok ($x == 1) "scalar ln"
+ $x = sqrt(9);           ok ($x == 3) "scalar sqrt"
+ $x = dsin(30);          ok ($x == 0.5) "scalar dsin"
+ $x = sin($M_PI/6);      ok ($x == 0.5) "scalar sin"
+end
+
+# test unary vector ops
+macro test2
+ create x -3 3
+
+ set y = x;                 ok (y[1] == -2) "vector equality"
+ set y = abs(x);            ok (y[1] ==  2) "vector abs"
+ 
+ set y = ten(x);            ok (y[1] == 0.01) "vector ten"
+       	 		    ok (y[5] == 100) "vector ten"
+ set z = log(y);            ok (z[5] == 2) "vector log"
+       	 		    ok (z[1] == -2) "vector ten"
+
+ set y = exp(x);            ok (y[4] == 2.71828182846) "vector exp"
+       	 		    ok (y[2] == 0.367879441171) "vector exp"
+ set z = ln(y);             ok (z[2] == -1) "vector ln"
+                            ok (z[4] == 1) "vector ln"
+ create x 0 26
+ set y = sqrt(x);           ok (y[4] == 2) "vector sqrt"
+       	 		    ok (y[9] == 3) "vector sqrt"
+
+ create x 0 360 30
+ set y = dsin(x);           ok (y[1] == 0.5) "vector dsin"
+                            ok (y[3] == 1.0) "vector dsin"
+end
+
+# here are all defined unary functions
+# SVM =
+# SVM abs    
+# SVM int    
+# SVM floor  
+#     round  
+# SVM ceil   
+#     rint   
+# SVM exp    
+# SVM ten    
+# SVM log    
+# SVM ln     
+# SVM sqrt   
+# SVM erf    
+# SVM sinh   
+# SVM cosh   
+# SVM asinh  
+# SVM acosh  
+# SVM sin    
+# SVM cos    
+# SVM tan    
+# SVM dsin   
+# SVM dcos   
+# SVM dtan   
+# SVM asin   
+# SVM acos   
+# SVM atan   
+# SVM dasin  
+# SVM dacos  
+# SVM datan  
+# SVM lgamma 
+# SVM rnd    
+# SVM drnd   
+# SVM lrnd   
+# SVM mrnd   
+# SVM not    
+# SVM negate
+# SVM isinf  
+# SVM isnan  
+#  VM ramp   
+#  VM xramp  
+#  VM yramp  
+#  VM zramp  
+#  VM zero   
+
+## tests are not reporting an error when using one of the unimplemented functions
+
+# here are all defined binary functions
+
+# V "^"
+# V max     "U"
+# V min     "D"
+# V atan2   "a"
+# V datan2  "d"
+# * <-      "l"
+# * ->      "r"
+# V @       
+# V /       
+# V *       
+# V %       
+# V +       
+# V -       
+# V &       
+# V |       
+# V <       
+# V >       
+# V ==      "E"
+# V !=      "N"
+# V <=      "L"
+# V >=      "G"
+# V >>      "U"
+# V <<      "D"
+# V &&      "A"
+# V ||      "O"
Index: unk/Ohana/src/opihi/cmd.basic/test/tap.sh
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/test/tap.sh	(revision 42388)
+++ 	(revision )
@@ -1,61 +1,0 @@
-
-macro plan
- if ($0 != 2)
-  echo "USAGE: plan (Ntest)"
-  break
- end
-
- $tap_Nplan = $1
- $tap_Npass = 0
- $tap_Nfail = 0
- $tap_Ntest = 0
-end
-
-macro done
- if (not($?tap_Nplan))
-  echo "ERROR: tap tests not planned"
-  break
- end
-
- echo "planned $tap_Nplan tests, ran $tap_Ntest"
- echo "passed $tap_Npass tests, failed $tap_Nfail tests"
-
- if (($tap_Nfail == 0) && ($tap_Ntest == $tap_Nplan) && ($tap_Npass == $tap_Ntest))
-   echo "PASS: all tests run and passed"
-   return 1
- end
-
- if ($tap_Nfail > 0)
-   echo "FAIL: $tap_Nfail tests failed"
- end
-
- if ($tap_Ntest != $tap_Nplan)
-   echo "FAIL: not all tests run"
- end
-
- if ($tap_Ntest != $tap_Npass + $tap_Nfail)
-   echo "FAIL: inconsistent count: $tap_Ntest tests != $tap_Npass pass + $tap_Nfail fail"
- end
-end
-
-macro ok
- if ($0 != 3)
-  echo "USAGE (condition) (label)"
-  break
- end
- 
- if (not($?tap_Nplan))
-  echo "ERROR: tap tests not planned"
-  break
- end
- 
- if ($1)
-  echo "OK: $2"
-  $tap_Npass ++
- else     
-  echo "not OK: $2"
-  $tap_Nfail ++
- end
- $tap_Ntest ++
-end
-
Index: /trunk/Ohana/src/opihi/cmd.data/Makefile
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/Makefile	(revision 42388)
+++ /trunk/Ohana/src/opihi/cmd.data/Makefile	(revision 42389)
@@ -140,4 +140,5 @@
 $(SRC)/radial.$(ARCH).o	\
 $(SRC)/rd.$(ARCH).o		\
+$(SRC)/rdjpg.$(ARCH).o		\
 $(SRC)/rdseg.$(ARCH).o		\
 $(SRC)/read_vectors.$(ARCH).o	\
@@ -154,4 +155,5 @@
 $(SRC)/set.$(ARCH).o		\
 $(SRC)/shift.$(ARCH).o		\
+$(SRC)/opihi_size.$(ARCH).o        \
 $(SRC)/sort.$(ARCH).o		\
 $(SRC)/spline.$(ARCH).o		\
Index: /trunk/Ohana/src/opihi/cmd.data/cursor.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/cursor.c	(revision 42388)
+++ /trunk/Ohana/src/opihi/cmd.data/cursor.c	(revision 42389)
@@ -42,14 +42,9 @@
     KiiCursorRead (kapa, &X, &Y, &Z, &R, &D, key);
 
-    sprintf (string, "X%s", key);
-    set_variable (string, X);
-    sprintf (string, "Y%s", key);
-    set_variable (string, Y);
-    sprintf (string, "Z%s", key);
-    set_variable (string, Z);
-    sprintf (string, "R%s", key);
-    set_variable (string, R);
-    sprintf (string, "D%s", key);
-    set_variable (string, D);
+    snprintf_nowarn (string, 20, "X%s", key);    set_variable (string, X);
+    snprintf_nowarn (string, 20, "Y%s", key);    set_variable (string, Y);
+    snprintf_nowarn (string, 20, "Z%s", key);    set_variable (string, Z);
+    snprintf_nowarn (string, 20, "R%s", key);    set_variable (string, R);
+    snprintf_nowarn (string, 20, "D%s", key);    set_variable (string, D);
 
     set_str_variable ("KEY", key);
Index: /trunk/Ohana/src/opihi/cmd.data/init.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/init.c	(revision 42388)
+++ /trunk/Ohana/src/opihi/cmd.data/init.c	(revision 42389)
@@ -126,4 +126,5 @@
 int queue2book       PROTO((int, char **));
 int rd               PROTO((int, char **));
+int rdjpg            PROTO((int, char **));
 int rdseg            PROTO((int, char **));
 int read_vectors     PROTO((int, char **));
@@ -160,4 +161,5 @@
 int tvgrid           PROTO((int, char **));
 int opihi_type       PROTO((int, char **));
+int opihi_size       PROTO((int, char **));
 int uniq             PROTO((int, char **));
 int uniqpair         PROTO((int, char **));
@@ -336,4 +338,5 @@
   {1, "ipptool2book", queue2book,       "convert queue with ipptool output to book"},
   {1, "rd",           rd,               "load fits image"},
+  {1, "rdjpg",        rdjpg,            "load jpeg image"},
   {1, "rdseg",        rdseg,            "read a segment of an image from a file"},
   {1, "read",         read_vectors,     "read vectors from datafile"},
@@ -350,4 +353,5 @@
   {1, "set",          set,              "image and vector math"},
   {1, "shift",        shift,            "shift data in an image"},
+  {1, "size",         opihi_size,       "get vector/matrix dimension/size information"},
   {1, "sort",         sort_vectors,     "sort list of vectors"},
   {1, "spline",       spline_command,   "shift data in an image"},
Index: /trunk/Ohana/src/opihi/cmd.data/limits.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/limits.c	(revision 42388)
+++ /trunk/Ohana/src/opihi/cmd.data/limits.c	(revision 42389)
@@ -61,4 +61,5 @@
     APPLY = TRUE;
   }
+
   char *name = NULL;
   if ((N = get_argument (argc, argv, "-n"))) {
@@ -67,7 +68,16 @@
     remove_argument (N, &argc, argv);
   }
-
   if (!GetGraph (&graphmode, &kapa, name)) return (FALSE);
   FREE (name);
+
+  // this is not super intuitive
+  if ((N = get_argument (argc, argv, "-boxsize"))) {
+    remove_argument (N, &argc, argv);
+    float dx, dy;
+    // ask kapa for the size of the graph region in pixels
+    KapaGetLimits (kapa, &dx, &dy);
+    set_variable ("KAPA_XPIX", fabs(dx));
+    set_variable ("KAPA_YPIX", fabs(dy));
+  }
 
   // XXX need an option to set the limits based on the current image bounds
@@ -169,2 +179,15 @@
   return (TRUE);
 }
+
+/* -minX value : the minimum X axis value will be no higher than this value
+   -maxX value : the maximum X axis value will be no lower than this value
+   -delX value : the range of the X axis will be at least this value
+
+   These can be used to prevent the range from collapsing.  
+   These are only used if the -a option is supplied, otherwise the supplied or auto-calculated 
+   ranges are used (this seems like an poor choice)
+
+*/
+
+
+   
Index: /trunk/Ohana/src/opihi/cmd.data/opihi_size.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/opihi_size.c	(revision 42389)
+++ /trunk/Ohana/src/opihi/cmd.data/opihi_size.c	(revision 42389)
@@ -0,0 +1,68 @@
+# include "data.h"
+
+int opihi_size (int argc, char **argv) {
+  
+  int N;
+
+  char *resultName = NULL;
+  Vector *resultVec = NULL;
+  if ((N = get_argument (argc, argv, "-result"))) {
+    remove_argument (N, &argc, argv);
+    resultName = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+    if ((resultVec = SelectVector (resultName, ANYVECTOR, FALSE)) == NULL)   {
+      gprint (GP_ERR, "invalid vector name %s for return result\n", resultName);
+      FREE (resultName);
+      return FALSE;
+    }
+  }
+
+  if (argc != 2) goto usage;
+
+  Vector *vec = NULL;
+  Buffer *buf = NULL;
+
+  // is it a Vector?
+  if ((vec = SelectVector (argv[1], OLDVECTOR, FALSE)) != NULL) {
+    if (resultVec) {
+      ResetVector (resultVec, OPIHI_INT, 1);
+      resultVec->elements.Int[0] = vec->Nelements;
+    } else {
+      gprint (GP_LOG, "%s vector size %d\n", argv[1], vec->Nelements);
+    }
+    goto got_result;
+  }
+
+  // is it a Matrix (Buffer)?
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, FALSE)) != NULL) {
+    if (resultVec) {
+      ResetVector (resultVec, OPIHI_INT, buf->header.Naxes);
+      for (int i = 0; i < buf->header.Naxes; i++) {
+	resultVec->elements.Int[i] = buf->header.Naxis[i];
+      }
+    } else {
+      gprint (GP_LOG, "%s matrix sizes ", argv[1]);
+      for (int i = 0; i < buf->header.Naxes; i++) {
+	gprint (GP_LOG, " %d", (int) buf->header.Naxis[i]);
+      }
+      gprint (GP_LOG, "\n");
+    }
+    goto got_result;
+  }
+  
+  if (resultVec) {
+    ResetVector (resultVec, OPIHI_INT, 0);
+  } else {
+    gprint (GP_LOG, "%s not defined\n", argv[1]);
+  }
+
+got_result:
+  FREE (resultName);
+  return TRUE;
+  
+usage:
+  gprint (GP_ERR, "SYNTAX: size (vector/buffer) [-result vector]\n");
+  gprint (GP_ERR, "  returns type (vector/matrix) and sizes\n");
+  gprint (GP_ERR, "  returns sizes in vector if -result is supplied\n");
+  return (FALSE);
+}
Index: /trunk/Ohana/src/opihi/cmd.data/rdjpg.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/rdjpg.c	(revision 42389)
+++ /trunk/Ohana/src/opihi/cmd.data/rdjpg.c	(revision 42389)
@@ -0,0 +1,125 @@
+# include "data.h"
+# include "jpeglib.h"
+# include <setjmp.h>
+
+struct my_error_mgr {
+  struct jpeg_error_mgr pub;	/* "public" fields */
+  jmp_buf setjmp_buffer;	/* for return to caller */
+};
+
+typedef struct my_error_mgr * my_error_ptr;
+
+METHODDEF(void) my_error_exit (j_common_ptr cinfo)
+{
+  fprintf (stderr, "got an error\n");
+
+  /* cinfo->err really points to a my_error_mgr struct, so coerce pointer */
+  my_error_ptr myerr = (my_error_ptr) cinfo->err;
+
+  /* Always display the message. */
+  /* We could postpone this until after returning, if we chose. */
+  (*cinfo->err->output_message) (cinfo);
+
+  /* Return control to the setjmp point */
+  longjmp(myerr->setjmp_buffer, 1);
+}
+
+int rdjpg (int argc, char **argv) {
+  
+  int N;
+  Buffer *buf;
+
+  struct jpeg_decompress_struct cinfo;
+  struct my_error_mgr jerr;
+
+  int VERBOSE = FALSE;
+  if ((N = get_argument (argc, argv, "-v"))) {
+    remove_argument (N, &argc, argv);
+    VERBOSE = TRUE;
+  }
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: rdjpg <buffer> <filename>\n");
+    return (FALSE);
+  }
+
+  // open input file for read
+  FILE *f = fopen (argv[2], "r");
+  if (f == (FILE *) NULL) {
+    gprint (GP_ERR, "file %s not found\n", argv[2]);
+    return (FALSE);
+  }
+
+  // find matrix, free old data
+  if ((buf = SelectBuffer (argv[1], ANYBUFFER, TRUE)) == NULL) {
+    fclose (f);
+    return (FALSE);
+  }
+  gfits_free_matrix (&buf[0].matrix);
+  gfits_free_header (&buf[0].header);
+
+  // save file name in buffer info
+  char *filename = filebasename (argv[2]);
+  strcpy (buf[0].file, filename);
+  free (filename);
+
+  // the setup for the error handling seems a bit circular, but this
+  // example from the libjpeg example.c seems to work?
+  cinfo.err = jpeg_std_error(&jerr.pub);
+  jerr.pub.error_exit = my_error_exit;
+
+  // an error in the jpeg code will jump (goto) here:
+  if (setjmp(jerr.setjmp_buffer)) {
+    /* If we get here, the JPEG code has signaled an error.
+     * We need to clean up the JPEG object, close the input file, and return.
+     */
+    jpeg_destroy_decompress(&cinfo);
+    fclose(f);
+    return FALSE;
+  }
+
+  /* Now we can initialize the JPEG decompression object. */
+  jpeg_create_decompress(&cinfo);
+  jpeg_stdio_src(&cinfo, f);
+  jpeg_read_header(&cinfo, TRUE);
+  jpeg_start_decompress(&cinfo);
+
+  /* JSAMPLEs per row in output buffer */
+  int Nx = cinfo.output_width;
+  int Ny = cinfo.output_height;
+  int Npix_row = Nx * cinfo.output_components;
+
+  CreateBuffer (buf, Nx, Ny, -32, 0.0, 1.0);
+  float *Vout = (float *)buf[0].matrix.buffer;
+
+  /* Make a one-row-high sample array that will go away when done with image */
+  JSAMPARRAY buffer = (*cinfo.mem->alloc_sarray) ((j_common_ptr) &cinfo, JPOOL_IMAGE, Npix_row, 1);
+
+  // read each of the scanlines
+  for (int iy = 0; iy < Ny; iy++) {
+    jpeg_read_scanlines(&cinfo, buffer, 1);
+
+    // for now just copy R + G + B as the total value:
+    for (int ix = 0; ix < Nx; ix ++) {
+      unsigned char Rpix = buffer[0][3*ix + 0];
+      unsigned char Gpix = buffer[0][3*ix + 1];
+      unsigned char Bpix = buffer[0][3*ix + 2];
+      float value = Rpix + Gpix + Bpix;
+      Vout[Nx*iy + ix] = value;
+    }
+  }
+    
+  jpeg_finish_decompress(&cinfo);
+  jpeg_destroy_decompress(&cinfo);
+  
+  fclose (f);
+  
+  buf[0].bitpix = buf[0].header.bitpix;    /* store the original values */
+  buf[0].bscale = buf[0].header.bscale;    /* store the original values */
+  buf[0].bzero  = buf[0].header.bzero;     /* store the original values */
+  buf[0].unsign = buf[0].header.unsign;
+
+  if (VERBOSE) gprint (GP_LOG, "read "OFF_T_FMT" bytes from %s into buffer %s\n", buf[0].header.datasize + buf[0].matrix.datasize, argv[2], argv[1]);
+
+  return (TRUE);
+}
Index: /trunk/Ohana/src/opihi/cmd.data/read_vectors.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/read_vectors.c	(revision 42388)
+++ /trunk/Ohana/src/opihi/cmd.data/read_vectors.c	(revision 42389)
@@ -385,6 +385,5 @@
       if (!lineStatus && VERBOSE) {
 	char temp[32];
-	strncpy (temp, c0, 32);
-	temp[31] = 0;
+	strncpy_nowarn (temp, c0, 31);
 	gprint (GP_ERR, "skip line %s\n\n", temp);
       }
Index: /trunk/Ohana/src/opihi/cmd.data/reindex.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/reindex.c	(revision 42388)
+++ /trunk/Ohana/src/opihi/cmd.data/reindex.c	(revision 42389)
@@ -72,4 +72,23 @@
     }
   }
+  if (ivec->type == OPIHI_STR) {
+    opihi_int *vx = xvec[0].elements.Int;
+    for (Npts = i = 0; i < xvec[0].Nelements; i++, vx++) {
+      if (Npts >= NPTS) {
+	NPTS += 2000;
+	REALLOCATE (ovec[0].elements.Str, char *, NPTS);
+      }
+      if (*vx < 0) {
+	if (KEEP_UNMATCH) {
+	  ovec[0].elements.Str[Npts] = strcreate(""); // XXX use a different or a specified value?
+	  Npts++;
+	} 
+	continue;
+      }
+      if (*vx > Nmax) ESCAPE("unexpected value in index: "OPIHI_INT_FMT" (%d)\n", *vx, i);
+      ovec[0].elements.Str[Npts] = strcreate(ivec->elements.Str[*vx]);
+      Npts++;
+    }
+  }
 
   // free up unused memory
Index: /trunk/Ohana/src/opihi/cmd.data/subset.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/subset.c	(revision 42388)
+++ /trunk/Ohana/src/opihi/cmd.data/subset.c	(revision 42389)
@@ -44,5 +44,5 @@
   ResetVector (ovec, ivec->type, tvec[0].Nelements);
 
-  // we have four cases: (ivec == flt or int) and (tvec == flt or int)
+  // we have size cases: (ivec == flt, int, str) and (tvec == flt or int)
   if ((ivec->type == OPIHI_FLT) && (tvec->type == OPIHI_FLT)) {
     opihi_flt *vi = ivec[0].elements.Flt;
@@ -81,9 +81,12 @@
     }
   }
+  // XXX if ivec is an existing vector, this step will
+  // leak (existing elements need to be freed if they
+  // have been allocated).
   if ((ivec->type == OPIHI_STR) && (tvec->type == OPIHI_FLT)) {
     opihi_flt *vt = tvec[0].elements.Flt;
     for (Npts = i = 0; i < tvec[0].Nelements; i++, vt++) {
       if (!*vt) continue;
-      ovec[0].elements.Str[Npts] = strcreate (ivec[0].elements.Str[i]);
+      ovec[0].elements.Str[Npts] = strcreate(ivec[0].elements.Str[i]);
       Npts++;
     }
@@ -93,5 +96,5 @@
     for (Npts = i = 0; i < tvec[0].Nelements; i++, vt++) {
       if (!*vt) continue;
-      ovec[0].elements.Str[Npts] = strcreate (ivec[0].elements.Str[i]);
+      ovec[0].elements.Str[Npts] = strcreate(ivec[0].elements.Str[i]);
       Npts++;
     }
Index: /trunk/Ohana/src/opihi/cmd.data/svd.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/svd.c	(revision 42388)
+++ /trunk/Ohana/src/opihi/cmd.data/svd.c	(revision 42389)
@@ -58,5 +58,5 @@
 
   // try C.R. Bond's version -- requires matrices in the form A[row][col] not A[row*Ncol + col]
-  if (1) { 
+  if (0) { 
       int j;
       double **a, **u, **v, *q;
Index: /trunk/Ohana/src/opihi/cmd.data/test/histogram.sh
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/test/histogram.sh	(revision 42388)
+++ /trunk/Ohana/src/opihi/cmd.data/test/histogram.sh	(revision 42389)
@@ -35,6 +35,9 @@
  local i
 
- list word -x "ps -p $PID -o rss"
- $startmem = $word:1
+ create xhis 0 10 0.1
+ $i = 1
+
+ memory stats
+ $startmem = $memory:Ntotal
 
  for i 0 1000
@@ -42,6 +45,6 @@
  end
   
- list word -x "ps -p $PID -o rss"
- $endmem = $word:1
+ memory stats
+ $endmem = $memory:Ntotal
 
  $PASS = 1
Index: /trunk/Ohana/src/opihi/cmd.data/test/join.sh
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/test/join.sh	(revision 42388)
+++ /trunk/Ohana/src/opihi/cmd.data/test/join.sh	(revision 42389)
@@ -21,65 +21,4 @@
 
  join ID1 ID2 
-
-mana: for i 0 index1[]
->> echo index1[$i] index2[$i]
->> end
-0 2
-2 1
-4 0
-5 3
-mana: join ID1 ID2 -outer
-mana: vectors 
-    N       name      size
-    0        ID1          6 (INT)
-    1       val1          6 (FLT)
-    2        ID2          4 (INT)
-    3        val          4 (FLT)
-    4     index1          6 (INT)
-    5     index2          4 (INT)
-mana: for i 0 index1[]
->> echo index1[$i]
->> end
-2
--1
-1
--1
-0
-3
-mana: echo ID1[2]
-3
-mana: echo ID1[0] ID2[2]
-1 1
-mana: for i 0 index1[]
->> if (index1[$i] == -1) continue
->> $N = index1[$i]
->> echo $i index1[$i] ID1[$i] ID2[$N]
->> end
-0 2 1 1
-2 1 3 3
-4 0 5 5
-5 3 6 6
-mana: for i 0 index2[]
->> if (index2[$i] == -1) continue
->> $N = index2[$i]
->> echo $i index2[$i] ID2[$i] ID1[$N]
->> end
-0 4 5 5
-1 2 3 3
-2 0 1 1
-3 5 6 6
-mana: 
-
- # if ((xvec[1024] != 17) || (yvec[1024] != 100))
- #  $PASS = 0
- #  echo "Value mismatch: xvec[1024] yvec[1024] (should be 17,100)"
- # end
- # 
- # imhist -q buff xvec yvec -region 40 0 25 10 -range 0 10
- # 
- # if ((xvec[1024] != 10) || (yvec[1024] != 100))
- #  $PASS = 0
- #  echo "Value mismatch: xvec[1024] yvec[1024] (should be 10,100)"
- # end
 
 end
Index: /trunk/Ohana/src/opihi/cmd.data/threshold.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/threshold.c	(revision 42388)
+++ /trunk/Ohana/src/opihi/cmd.data/threshold.c	(revision 42389)
@@ -3,9 +3,10 @@
 int QUIET = FALSE;
 
-void _threshold_set_values (double value, int Nbin, double level) {
+void _threshold_set_values (double value, int Nbin, double level, int thresherr) {
 
   set_variable ("threshval", value);
   set_int_variable ("threshbin", Nbin);
   set_variable ("threshold", level);
+  set_int_variable ("thresherr", thresherr);
 
   if (!QUIET) gprint (GP_LOG, "theshold %f (bin %d is %f)\n", level, Nbin, value);
@@ -117,9 +118,9 @@
     if (vecy[0].elements.Flt[BinMin] > value) {
       if (SATURATE) {
-	_threshold_set_values (vecy[0].elements.Flt[BinMin], BinMin, vecx[0].elements.Flt[BinMin]);
+	_threshold_set_values (vecy[0].elements.Flt[BinMin], BinMin, vecx[0].elements.Flt[BinMin], 1);
 	return TRUE;
       } else {
 	gprint (GP_ERR, "ERROR: all values above threshold\n");
-	_threshold_set_values (NAN, -1, NAN);
+	_threshold_set_values (NAN, -1, NAN, 1);
 	return FALSE;
       }
@@ -127,9 +128,9 @@
     if (vecy[0].elements.Flt[BinMax] < value) {
       if (SATURATE) {
-	_threshold_set_values (vecy[0].elements.Flt[BinMax], BinMax, vecx[0].elements.Flt[BinMax]);
+	_threshold_set_values (vecy[0].elements.Flt[BinMax], BinMax, vecx[0].elements.Flt[BinMax], 1);
 	return TRUE;
       } else {
 	gprint (GP_ERR, "ERROR: all values below threshold\n");
-	_threshold_set_values (NAN, -1, NAN);
+	_threshold_set_values (NAN, -1, NAN, 1);
 	return FALSE;
       }
@@ -156,9 +157,9 @@
     if (vecy[0].elements.Flt[BinMin] < value) {
       if (SATURATE) {
-	_threshold_set_values (vecy[0].elements.Flt[BinMin], BinMin, vecx[0].elements.Flt[BinMin]);
+	_threshold_set_values (vecy[0].elements.Flt[BinMin], BinMin, vecx[0].elements.Flt[BinMin], 1);
 	return TRUE;
       } else {
 	gprint (GP_ERR, "ERROR: all values below threshold\n");
-	_threshold_set_values (NAN, -1, NAN);
+	_threshold_set_values (NAN, -1, NAN, 1);
 	return FALSE;
       }
@@ -166,9 +167,9 @@
     if (vecy[0].elements.Flt[BinMax] > value) {
       if (SATURATE) {
-	_threshold_set_values (vecy[0].elements.Flt[BinMax], BinMax, vecx[0].elements.Flt[BinMax]);
+	_threshold_set_values (vecy[0].elements.Flt[BinMax], BinMax, vecx[0].elements.Flt[BinMax], 1);
 	return TRUE;
       } else {
 	gprint (GP_ERR, "ERROR: all values above threshold\n");
-	_threshold_set_values (NAN, -1, NAN);
+	_threshold_set_values (NAN, -1, NAN, 1);
 	return FALSE;
       }
@@ -219,5 +220,5 @@
   }
 
-  _threshold_set_values (y1, Nhi, Xvalue);
+  _threshold_set_values (y1, Nhi, Xvalue, 0);
   return (TRUE);
 }
Index: /trunk/Ohana/src/opihi/cmd.data/tvcolors.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/tvcolors.c	(revision 42388)
+++ /trunk/Ohana/src/opihi/cmd.data/tvcolors.c	(revision 42389)
@@ -41,4 +41,15 @@
     gprint (GP_ERR, "   f: 0 - 1 defines the scale value for the transition\n");
     gprint (GP_ERR, "   R,G,B: 0 - 1 define the value of the color at the transition point\n");
+
+    gprint (GP_ERR, "   There are 5 colormap file format options:\n");
+    gprint (GP_ERR, "   * file:filename : index Red Green Blue\n");
+    gprint (GP_ERR, "   * lgcy:filename : index Red Blue Green\n");
+    gprint (GP_ERR, "   * csvf:filename : index,Red,Green,Blue\n");
+    gprint (GP_ERR, "   * cetf:filename : fRed,fGreen,fBlue \n");
+    gprint (GP_ERR, "   * cetr:filename : fRed,fGreen,fBlue \n\n");
+    gprint (GP_ERR, "   The index value goes from 0.0 to 1.0 and sets transitions (must be monotonic).\n");
+    gprint (GP_ERR, "   In the CET cases, the index is implicit, with 256 entries expected.\n");
+    gprint (GP_ERR, "   For cetr: the index is reversed.\n");
+
     return (FALSE);
   }
Index: /trunk/Ohana/src/opihi/cmd.data/wd.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/wd.c	(revision 42388)
+++ /trunk/Ohana/src/opihi/cmd.data/wd.c	(revision 42389)
@@ -115,5 +115,5 @@
       Ns = strlen (simple);
       No = 80 - Ns;
-      strncpy (temp_header.buffer, simple, Ns);
+      strncpy_nowarn (temp_header.buffer, simple, Ns);
       memset (&temp_header.buffer[Ns], ' ', No);
     }
@@ -275,25 +275,2 @@
   return (f);
 }
-
-
-///    /* fix up header */
-///    {
-///      static char simple[] = "XTENSION= 'IMAGE  '            / Image extension";
-///      int Ns, No;
-///      Ns = strlen (simple);
-///      No = 80 - Ns;
-///      strncpy (temp_header.buffer, simple, Ns);
-///      memset (&temp_header.buffer[Ns], ' ', No);
-///    }
-///
-///    /* position to end of file to write new extend */
-///    fseeko (f, 0LL, SEEK_END);
-///    nbytes = fwrite (temp_header.buffer, 1, temp_header.datasize, f);
-///    fclose (f);
-///    if (nbytes != temp_header.datasize) {
-///      gprint (GP_ERR, "failed to write file\n");
-///      status = FALSE;
-///      goto done1;
-///    }
-///
-///  }
Index: /trunk/Ohana/src/opihi/cmd.data/write_vectors.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/write_vectors.c	(revision 42388)
+++ /trunk/Ohana/src/opihi/cmd.data/write_vectors.c	(revision 42389)
@@ -214,5 +214,5 @@
     /* identify type (%NNNNd %NNNNf) */
     for (p2 = p1 + 1; (*p2 == '.') || (*p2 == '-') || (*p2 == '+') || (*p2 == ' ') || isdigit(*p2); p2++);
-    strncpy (fmtlist[j], p0, p2 - p0 + 1);
+    strncpy_nowarn (fmtlist[j], p0, p2 - p0 + 1);
     switch (*p2) {
       case 'e':
Index: /trunk/Ohana/src/opihi/dvo/aregion.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/aregion.c	(revision 42388)
+++ /trunk/Ohana/src/opihi/dvo/aregion.c	(revision 42389)
@@ -49,6 +49,5 @@
   fread (buffer, 1, 48*NDecLines[NBigDec], f);
   for (i = 0; !done && (i < NDecLines[NBigDec]); i++) {
-    strncpy (temp, &buffer[i*48], 48);
-    temp[49] = 0;
+    strncpy_nowarn (temp, &buffer[i*48], 48);
     hstgsc_hms_to_deg (&RA0, &RA1, &DEC0, &DEC1, &temp[7]);
     if (RA1 < RA0) RA1 += 360.0;
Index: /trunk/Ohana/src/opihi/dvo/coordmosaic.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/coordmosaic.c	(revision 42388)
+++ /trunk/Ohana/src/opihi/dvo/coordmosaic.c	(revision 42389)
@@ -311,10 +311,10 @@
       
       memset (segment, 0, 16); memcpy  (segment, &SEGMENT[i*Nsegment], 4);
-      snprintf (name, 16, "%s_L_CX%dY%d", segment, XORDER[i], YORDER[i]);
+      snprintf_nowarn (name, 16, "%s_L_CX%dY%d", segment, XORDER[i], YORDER[i]);
       double xvalue = get_double_variable (name, &found);
       xmask = !found;
       
       memset (segment, 0, 16); memcpy  (segment, &SEGMENT[i*Nsegment], 4);
-      snprintf (name, 16, "%s_M_CX%dY%d", segment, XORDER[i], YORDER[i]);
+      snprintf_nowarn (name, 16, "%s_M_CX%dY%d", segment, XORDER[i], YORDER[i]);
       double yvalue = get_double_variable (name, &found);
       ymask = !found;
@@ -437,9 +437,9 @@
 
 	int found, xmask, ymask;
-	snprintf (name, 16, "L_X%dY%d", ix, iy);
+	snprintf_nowarn (name, 16, "L_X%dY%d", ix, iy);
 	double xvalue = get_double_variable (name, &found);
 	xmask = !found;
 
-	snprintf (name, 16, "M_X%dY%d", ix, iy);
+	snprintf_nowarn (name, 16, "M_X%dY%d", ix, iy);
 	double yvalue = get_double_variable (name, &found);
 	ymask = !found;
Index: /trunk/Ohana/src/opihi/dvo/elixir.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/elixir.c	(revision 42388)
+++ /trunk/Ohana/src/opihi/dvo/elixir.c	(revision 42389)
@@ -4,8 +4,10 @@
 int ReadMsg (char *fifo, char **message);
 
+# define MY_MAX_PATH 256
+
 int elixir (int argc, char **argv) {
   
-  char message[256], cmd[256], ElixirBase[256];
-  char fifo[256], fifodir[256], msgfile[256];
+  char message[MY_MAX_PATH], cmd[MY_MAX_PATH], ElixirBase[MY_MAX_PATH];
+  char fifo[MY_MAX_PATH], fifodir[MY_MAX_PATH], msgfile[MY_MAX_PATH];
   char *answer;
   int N;
@@ -38,17 +40,17 @@
     return (FALSE);
   }
-  sprintf (fifo, "%s.msg", ElixirBase);
+  snprintf_nowarn (fifo, MY_MAX_PATH, "%s.msg", ElixirBase);
   if (!VarConfig ("FIFOS", "%s", fifodir)) {
     gprint (GP_ERR, "FIFOS not in config, using local /tmp\n");
     strcpy (fifodir, "/tmp");
   }
-  sprintf (fifo, "%s.msg", ElixirBase);
+  snprintf_nowarn (fifo, MY_MAX_PATH, "%s.msg", ElixirBase);
 
-  sprintf (msgfile, "%s/EMsg.XXXXXX", fifodir);
+  snprintf_nowarn (msgfile, MY_MAX_PATH, "%s/EMsg.XXXXXX", fifodir);
   if (mkstemp (msgfile) == -1) {
     gprint (GP_ERR, "can't create fifo\n");
     return (FALSE);
   }
-  sprintf (message, "%s %s", cmd, msgfile);
+  snprintf_nowarn (message, MY_MAX_PATH, "%s %s", cmd, msgfile);
   unlink (msgfile);
 
Index: /trunk/Ohana/src/opihi/dvo/find_regions.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/find_regions.c	(revision 42388)
+++ /trunk/Ohana/src/opihi/dvo/find_regions.c	(revision 42389)
@@ -100,6 +100,5 @@
     fread (buffer, 48*NDecLines[NBigDec + j], 1, f);
     for (i = 0; (i < NDecLines[NBigDec + j]); i++) {
-      strncpy (temp, &buffer[i*48], 48);
-      temp[49] = 0;
+      strncpy_nowarn (temp, &buffer[i*48], 48);
       hstgsc_hms_to_deg (&RA0, &RA1, &DEC0, &DEC1, &temp[7]);
       if (RA1 < RA0) RA1 += 360.0;
Index: /trunk/Ohana/src/opihi/include/dvomath.h
===================================================================
--- /trunk/Ohana/src/opihi/include/dvomath.h	(revision 42388)
+++ /trunk/Ohana/src/opihi/include/dvomath.h	(revision 42389)
@@ -125,4 +125,5 @@
 int           M_unary               PROTO((StackVar *OUT, StackVar *V1, char *op));
 int           W_unary               PROTO((StackVar *OUT, StackVar *V1, char *op));
+int           L_unary               PROTO((StackVar *OUT, StackVar *V1, char *op));
 
 /* variable handling */
Index: /trunk/Ohana/src/opihi/include/pcontrol.h
===================================================================
--- /trunk/Ohana/src/opihi/include/pcontrol.h	(revision 42388)
+++ /trunk/Ohana/src/opihi/include/pcontrol.h	(revision 42389)
@@ -341,4 +341,5 @@
 
 void pcontrol_exit (int n);
+void QuitCheckSystemThread (void);
 
 // Job   *FindJobByID (IDtype JobID, int *StackID);
Index: /trunk/Ohana/src/opihi/lib.data/svdcmp.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.data/svdcmp.c	(revision 42388)
+++ /trunk/Ohana/src/opihi/lib.data/svdcmp.c	(revision 42389)
@@ -23,4 +23,5 @@
   l = nm = 0;
   ALLOCATE (rv1, float, Nx);
+
   for (i = 0; i < Nx; i++) {
     l = i + 1;
@@ -29,5 +30,5 @@
     if (i < Ny) {
       for (k = i; k < Ny; k++) scale += fabs(a[k*Nx + i]);
-      if (scale) {
+      if (scale > 0.0) {
 	for (k = i; k < Ny; k++) {
 	  a[k*Nx + i] /= scale;
@@ -35,15 +36,17 @@
 	}
 	f = a[i*Nx + i];
-	g  = -FSIGN(sqrt(s), f);
+	g = sqrt(s);
+	if (f > 0.0) { g = -g; }
 	h = f*g - s;
 	a[i*Nx + i] = f-g;
 	if (i != Nx - 1) {
 	  for (j = l; j < Nx; j++) {
-	    for (s = 0.0, k = i; k < Ny; k++) s += a[k*Nx + i]*a[k*Nx + j];
+	    s = 0.0;
+	    for (k = i; k < Ny; k++) { s += a[k*Nx + i]*a[k*Nx + j]; }
 	    f = s/h;
-	    for (k = i; k < Ny; k++) a[k*Nx + j] += f*a[k*Nx + i];
+	    for (k = i; k < Ny; k++) { a[k*Nx + j] += f*a[k*Nx + i]; }
 	  }
 	}
-	for (k = i; k < Ny; k++) a[k*Nx + i] *= scale;
+	for (k = i; k < Ny; k++) { a[k*Nx + i] *= scale; }
       }
     }
@@ -51,6 +54,6 @@
     g = s = scale = 0.0;
     if ((i < Ny) && (i != (Nx - 1))) {
-      for (k = l; k < Nx; k++) scale += fabs(a[i*Nx + k]);
-      if (scale) {
+      for (k = l; k < Nx; k++) { scale += fabs(a[i*Nx + k]); }
+      if (scale > 0.0) {
 	for (k = l; k < Nx; k++) {
 	  a[i*Nx + k] /= scale;
@@ -58,15 +61,17 @@
 	}
 	f = a[i*Nx + l];
-	g = -FSIGN(sqrt(s), f);
+	g = sqrt(s);
+	if (f > 0.0) { g = -g; }
 	h = f*g - s;
 	a[i*Nx + l] = f-g;
-	for (k = l; k < Nx; k++) rv1[k] = a[i*Nx + k]/h;
+	for (k = l; k < Nx; k++) { rv1[k] = a[i*Nx + k]/h; }
 	if (i != Ny - 1) {
 	  for (j = l; j < Ny; j++) {
-	    for (s = 0.0, k = l; k < Nx; k++) s += a[j*Nx + k]*a[i*Nx + k];
-	    for (k = l; k < Nx; k++) a[j*Nx + k] += s*rv1[k];
+	    s = 0.0;
+	    for (k = l; k < Nx; k++) { s += a[j*Nx + k]*a[i*Nx + k];}
+	    for (k = l; k < Nx; k++) { a[j*Nx + k] += s*rv1[k]; } 
 	  }
 	}
-	for (k = l; k < Nx; k++) a[i*Nx + k] *= scale;
+	for (k = l; k < Nx; k++) { a[i*Nx + k] *= scale; }
       }
     }
@@ -76,13 +81,14 @@
   for (i = Nx - 1; i >= 0; i--) {
     if (i < Nx - 1) {
-      if (g) {
+      if (g != 0.0) {
 	/* isn't l == n to start?? */
 	for (j = l; j < Nx; j++) v[j*Nx + i] = (a[i*Nx + j]/a[i*Nx + l])/g;
 	for (j = l; j < Nx; j++) {
-	  for (s = 0.0, k = l; k < Nx; k++) s += a[i*Nx + k]*v[k*Nx + j];
+	  s = 0.0;
+	  for (k = l; k < Nx; k++) s += a[i*Nx + k]*v[k*Nx + j];
 	  for (k = l; k < Nx; k++) v[k*Nx + j] += s*v[k*Nx + i];
 	}
       }
-      for (j = l; j < Nx; j++) v[i*Nx + j] = v[j*Nx + i] = 0.0;
+      for (j = l; j < Nx; j++) { v[i*Nx + j] = v[j*Nx + i] = 0.0; }
     }
     v[i*Nx + i] = 1.0;
@@ -93,20 +99,20 @@
     l = i + 1;
     g = w[i];
-    if (i < Nx - 1)
-      for (j = l; j < Nx; j++) a[i*Nx + j] = 0.0;
-    if (g) {
+    if (i < Nx - 1) { for (j = l; j < Nx; j++) {a[i*Nx + j] = 0.0; }}
+    if (g != 0.0) {
       g = 1.0/g;
       if (i != Nx - 1) {
 	for (j = l; j < Nx; j++) {
-	  for (s = 0.0, k = l; k < Ny; k++) s += a[k*Nx + i]*a[k*Nx + j];
+	  s = 0.0;
+	  for (k = l; k < Ny; k++) { s += a[k*Nx + i]*a[k*Nx + j];}
 	  f = (s/a[i*Nx + i])*g;
-	  for (k = i; k < Ny; k++) a[k*Nx + j] += f*a[k*Nx + i];
-	}
-      }
-      for (j = i; j < Ny; j++) a[j*Nx + i] *= g;
+	  for (k = i; k < Ny; k++) { a[k*Nx + j] += f*a[k*Nx + i]; }
+	}
+      }
+      for (j = i; j < Ny; j++) { a[j*Nx + i] *= g; }
     } else {
-      for (j = i; j < Ny; j++) a[j*Nx + i] = 0.0;
-    }
-    ++a[i*Nx + i];
+      for (j = i; j < Ny; j++) { a[j*Nx + i] = 0.0; }
+    }
+    a[i*Nx + i] ++;
   }
 
@@ -126,5 +132,5 @@
 	c = 0.0;
 	s = 1.0;
-	for (i = l; i < k; i++) {
+	for (i = l; i <= k; i++) {
 	  f = s*rv1[i];
 	  if (fabs(f)+anorm != anorm) {
@@ -160,7 +166,12 @@
       f = ((y-z)*(y+z) + (g-h)*(g+h))/(2.0*h*y);
       g = hypot (f, 1.0);
-      f = ((x-z)*(x+z) + h*((y/(f+FSIGN(g, f)))-h))/x;
+      
+      float tmp = g;
+      if (f < 0.0) { tmp = - tmp; }
+
+      f = ((x-z)*(x+z) + h*((y/(f+tmp))-h))/x;
+
       c = s = 1.0;
-      for (j = l; j < nm; j++) {
+      for (j = l; j <= nm; j++) {
 	i = j+1;
 	g = rv1[i];
@@ -184,5 +195,5 @@
 	z = hypot(f, h);
 	w[j] = z;
-	if (z) {
+	if (z != 0.0) {
 	  z = 1.0/z;
 	  c = f*z;
Index: /trunk/Ohana/src/opihi/lib.data/svdcmp_bond_new.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.data/svdcmp_bond_new.c	(revision 42388)
+++ /trunk/Ohana/src/opihi/lib.data/svdcmp_bond_new.c	(revision 42389)
@@ -63,5 +63,5 @@
 			g = 0.0;
 		else {
-			f = u[i][i+1];
+		    f = u[i][i+1]; // XXXX this line will overrun the memory of u[][i+1] : i+1
 			g = (f < 0) ? sqrt(s) : -sqrt(s);
 			h = f * g - s;
Index: /trunk/Ohana/src/opihi/lib.shell/VectorIO.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.shell/VectorIO.c	(revision 42388)
+++ /trunk/Ohana/src/opihi/lib.shell/VectorIO.c	(revision 42389)
@@ -261,5 +261,5 @@
   memset (endptr, ' ', FT_LINE_LENGTH);
 
-  strncpy (endptr, newline, 80);
+  strncpy_nowarn (endptr, newline, 80);
   endptr += FT_LINE_LENGTH;
 
Index: /trunk/Ohana/src/opihi/lib.shell/evaluate_stack.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.shell/evaluate_stack.c	(revision 42388)
+++ /trunk/Ohana/src/opihi/lib.shell/evaluate_stack.c	(revision 42389)
@@ -67,5 +67,9 @@
     if (stack[0].type == ST_VECTOR) {
       /* need to make a copy so we set output value? */
-      V_unary (&tmp_stack, &stack[0], "=");
+      if (stack->vector->type == OPIHI_STR) {
+	L_unary (&tmp_stack, &stack[0], "=");
+      } else {
+	V_unary (&tmp_stack, &stack[0], "=");
+      }
       move_stack (&stack[0], &tmp_stack);
       return (TRUE);
Index: /trunk/Ohana/src/opihi/lib.shell/expand_vectors.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.shell/expand_vectors.c	(revision 42388)
+++ /trunk/Ohana/src/opihi/lib.shell/expand_vectors.c	(revision 42389)
@@ -28,7 +28,21 @@
   ALLOCATE (newline, char, NLINE);
 
+  // special case: don't expand vectors in while () statement
+  char *V0 = thiscomm (line);
+  if (V0 && !strncmp ("while", V0, strlen(V0))) {
+      strcpy (newline, line);
+      free (line);
+      return (newline);
+  }
+  free (V0);
+
   /* look for form fred[stuff] */
-  /* skip first word (command) */
-  L = nextword (line);
+  if (*line == '(') {
+    // if line is "(stuff)" then do not skip first word
+      L = line;
+  } else {
+    /* skip first word (command) */
+    L = nextword (line);
+  }
   if (L == NULL) {
     free (newline);
@@ -37,5 +51,5 @@
 
   n = L - line;
-  strncpy (newline, line, n);
+  strncpy_nowarn (newline, line, n);
   N = newline + n;
   J = 0;
@@ -242,8 +256,8 @@
 
     n = (int) (w - L);
-    strncpy (N, L, n);
+    strncpy_nowarn (N, L, n);
     N += n;
     n = strlen (strValue);
-    strncpy (N, strValue, n);
+    strncpy_nowarn (N, strValue, n);
     N += n;
     L = q + 1;
@@ -260,6 +274,5 @@
 
   n = strlen (L);
-  strncpy (N, L, n);
-  N[n] = 0;
+  strncpy_nowarn (N, L, n);
   free (line);
   return (newline);
Index: /trunk/Ohana/src/opihi/lib.shell/stack_math.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.shell/stack_math.c	(revision 42388)
+++ /trunk/Ohana/src/opihi/lib.shell/stack_math.c	(revision 42389)
@@ -1714,4 +1714,50 @@
   char line[512]; // this is only used to report an error 
   snprintf (line, 512, "error: op %s not defined as unary vector op!", op);
+  push_error (line);
+  return (FALSE);
+
+escape:
+
+  if (V1[0].type == ST_VECTOR_TMP) {
+    free (V1[0].vector[0].elements.Ptr);
+    free (V1[0].vector);
+    V1[0].vector = NULL;
+  }  
+
+  clear_stack (V1);
+  return (TRUE);
+
+}
+
+// vector string operations
+int L_unary (StackVar *OUT, StackVar *V1, char *op) {
+
+  int Nx = V1[0].vector[0].Nelements;
+
+  OUT[0].vector = InitVector ();
+  OUT[0].type = ST_VECTOR_TMP; /*** <<--- says this is a temporary matrix ***/
+
+  ResetVector (OUT[0].vector, OPIHI_STR, V1[0].vector[0].Nelements); 
+  char **Iv =  V1[0].vector[0].elements.Str; 
+  char **Ov = OUT[0].vector[0].elements.Str; 
+  if (!strcmp (op, "=")) {
+    for (int i = 0; i < Nx; i++) {			
+      Ov[i] = strcreate (Iv[i]);
+    }									
+    goto escape;							
+  }
+
+  // free the temp vector if needed
+  if (V1[0].type == ST_VECTOR_TMP) {
+    // XXX this probably does not free the strings
+    free (V1[0].vector[0].elements.Ptr);
+    free (V1[0].vector);
+    V1[0].vector = NULL;
+  }  
+
+  clear_stack (V1);
+
+  char line[512]; // this is only used to report an error 
+  snprintf (line, 512, "error: op %s not defined as unary string vector op!", op);
   push_error (line);
   return (FALSE);
Index: /trunk/Ohana/src/opihi/pantasks/controller_status.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/controller_status.c	(revision 42388)
+++ /trunk/Ohana/src/opihi/pantasks/controller_status.c	(revision 42389)
@@ -26,7 +26,7 @@
   }
 
-  snprintf (command, 1024, "status");
+  snprintf_nowarn (command, 1024, "status");
   for (i = 1; i < argc; i++) {
-    snprintf (tmpline, 1024, "%s %s", command, argv[i]);
+    snprintf_nowarn (tmpline, 1024, "%s %s", command, argv[i]);
     strcpy (command, tmpline);
   }
Index: /trunk/Ohana/src/opihi/pantasks/pantasks_server.c.in
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/pantasks_server.c.in	(revision 42388)
+++ /trunk/Ohana/src/opihi/pantasks/pantasks_server.c.in	(revision 42389)
@@ -138,4 +138,8 @@
   ConfigFree ();
 
+  // XXX this function is currently called by the thread running ListenClients, but
+  // it should be called by the main above.  have this function trigger the
+  // thread shutdown 
+
   QuitJobsAndTasksThread(); pthread_join (JobsAndTasksThread, NULL);
   QuitControllerThread();   pthread_join (controllerThread, NULL);
Index: /trunk/Ohana/src/opihi/pcontrol/CheckSystem.c
===================================================================
--- /trunk/Ohana/src/opihi/pcontrol/CheckSystem.c	(revision 42388)
+++ /trunk/Ohana/src/opihi/pcontrol/CheckSystem.c	(revision 42389)
@@ -4,4 +4,11 @@
 static struct timeval lastlive = {0, 0};
 static RunLevels RunLevel = PCONTROL_RUN_NONE;
+
+static int CheckSystemThreadRuns = TRUE;
+
+void QuitCheckSystemThread (void) {
+  CheckSystemThreadRuns = FALSE;  
+}
+
 
 RunLevels SetRunLevel (RunLevels level) {
@@ -67,5 +74,5 @@
   gprintInit ();
 
-  while (1) {
+  while (CheckSystemThreadRuns) {
     // stop here if the user-thread requests (no objects in flight) 
     TestCheckPoint ();
Index: /trunk/Ohana/src/opihi/pcontrol/pcontrol.c.in
===================================================================
--- /trunk/Ohana/src/opihi/pcontrol/pcontrol.c.in	(revision 42388)
+++ /trunk/Ohana/src/opihi/pcontrol/pcontrol.c.in	(revision 42389)
@@ -9,4 +9,8 @@
 # define opihi_rcfile ".pcontrolrc"
 
+# ifdef THREADED  
+  static pthread_t clientsThread;
+# endif
+
 /* program-dependent initialization */
 void program_init (int *argc, char **argv) {
@@ -14,8 +18,4 @@
   OHANA_UNUSED_PARAM(argv);
   
-# ifdef THREADED  
-  pthread_t clientsThread;
-# endif
-
   auto_break = TRUE;
 
@@ -83,6 +83,8 @@
   SetRunLevel (PCONTROL_RUN_HOSTS); 
   DownHosts ();
+
+  QuitCheckSystemThread(); pthread_join (clientsThread, NULL);
+
   ConfigFree ();
-
   FreeBasic ();
   FreePcontrol ();
Index: /trunk/Ohana/src/opihi/pcontrol/test/linesize.sh
===================================================================
--- /trunk/Ohana/src/opihi/pcontrol/test/linesize.sh	(revision 42388)
+++ /trunk/Ohana/src/opihi/pcontrol/test/linesize.sh	(revision 42389)
@@ -27,5 +27,5 @@
 
   for i 1 10
-    job echo $inline7
+    job echo $inline6
   end
 
@@ -34,5 +34,5 @@
   for i 1 10
     stdout $i -var outline
-    strlen "$inline7" Nin
+    strlen "$inline6" Nin
     strlen "$outline" Nout
 
Index: /trunk/Ohana/src/opihi/test/tap.tp
===================================================================
--- /trunk/Ohana/src/opihi/test/tap.tp	(revision 42389)
+++ /trunk/Ohana/src/opihi/test/tap.tp	(revision 42389)
@@ -0,0 +1,61 @@
+
+macro plan
+ if ($0 != 2)
+  echo "USAGE: plan (Ntest)"
+  break
+ end
+
+ $tap_Nplan = $1
+ $tap_Npass = 0
+ $tap_Nfail = 0
+ $tap_Ntest = 0
+end
+
+macro done
+ if (not($?tap_Nplan))
+  echo "ERROR: tap tests not planned"
+  break
+ end
+
+ echo "planned $tap_Nplan tests, ran $tap_Ntest"
+ echo "passed $tap_Npass tests, failed $tap_Nfail tests"
+
+ if (($tap_Nfail == 0) && ($tap_Ntest == $tap_Nplan) && ($tap_Npass == $tap_Ntest))
+   echo "PASS: all tests run and passed"
+   return 1
+ end
+
+ if ($tap_Nfail > 0)
+   echo "FAIL: $tap_Nfail tests failed"
+ end
+
+ if ($tap_Ntest != $tap_Nplan)
+   echo "FAIL: not all tests run"
+ end
+
+ if ($tap_Ntest != $tap_Npass + $tap_Nfail)
+   echo "FAIL: inconsistent count: $tap_Ntest tests != $tap_Npass pass + $tap_Nfail fail"
+ end
+end
+
+macro ok
+ if ($0 != 3)
+  echo "USAGE (condition) (label)"
+  break
+ end
+ 
+ if (not($?tap_Nplan))
+  echo "ERROR: tap tests not planned"
+  break
+ end
+ 
+ if ($1)
+  echo "OK: $2"
+  $tap_Npass ++
+ else     
+  echo "not OK: $2"
+  $tap_Nfail ++
+ end
+ $tap_Ntest ++
+end
+
Index: /trunk/Ohana/src/opihi/test/tests.sh
===================================================================
--- /trunk/Ohana/src/opihi/test/tests.sh	(revision 42388)
+++ /trunk/Ohana/src/opihi/test/tests.sh	(revision 42389)
@@ -53,5 +53,5 @@
   for Tj 0 $testscripts:n
     if ($VERBOSE > 1)
-      echo " running $testscripts:$Tj"
+      echo " ----- running $testscripts:$Tj -----"
     end
     runtests $testscripts:$Tj      
Index: /trunk/Ohana/src/photdbc/src/ConfigInit.c
===================================================================
--- /trunk/Ohana/src/photdbc/src/ConfigInit.c	(revision 42388)
+++ /trunk/Ohana/src/photdbc/src/ConfigInit.c	(revision 42389)
@@ -13,5 +13,5 @@
 
   char *config, *file;
-  char CatdirPhotcodeFile[256];
+  char CatdirPhotcodeFile[DVO_MAX_PATH];
 
   /*** load configuration info ***/
@@ -59,5 +59,5 @@
   free (tmpcatdir);
 
-  sprintf (ImageCat, "%s/Images.dat", CATDIR);
+  snprintf_nowarn (ImageCat, DVO_MAX_PATH, "%s/Images.dat", CATDIR);
 
   WarnConfig (config, "ZERO_PT",                "%lf", 0, &ZERO_POINT);
@@ -72,5 +72,5 @@
 
   /* XXX this does not yet write out the master photcode table */
-  sprintf (CatdirPhotcodeFile, "%s/Photcodes.dat", CATDIR);
+  snprintf_nowarn (CatdirPhotcodeFile, DVO_MAX_PATH, "%s/Photcodes.dat", CATDIR);
   if (!LoadPhotcodes (CatdirPhotcodeFile, NULL, FALSE)) {
     fprintf (stderr, "error loading photcode table %s\n", CatdirPhotcodeFile);
Index: /trunk/Ohana/src/photdbc/src/copy_images.c
===================================================================
--- /trunk/Ohana/src/photdbc/src/copy_images.c	(revision 42388)
+++ /trunk/Ohana/src/photdbc/src/copy_images.c	(revision 42389)
@@ -58,5 +58,5 @@
 
   char mapfile[DVO_MAX_PATH];
-  snprintf (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", CATDIR);
+  snprintf_nowarn (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", CATDIR);
   AstromOffsetTable *table_src = AstromOffsetMapLoad (mapfile, 100000, VERBOSE);
 
@@ -77,5 +77,5 @@
       AstromOffsetTableAddMapFromImage (table_tgt, &subset[i]);
     }
-    snprintf (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", outdir);
+    snprintf_nowarn (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", outdir);
     AstromOffsetMapSave (table_tgt, mapfile);
     free (table_tgt->imageIDtoTableSeq);
Index: /trunk/Ohana/src/relastro/src/ConfigInit.c
===================================================================
--- /trunk/Ohana/src/relastro/src/ConfigInit.c	(revision 42388)
+++ /trunk/Ohana/src/relastro/src/ConfigInit.c	(revision 42389)
@@ -61,5 +61,5 @@
   ScanConfig(config, "WHERE_B",                "%s",  0, WHERE_B);
 
-  snprintf (ImageCat, DVO_MAX_PATH, "%s/Images.dat", CATDIR);
+  snprintf_nowarn (ImageCat, DVO_MAX_PATH, "%s/Images.dat", CATDIR);
 
   if (!ScanConfig (config, "SKY_DEPTH",         "%d",  0, &SKY_DEPTH)) SKY_DEPTH = 2;
@@ -77,5 +77,5 @@
 
   /* update master photcode table if not defined */
-  snprintf (CatdirPhotcodeFile, DVO_MAX_PATH, "%s/Photcodes.dat", CATDIR);
+  snprintf_nowarn (CatdirPhotcodeFile, DVO_MAX_PATH, "%s/Photcodes.dat", CATDIR);
   if (!LoadPhotcodes (CatdirPhotcodeFile, NULL, FALSE)) {
     fprintf (stderr, "error loading photcode table %s\n", CatdirPhotcodeFile);
Index: /trunk/Ohana/src/relastro/src/FrameCorrection.c
===================================================================
--- /trunk/Ohana/src/relastro/src/FrameCorrection.c	(revision 42388)
+++ /trunk/Ohana/src/relastro/src/FrameCorrection.c	(revision 42389)
@@ -80,5 +80,5 @@
   static int version = 0;
   char filename[1024];
-  snprintf (filename, 1024, "%s/frame.%03d.corr.fits", CATDIR, version);
+  snprintf_nowarn (filename, 1024, "%s/frame.%03d.corr.fits", CATDIR, version);
   FrameCorrectionSetSave (filename, set);
   version ++;
@@ -217,5 +217,5 @@
     static int version = 0;
     char filename[1024];
-    snprintf (filename, 1024, "%s/sh.%02d.dat", CATDIR, version);
+    snprintf_nowarn (filename, 1024, "%s/sh.%02d.dat", CATDIR, version);
     FILE *f = fopen (filename, "w");
     myAssert (f, "oops");
@@ -519,5 +519,5 @@
     static int version = 0;
     char filename[1024];
-    snprintf (filename, 1024, "%s/map.%02d.dat", CATDIR, version);
+    snprintf_nowarn (filename, 1024, "%s/map.%02d.dat", CATDIR, version);
     FILE *f = fopen (filename, "w");
     version ++;
Index: /trunk/Ohana/src/relastro/src/ICRF.c
===================================================================
--- /trunk/Ohana/src/relastro/src/ICRF.c	(revision 42388)
+++ /trunk/Ohana/src/relastro/src/ICRF.c	(revision 42389)
@@ -56,5 +56,5 @@
 
   char filename[1024];
-  snprintf (filename, 1024, "%s/test.icrf.dat", CATDIR);
+  snprintf_nowarn (filename, 1024, "%s/test.icrf.dat", CATDIR);
   FILE *f = fopen (filename, "w");
 
Index: /trunk/Ohana/src/relastro/src/assign_images.c
===================================================================
--- /trunk/Ohana/src/relastro/src/assign_images.c	(revision 42388)
+++ /trunk/Ohana/src/relastro/src/assign_images.c	(revision 42389)
@@ -25,5 +25,5 @@
 
   char mapfile[DVO_MAX_PATH];
-  snprintf (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", CATDIR);
+  snprintf_nowarn (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", CATDIR);
   AstromOffsetTable *table = AstromOffsetMapLoad (mapfile, 100000, VERBOSE);
 
Index: /trunk/Ohana/src/relastro/src/bcatalog.c
===================================================================
--- /trunk/Ohana/src/relastro/src/bcatalog.c	(revision 42388)
+++ /trunk/Ohana/src/relastro/src/bcatalog.c	(revision 42389)
@@ -64,5 +64,5 @@
   if (VERBOSE2 && ExcludeBogus && (fbogus == NULL)) {
     char name[1024];
-    snprintf (name, 1024, "%s/bogus.%02d.dat", CATDIR, HOST_ID);
+    snprintf_nowarn (name, 1024, "%s/bogus.%02d.dat", CATDIR, HOST_ID);
     fbogus = fopen (name, "w");
     if (!fbogus) {
@@ -533,5 +533,5 @@
   if (dumpit) {
     char name[64];
-    snprintf (name, 64, "cat.%05d.dump.dat", oldcatalog[0].catID);
+    snprintf_nowarn (name, 64, "cat.%05d.dump.dat", oldcatalog[0].catID);
     FILE *fdump = fopen (name, "w");
     for (i = 0; i < Nkeep; i++) {
Index: /trunk/Ohana/src/relastro/src/launch_region_hosts.c
===================================================================
--- /trunk/Ohana/src/relastro/src/launch_region_hosts.c	(revision 42388)
+++ /trunk/Ohana/src/relastro/src/launch_region_hosts.c	(revision 42389)
@@ -63,5 +63,5 @@
     // subset images per host : CATDIR/Image.HOSTNAME.fits
     char filename[1024];
-    snprintf (filename, 1024, "%s/Image.%d.fits", CATDIR, host->hostID);
+    snprintf_nowarn (filename, 1024, "%s/Image.%d.fits", CATDIR, host->hostID);
     if (unlink (filename)) fprintf (stderr, "trouble clearing image %s\n", filename);
 
@@ -71,5 +71,5 @@
     if (host->astromTable) {
       char mapname[1024];
-      snprintf (mapname, 1024, "%s/AstroMap.%d.fits", CATDIR, host->hostID);
+      snprintf_nowarn (mapname, 1024, "%s/AstroMap.%d.fits", CATDIR, host->hostID);
 
       // write the image subset for this host
Index: /trunk/Ohana/src/relastro/src/load_images.c
===================================================================
--- /trunk/Ohana/src/relastro/src/load_images.c	(revision 42388)
+++ /trunk/Ohana/src/relastro/src/load_images.c	(revision 42389)
@@ -56,5 +56,5 @@
 
   char mapfile[DVO_MAX_PATH];
-  snprintf (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", CATDIR);
+  snprintf_nowarn (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", CATDIR);
   table = AstromOffsetMapLoad (mapfile, 100000, VERBOSE);
 
@@ -96,5 +96,5 @@
 
   char mapfile[DVO_MAX_PATH];
-  snprintf (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", CATDIR);
+  snprintf_nowarn (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", CATDIR);
   AstromOffsetMapSave (table, mapfile);
 
Index: /trunk/Ohana/src/relastro/src/relastro_parallel_images.c
===================================================================
--- /trunk/Ohana/src/relastro/src/relastro_parallel_images.c	(revision 42388)
+++ /trunk/Ohana/src/relastro/src/relastro_parallel_images.c	(revision 42389)
@@ -43,5 +43,5 @@
 
   char mapfile[DVO_MAX_PATH];
-  snprintf (mapfile, DVO_MAX_PATH, "%s/AstroMap.%d.fits", CATDIR, REGION_HOST_ID);
+  snprintf_nowarn (mapfile, DVO_MAX_PATH, "%s/AstroMap.%d.fits", CATDIR, REGION_HOST_ID);
   AstromOffsetTable *table = AstromOffsetMapLoad (mapfile, 100000, VERBOSE);
 
Index: /trunk/Ohana/src/relastro/src/share_images_pos.c
===================================================================
--- /trunk/Ohana/src/relastro/src/share_images_pos.c	(revision 42388)
+++ /trunk/Ohana/src/relastro/src/share_images_pos.c	(revision 42389)
@@ -38,5 +38,5 @@
   if (table) {
     char mapname[1024];
-    snprintf (mapname, 1024, "%s/AstroMapUpdate.%d.fits", CATDIR, REGION_HOST_ID);
+    snprintf_nowarn (mapname, 1024, "%s/AstroMapUpdate.%d.fits", CATDIR, REGION_HOST_ID);
     
     // write the image subset for this host
@@ -113,5 +113,5 @@
 
     char mapname[1024];
-    snprintf (mapname, 1024, "%s/AstroMapUpdate.%d.fits", CATDIR, regionHosts->hosts[i].hostID);
+    snprintf_nowarn (mapname, 1024, "%s/AstroMapUpdate.%d.fits", CATDIR, regionHosts->hosts[i].hostID);
     
     AstromOffsetTable *table = AstromOffsetMapLoad (mapname, 100000, VERBOSE);
Index: /trunk/Ohana/src/relphot/include/relphot.h
===================================================================
--- /trunk/Ohana/src/relphot/include/relphot.h	(revision 42388)
+++ /trunk/Ohana/src/relphot/include/relphot.h	(revision 42389)
@@ -470,4 +470,5 @@
 int    PRESERVE_PS1;
 int    REQUIRE_PSFFIT;
+int    USE_APER_FOR_STARGAL;
 int    UPDATE;
 int    SAVE_IMAGE_UPDATES;
Index: /trunk/Ohana/src/relphot/src/args.c
===================================================================
--- /trunk/Ohana/src/relphot/src/args.c	(revision 42388)
+++ /trunk/Ohana/src/relphot/src/args.c	(revision 42389)
@@ -247,4 +247,9 @@
     REQUIRE_PSFFIT = TRUE;
   }
+  USE_APER_FOR_STARGAL = FALSE;
+  if ((N = get_argument (argc, argv, "-use-aper-for-stargal"))) {
+    remove_argument (N, &argc, argv);
+    USE_APER_FOR_STARGAL = TRUE;
+  }
 
   UPDATE = FALSE;
Index: /trunk/Ohana/src/relphot/src/bcatalog.c
===================================================================
--- /trunk/Ohana/src/relphot/src/bcatalog.c	(revision 42388)
+++ /trunk/Ohana/src/relphot/src/bcatalog.c	(revision 42389)
@@ -82,15 +82,17 @@
       if (DophotSelect && ((catalog[0].measure[offset].photFlags >> 16) != DophotValue)) { Ndophot ++; continue; }
 
+      float Maper = USE_APER_FOR_STARGAL ? catalog[0].measure[offset].Map : catalog[0].measure[offset].Mkron;
+
       // skip garbage measurements
       if (isnan(catalog[0].measure[offset].psfQF)     || (catalog[0].measure[offset].psfQF < 0.95))     { Npsfqf ++; continue; }
       if (isnan(catalog[0].measure[offset].psfQFperf) || (catalog[0].measure[offset].psfQFperf < 0.95)) { Npsfqf ++; continue; }
       if (isnan(catalog[0].measure[offset].M)) { Nnan ++; continue; }
-      if (isnan(catalog[0].measure[offset].Mkron)) { Nnan ++; continue; }
+      if (isnan(Maper)) { Nnan ++; continue; }
 
       // require 0x01 in photFlags (fitted with a PSF) -- add to the test data
       if (REQUIRE_PSFFIT && (catalog[0].measure[offset].photFlags & 0x01) == 0) { Nbad ++; continue; }
 
-      // very loose cut on PSF - Kron 
-      float Mkp = catalog[0].measure[offset].M - catalog[0].measure[offset].Mkron;
+      // very loose cut on PSF - APER mag (Map or Mkron) -- this lightly rejects galaxies & other oddities
+      float Mkp = catalog[0].measure[offset].M - Maper;
       if (fabs(Mkp) > 1.0) { Nbad ++; continue; }
 
@@ -101,11 +103,9 @@
       if (catalog[0].measure[offset].photFlags & code->photomPoorMask) { Npoor++; continue;}
 
-      // check for galaxies (XXX skip for now)
-      if (FALSE && !isnan(catalog[0].measure[offset].Map)) {
-	if (catalog[0].measure[offset].M - catalog[0].measure[offset].Map > 0.15) {
-	  nEXT ++;
-	} else {
-	  nPSF ++;
-	}
+      // weak test for galaxies
+      if (Mkp > 0.5) {
+	nEXT ++;
+      } else {
+	nPSF ++;
       }
 
@@ -145,5 +145,5 @@
 
     // skip object if it is likely to be a galaxy
-    if (FALSE && (nEXT >= nPSF)) {
+    if (nEXT >= nPSF) {
       Nmeasure -= Nm;
       Ngalaxy ++;
Index: /trunk/Ohana/src/relphot/src/save_images.c
===================================================================
--- /trunk/Ohana/src/relphot/src/save_images.c	(revision 42388)
+++ /trunk/Ohana/src/relphot/src/save_images.c	(revision 42389)
@@ -19,5 +19,5 @@
 
   char filename[1024];
-  snprintf (filename, 1024, "%s.bck", ImageCat); // ImageCat is global
+  snprintf_nowarn (filename, 1024, "%s.bck", ImageCat); // ImageCat is global
   if (!gfits_db_lock (&dbX, filename)) {
     fprintf (stderr, "can't lock backup image image catalog\n");
@@ -85,5 +85,5 @@
   dbX.format    = db->format;
 
-  snprintf (filename, 1024, "%s.bck", ImageCat);
+  snprintf_nowarn (filename, 1024, "%s.bck", ImageCat);
   if (!gfits_db_lock (&dbX, filename)) {
     fprintf (stderr, "can't lock backup image image catalog\n");
Index: /trunk/Ohana/src/tools/src/findexec.c
===================================================================
--- /trunk/Ohana/src/tools/src/findexec.c	(revision 42388)
+++ /trunk/Ohana/src/tools/src/findexec.c	(revision 42389)
@@ -101,8 +101,8 @@
 	done = TRUE;
 	bzero (path, 256);
-	strncpy (path, c, strlen(c));
+	strncpy_nowarn (path, c, strlen(c));
       } else {
 	bzero (path, 256);
-	strncpy (path, c, e-c);
+	strncpy_nowarn (path, c, e-c);
 	c = e+1;
 	e = strchr (c, ':');
Index: /trunk/Ohana/src/tools/src/fits_insert.c
===================================================================
--- /trunk/Ohana/src/tools/src/fits_insert.c	(revision 42388)
+++ /trunk/Ohana/src/tools/src/fits_insert.c	(revision 42389)
@@ -85,5 +85,5 @@
     p = gfits_header_field (&header, "COMMENT", Cnumber);
     if (p != (char *) NULL) {
-      strncpy (p, line, 80);
+      memcpy (p, line, 80); // do not use strncpy_nowarn: do NOT set last byte to NULL
     }
   }
@@ -108,5 +108,5 @@
     line[80] = 0;
     bzero (keyword, 10);
-    strncpy (keyword, line, 8);
+    strncpy_nowarn (keyword, line, 8);
     
     /* replace existing keywords, unless this is a COMMENT or HISTORY field */
@@ -114,5 +114,5 @@
       p = gfits_header_field (&header, keyword, 1);
       if (p != (char *) NULL) {
-	strncpy (p, line, 80);
+	strncpy_nowarn (p, line, 80);
 	continue;
       }
@@ -151,9 +151,9 @@
 	exit (1);
       }
-      strncpy (p+80, "END", 3);
+      memcpy (p+80, "END", 3); // do not use strncpy_nowarn, do NOT set last byte to NULL
       for (i = 3; i < 80; i++) { p[80+i] = ' '; }
     }
     /* insert the new line here */
-    strncpy (p, line, 80);
+    memcpy (p, line, 80); // do not use strncpy_nowarn, do NOT set last byte to NULL
   }
   if (fclose (f)) {
Index: /trunk/Ohana/src/tools/src/fits_to_mysql.c
===================================================================
--- /trunk/Ohana/src/tools/src/fits_to_mysql.c	(revision 42388)
+++ /trunk/Ohana/src/tools/src/fits_to_mysql.c	(revision 42389)
@@ -252,8 +252,8 @@
 
     char field[256], tlabel[256], format[256];
-    snprintf (field, 256, "TTYPE%d", i+1);
+    snprintf_nowarn (field, 256, "TTYPE%d", i+1);
     gfits_scan (header, field, "%s", 1, tlabel);
 
-    snprintf (field, 256, "TFORM%d", i+1);
+    snprintf_nowarn (field, 256, "TFORM%d", i+1);
     gfits_scan (header, field, "%s", 1, format);
 
@@ -270,5 +270,5 @@
     if (Ndup) {
       char tmpname[256];
-      snprintf (tmpname, 256, "%s_%d", tlabel, Ndup);
+      snprintf_nowarn (tmpname, 256, "%s_%d", tlabel, Ndup);
       column[Ncolumn].colname = strcreate (tmpname);
     } else {
@@ -357,5 +357,5 @@
     char colname[64];
     for (j = 0; j < Nval; j++) {
-      snprintf (colname, 64, "%s_%d", rootname, j + 1);
+      snprintf_nowarn (colname, 64, "%s_%d", rootname, j + 1);
       PrintIOBuffer (buffer, "%s %s", colname, typename);
       if (j < Nval - 1) {
@@ -455,5 +455,5 @@
       char colname[64];
       for (j = 0; j < columns[i].Nval; j++) {
-	snprintf (colname, 64, "%s_%d", columns[i].colname, j + 1);
+	snprintf_nowarn (colname, 64, "%s_%d", columns[i].colname, j + 1);
 	PrintIOBuffer (insert, "%s", colname);
 	if (j < columns[i].Nval - 1) {
@@ -649,11 +649,11 @@
 
   /* get column keywords */
-  snprintf (field, 256, "TTYPE%d", Nfield);
+  snprintf_nowarn (field, 256, "TTYPE%d", Nfield);
   gfits_scan (header, field, "%s", 1, tlabel);
-  snprintf (field, 256, "TSCAL%d", Nfield);
+  snprintf_nowarn (field, 256, "TSCAL%d", Nfield);
   gfits_scan (header, field, "%lf", 1, &Bscale);
-  snprintf (field, 256, "TZERO%d", Nfield);
+  snprintf_nowarn (field, 256, "TZERO%d", Nfield);
   gfits_scan (header, field, "%lf", 1, &Bzero);
-  snprintf (field, 256, "TFORM%d", Nfield);
+  snprintf_nowarn (field, 256, "TFORM%d", Nfield);
   gfits_scan (header, field, "%s", 1, format);
 
@@ -669,5 +669,5 @@
   int Nstart = 0;
   for (i = 1; i < Nfield; i++) {
-    snprintf (field, 256, "TFORM%d", i);
+    snprintf_nowarn (field, 256, "TFORM%d", i);
     gfits_scan (header, field, "%s", 1, format);
     int Nv, Nb;
Index: /trunk/Ohana/src/tools/src/mpcorb_predict.c
===================================================================
--- /trunk/Ohana/src/tools/src/mpcorb_predict.c	(revision 42388)
+++ /trunk/Ohana/src/tools/src/mpcorb_predict.c	(revision 42389)
@@ -775,5 +775,5 @@
   // set the byte after the range to NULL and scanf the values.  or just use strtod as needed:
 
-  strncpy (planet->ID, line, 7); planet->ID[7] = 0;
+  strncpy_nowarn (planet->ID, line, 7);
 
   char *endptr;
Index: /trunk/Ohana/src/tools/src/mpcorb_predict_tests.c
===================================================================
--- /trunk/Ohana/src/tools/src/mpcorb_predict_tests.c	(revision 42388)
+++ /trunk/Ohana/src/tools/src/mpcorb_predict_tests.c	(revision 42389)
@@ -1059,5 +1059,5 @@
   // set the byte after the range to NULL and scanf the values.  or just use strtod as needed:
 
-  strncpy (planet->ID, line, 7); planet->ID[7] = 0;
+  strncpy_nowarn (planet->ID, line, 7);
 
   MPC_DOUBLE (planet->mean_anomaly, 27, 35);
Index: /trunk/Ohana/src/uniphot/src/ConfigInit.c
===================================================================
--- /trunk/Ohana/src/uniphot/src/ConfigInit.c	(revision 42388)
+++ /trunk/Ohana/src/uniphot/src/ConfigInit.c	(revision 42389)
@@ -22,5 +22,5 @@
   ScanConfig (config, "CATFORMAT",              "%s",  0, CATFORMAT);
 
-  sprintf (ImageCat, "%s/Images.dat", CATDIR);
+  snprintf_nowarn (ImageCat, 256, "%s/Images.dat", CATDIR);
 
   GetConfig (config, "GSCFILE",                 "%s",  0, GSCFILE);
Index: /trunk/Ohana/src/uniphot/src/load_zpt_table.c
===================================================================
--- /trunk/Ohana/src/uniphot/src/load_zpt_table.c	(revision 42388)
+++ /trunk/Ohana/src/uniphot/src/load_zpt_table.c	(revision 42389)
@@ -323,5 +323,5 @@
 	  // photcode name
 	  char photname[64];
-	  snprintf (photname, 64, "GPC1.%s.XY%d%d", filter, ix, iy);
+	  snprintf_nowarn (photname, 64, "GPC1.%s.XY%d%d", filter, ix, iy);
 	  // note that the XY00, XY07, etc, chips will have photcode values of 0
 
