Index: trunk/Ohana/src/opihi/cmd.astro/Makefile
===================================================================
--- trunk/Ohana/src/opihi/cmd.astro/Makefile	(revision 39243)
+++ trunk/Ohana/src/opihi/cmd.astro/Makefile	(revision 39245)
@@ -25,4 +25,5 @@
 $(SRC)/cneedles.$(ARCH).o		   \
 $(SRC)/cplot.$(ARCH).o		   \
+$(SRC)/crotation.$(ARCH).o	   \
 $(SRC)/csystem.$(ARCH).o	   \
 $(SRC)/ctimes.$(ARCH).o	   \
Index: trunk/Ohana/src/opihi/cmd.astro/crotation.c
===================================================================
--- trunk/Ohana/src/opihi/cmd.astro/crotation.c	(revision 39245)
+++ trunk/Ohana/src/opihi/cmd.astro/crotation.c	(revision 39245)
@@ -0,0 +1,52 @@
+# include "astro.h"
+
+int crotation (int argc, char **argv) {
+
+  int i;
+  double X, Y, x, y;
+  opihi_flt *xptr, *yptr;
+  Vector *xvec, *yvec;
+  CoordTransform *transform;
+
+  if (argc != 6) {
+    gprint (GP_ERR, "USAGE: crotation (phi) (Xo) (xo) X Y\n");
+    return (FALSE);
+  }
+
+  double phi = atof(argv[1]);
+  double Xo  = atof(argv[2]);
+  double xo  = atof(argv[3]);
+  char *Xname = argv[4];
+  char *Yname = argv[5];
+
+  transform = AllocTransform (phi, Xo, xo);
+  if (SelectScalar (Xname, &X)) {
+    if (!SelectScalar (Yname, &Y)) return (FALSE);
+      
+    ApplyTransform (&x, &y, X, Y, transform);
+
+    gprint (GP_LOG, "%10.6f %10.6f\n", x, y);
+    return (TRUE);
+  }
+
+  /* find vectors */
+  if ((xvec = SelectVector (Xname, OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((yvec = SelectVector (Yname, OLDVECTOR, TRUE)) == NULL) return (FALSE);
+
+  if (xvec[0].Nelements != yvec[0].Nelements) {
+    gprint (GP_ERR, "vectors %s and %s not the same length\n", Xname, Yname);
+    return (FALSE);
+  }
+  
+  CastVector (xvec, OPIHI_FLT);
+  CastVector (yvec, OPIHI_FLT);
+
+  xptr = xvec[0].elements.Flt;
+  yptr = yvec[0].elements.Flt;
+
+  for (i = 0; i < xvec[0].Nelements; i++, xptr++, yptr++) {
+    ApplyTransform (xptr, yptr, *xptr, *yptr, transform);
+  }
+
+  return (TRUE);
+}
Index: trunk/Ohana/src/opihi/cmd.astro/init.c
===================================================================
--- trunk/Ohana/src/opihi/cmd.astro/init.c	(revision 39243)
+++ trunk/Ohana/src/opihi/cmd.astro/init.c	(revision 39245)
@@ -9,4 +9,5 @@
 int cneedles                PROTO((int, char **));
 int cplot                   PROTO((int, char **));
+int crotation               PROTO((int, char **));
 int csystem                 PROTO((int, char **));
 int ctimes                  PROTO((int, char **));
@@ -78,4 +79,5 @@
   {1, "cneedles",    cneedles,     "plot vectors in sky coordinates"},
   {1, "cplot",       cplot,        "plot vectors in sky coordinates"},
+  {1, "crotation",   crotation,    "rotate in 3D"},
   {1, "csystem",     csystem,      "convert between coordinate systems"},
   {1, "ctimes",      ctimes,       "convert between time formats"},
Index: trunk/Ohana/src/opihi/cmd.data/gaussdeviate.c
===================================================================
--- trunk/Ohana/src/opihi/cmd.data/gaussdeviate.c	(revision 39243)
+++ trunk/Ohana/src/opihi/cmd.data/gaussdeviate.c	(revision 39245)
@@ -31,4 +31,8 @@
 int gaussintegral (int argc, char **argv) {
   
+  gprint (GP_ERR, "fix gaussintegral\n");
+  return (FALSE);
+
+/*
   int i, Npts;
   Vector *vec;
@@ -53,4 +57,5 @@
   gprint (GP_ERR, "USAGE: gaussintegral Npts mean sigma\n");
   return (FALSE);
+*/
     
 }
