Index: /branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.data/Makefile
===================================================================
--- /branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.data/Makefile	(revision 42304)
+++ /branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.data/Makefile	(revision 42305)
@@ -154,4 +154,5 @@
 $(SRC)/set.$(ARCH).o		\
 $(SRC)/shift.$(ARCH).o		\
+$(SRC)/opihi_size.$(ARCH).o        \
 $(SRC)/sort.$(ARCH).o		\
 $(SRC)/spline.$(ARCH).o		\
Index: /branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.data/init.c
===================================================================
--- /branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.data/init.c	(revision 42304)
+++ /branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.data/init.c	(revision 42305)
@@ -160,4 +160,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 **));
@@ -350,4 +351,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: /branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.data/limits.c
===================================================================
--- /branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.data/limits.c	(revision 42304)
+++ /branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.data/limits.c	(revision 42305)
@@ -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: /branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.data/opihi_size.c
===================================================================
--- /branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.data/opihi_size.c	(revision 42305)
+++ /branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.data/opihi_size.c	(revision 42305)
@@ -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: /branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.data/reindex.c
===================================================================
--- /branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.data/reindex.c	(revision 42304)
+++ /branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.data/reindex.c	(revision 42305)
@@ -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
