Index: /branches/czw_branch/20160809/Ohana/src/opihi/cmd.astro/spex1dgas.c
===================================================================
--- /branches/czw_branch/20160809/Ohana/src/opihi/cmd.astro/spex1dgas.c	(revision 39855)
+++ /branches/czw_branch/20160809/Ohana/src/opihi/cmd.astro/spex1dgas.c	(revision 39856)
@@ -108,12 +108,7 @@
   IDList = NULL;
   XoList = NULL;
-  { 
-    // init random numbers
-    long A, B;
-    A = time(NULL);
-    for (B = 0; A == time(NULL); B++);
-    srand48(B);
-  }
  
+  // srand48() is called by startup.c
+
   if (argc != 11) goto usage;
 
Index: /branches/czw_branch/20160809/Ohana/src/opihi/cmd.astro/spex2dgas.c
===================================================================
--- /branches/czw_branch/20160809/Ohana/src/opihi/cmd.astro/spex2dgas.c	(revision 39855)
+++ /branches/czw_branch/20160809/Ohana/src/opihi/cmd.astro/spex2dgas.c	(revision 39856)
@@ -120,12 +120,6 @@
   float XoMax, YoMax;
 
-  { 
-    // init random numbers
-    long A, B;
-    A = time(NULL);
-    for (B = 0; A == time(NULL); B++);
-    srand48(B);
-  }
- 
+  // srand48() is called by startup.c
+
   if (argc != 9) goto usage;
 
Index: /branches/czw_branch/20160809/Ohana/src/opihi/cmd.astro/spexseq.c
===================================================================
--- /branches/czw_branch/20160809/Ohana/src/opihi/cmd.astro/spexseq.c	(revision 39855)
+++ /branches/czw_branch/20160809/Ohana/src/opihi/cmd.astro/spexseq.c	(revision 39856)
@@ -90,13 +90,7 @@
   int Nobject = 0;
 
-  { 
-    // init random numbers
-    long A, B;
-    A = time(NULL);
-    for (B = 0; A == time(NULL); B++);
-    srand48(B);
-  }
- 
   if (argc != 6) goto usage;
+
+  // srand48() is called by startup.c
 
   // XXX enforce matching lengths on the three vectors
Index: /branches/czw_branch/20160809/Ohana/src/opihi/cmd.data/Makefile
===================================================================
--- /branches/czw_branch/20160809/Ohana/src/opihi/cmd.data/Makefile	(revision 39855)
+++ /branches/czw_branch/20160809/Ohana/src/opihi/cmd.data/Makefile	(revision 39856)
@@ -124,4 +124,5 @@
 $(SRC)/resize.$(ARCH).o		\
 $(SRC)/relocate.$(ARCH).o	\
+$(SRC)/rndseed.$(ARCH).o		\
 $(SRC)/roll.$(ARCH).o		\
 $(SRC)/rotate.$(ARCH).o	\
Index: /branches/czw_branch/20160809/Ohana/src/opihi/cmd.data/init.c
===================================================================
--- /branches/czw_branch/20160809/Ohana/src/opihi/cmd.data/init.c	(revision 39855)
+++ /branches/czw_branch/20160809/Ohana/src/opihi/cmd.data/init.c	(revision 39856)
@@ -113,4 +113,5 @@
 int reindex          PROTO((int, char **));
 int relocate         PROTO((int, char **));
+int rndseed          PROTO((int, char **));
 int roll             PROTO((int, char **));
 int rotate           PROTO((int, char **));
@@ -293,4 +294,5 @@
   {1, "relocate",     relocate,         "set graphics/image window position"},
   {1, "roll",         roll,             "roll image to new start point"},
+  {1, "rndseed",      rndseed,          "set the pseudo-random seed"},
   {1, "rotate",       rotate,           "rotate image"},
   {1, "save",         save,             "save an SAOimage style image overlay"},
Index: /branches/czw_branch/20160809/Ohana/src/opihi/cmd.data/rndseed.c
===================================================================
--- /branches/czw_branch/20160809/Ohana/src/opihi/cmd.data/rndseed.c	(revision 39856)
+++ /branches/czw_branch/20160809/Ohana/src/opihi/cmd.data/rndseed.c	(revision 39856)
@@ -0,0 +1,18 @@
+# include "data.h"
+
+int rndseed (int argc, char **argv) {
+  
+  if (argc < 2) {
+    gprint (GP_ERR, "USAGE: rndseed (value)\n");
+    return (FALSE);
+  }
+
+  /* init srand for rnd numbers elsewhere */
+  long A = atol (argv[1]);
+  srand48(A);
+
+  return (TRUE);
+}
+
+ 
+  
Index: /branches/czw_branch/20160809/Ohana/src/opihi/cmd.data/stats-new.c
===================================================================
--- /branches/czw_branch/20160809/Ohana/src/opihi/cmd.data/stats-new.c	(revision 39855)
+++ /branches/czw_branch/20160809/Ohana/src/opihi/cmd.data/stats-new.c	(revision 39856)
@@ -129,7 +129,5 @@
   ALLOCATE (values, float, Nsample);
     
-  A = time(NULL);
-  for (B = 0; A == time(NULL); B++);
-  srand48(B);
+  // srand48() is called by startup.c
  
   *buffer = (float *) matrix[0].buffer;
Index: /branches/czw_branch/20160809/Ohana/src/opihi/dvo/imdense.c
===================================================================
--- /branches/czw_branch/20160809/Ohana/src/opihi/dvo/imdense.c	(revision 39855)
+++ /branches/czw_branch/20160809/Ohana/src/opihi/dvo/imdense.c	(revision 39856)
@@ -4,5 +4,4 @@
 int imdense (int argc, char **argv) {
   
-  long A, B;
   off_t i, Nimage;
   int kapa, N, status, NPTS;
@@ -27,7 +26,5 @@
   Rmax = graphmode.coords.crval1 + 182.0;
   
-  A = time(NULL);
-  for (B = 0; A == time(NULL); B++);
-  srand48(B);
+  // srand48() is called by startup.c
 
   N = 0;
