Index: /trunk/Ohana/src/opihi/cmd.data/cumulative.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/cumulative.c	(revision 10307)
+++ /trunk/Ohana/src/opihi/cmd.data/cumulative.c	(revision 10307)
@@ -0,0 +1,28 @@
+# include "data.h"
+
+int cumulative (int argc, char **argv) {
+  
+  int i;
+  float *Vi, *Vo;
+  Vector *ivec, *ovec;
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: cumulative invec outvec\n");
+    return (FALSE);
+  }
+
+  if ((ivec = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((ovec = SelectVector (argv[2], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  ovec[0].Nelements = ivec[0].Nelements;
+    
+  REALLOCATE (ovec[0].elements, float, ovec[0].Nelements);
+  bzero (ovec[0].elements, sizeof(float)*ovec[0].Nelements);
+
+  Vi = ivec[0].elements;
+  Vo = ovec[0].elements;
+  *Vo = *Vi;
+  for (i = 1; i < ivec[0].Nelements; i++, Vi++, Vo++) {
+    *Vo = Vo[-1] + *Vi;
+  }      
+  return (TRUE);
+}
Index: /trunk/Ohana/src/opihi/cmd.data/init.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/init.c	(revision 10306)
+++ /trunk/Ohana/src/opihi/cmd.data/init.c	(revision 10307)
@@ -13,4 +13,5 @@
 int contour          PROTO((int, char **));
 int create           PROTO((int, char **));
+int cumulative       PROTO((int, char **));
 int cursor           PROTO((int, char **));
 int cut              PROTO((int, char **));
@@ -124,4 +125,5 @@
   {"contour", 	   contour,	     "create contour from image"},
   {"create",  	   create,	     "create a new vector"},
+  {"cumulative",   cumulative,	     "build a cumulative histogram from a specific histogram"},
   {"cursor",  	   cursor,	     "get coords from cursor"},
   {"cut",	   cut,		     "extract a cut across an image"},
Index: /trunk/Ohana/src/opihi/cmd.data/line.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/line.c	(revision 10306)
+++ /trunk/Ohana/src/opihi/cmd.data/line.c	(revision 10307)
@@ -5,71 +5,29 @@
   int N, Npts;
   Graphdata graphmode;
-  Vector *vecx, *vecy, *dxm, *dxp, *dym, *dyp;
+  float x[2], y[2];
 
   if (!style_args (&graphmode, &argc, argv, -1)) return FALSE;
 
-  /* decide on error bars */
-  dxm = dxp = dym = dyp = NULL;
-  if ((N = get_argument (argc, argv, "-dx"))) {
-    remove_argument (N, &argc, argv);
-    if ((dxm = SelectVector (argv[N], OLDVECTOR, TRUE)) == NULL) return (FALSE);
-    remove_argument (N, &argc, argv);
-  }
-  if ((N = get_argument (argc, argv, "+dx"))) {
-    remove_argument (N, &argc, argv);
-    if ((dxp = SelectVector (argv[N], OLDVECTOR, TRUE)) == NULL) return (FALSE);
-    remove_argument (N, &argc, argv);
-  }
-  if ((N = get_argument (argc, argv, "-dy"))) {
-    remove_argument (N, &argc, argv);
-    if ((dym = SelectVector (argv[N], OLDVECTOR, TRUE)) == NULL) return (FALSE);
-    remove_argument (N, &argc, argv);
-  }
-  if ((N = get_argument (argc, argv, "+dy"))) {
-    remove_argument (N, &argc, argv);
-    if ((dyp = SelectVector (argv[N], OLDVECTOR, TRUE)) == NULL) return (FALSE);
-    remove_argument (N, &argc, argv);
-  }
-
-  if (argc != 3) {
-    gprint (GP_ERR, "USAGE: plot <x> <y>\n");
+  if (argc != 6) {
+    gprint (GP_ERR, "USAGE: line <x> <y> to <x> <y>\n");
     return (FALSE);
   }
+  x[0] = atof(argv[1]);
+  y[0] = atof(argv[2]);
+  x[1] = atof(argv[4]);
+  y[1] = atof(argv[5]);
+
   SetGraph (graphmode);
 
-  /* set errorbar mode (these are NOT sticky) */
+  /* set point style and errorbar mode (these are NOT sticky) */
+  graphmode.style = 0;
   graphmode.etype = 0;
-  if ((dym != NULL) && (dyp == NULL)) dyp = dym;
-  if ((dyp != NULL) && (dym == NULL)) dym = dyp;
-  if ((dyp != NULL) || (dym != NULL)) graphmode.etype |= 0x01;
-  if ((dxm != NULL) && (dxp == NULL)) dxp = dxm;
-  if ((dxp != NULL) && (dxm == NULL)) dxm = dxp;
-  if ((dxp != NULL) || (dxm != NULL)) graphmode.etype |= 0x02;
+
+  if (!PrepPlotting (2, &graphmode)) return (FALSE);
   
-  /* find vectors */
-  if ((vecx = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
-  if ((vecy = SelectVector (argv[2], OLDVECTOR, TRUE)) == NULL) return (FALSE);
-  if (vecy[0].Nelements != vecy[0].Nelements) {
-    gprint (GP_ERR, "vectors %s and %s not the same length\n", argv[1], argv[2]);
-    return (FALSE);
-  }
-  
-  Npts = vecx[0].Nelements;
-  if (!PrepPlotting (Npts, &graphmode)) return (FALSE);
-  
-  PlotVector (Npts, vecx[0].elements);
-  PlotVector (Npts, vecy[0].elements);
-  if (graphmode.etype & 0x01) {
-    PlotVector (Npts, dym[0].elements);
-    PlotVector (Npts, dyp[0].elements);
-  }
-  if (graphmode.etype & 0x02) {
-    PlotVector (Npts, dxm[0].elements);
-    PlotVector (Npts, dxp[0].elements);
-  }
+  PlotVector (2, x);
+  PlotVector (2, y);
   
   return (TRUE);
 
 }
-
-
Index: /trunk/Ohana/src/opihi/cmd.data/vgauss.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/vgauss.c	(revision 10306)
+++ /trunk/Ohana/src/opihi/cmd.data/vgauss.c	(revision 10307)
@@ -53,5 +53,7 @@
   v1 = svec[0].elements;
   v2 = dy;
-  for (i = 0; i < Npts; i++, v1++, v2++) *v2 = 1.0 / (*v1 * *v1);
+  for (i = 0; i < Npts; i++, v1++, v2++) {
+      *v2 = (*v1 == 0.0) ? 0.0 : 1.0 / (*v1 * *v1);
+  } 
   
   ochisq = mrqinit (xvec[0].elements, yvec[0].elements, dy, Npts, par, Npar, fgaussOD, !Quiet);
