Index: /branches/eam_branches/ipp-20120905/Ohana/src/opihi/cmd.data/Makefile
===================================================================
--- /branches/eam_branches/ipp-20120905/Ohana/src/opihi/cmd.data/Makefile	(revision 34523)
+++ /branches/eam_branches/ipp-20120905/Ohana/src/opihi/cmd.data/Makefile	(revision 34524)
@@ -114,6 +114,6 @@
 $(SRC)/shift.$(ARCH).o		\
 $(SRC)/sort.$(ARCH).o		\
-$(SRC)/spline_apply.$(ARCH).o	\
-$(SRC)/spline_construct.$(ARCH).o \
+$(SRC)/imspline_apply.$(ARCH).o	\
+$(SRC)/imspline_construct.$(ARCH).o \
 $(SRC)/imstats.$(ARCH).o	   \
 $(SRC)/style.$(ARCH).o		   \
Index: /branches/eam_branches/ipp-20120905/Ohana/src/opihi/cmd.data/imspline_apply.c
===================================================================
--- /branches/eam_branches/ipp-20120905/Ohana/src/opihi/cmd.data/imspline_apply.c	(revision 34524)
+++ /branches/eam_branches/ipp-20120905/Ohana/src/opihi/cmd.data/imspline_apply.c	(revision 34524)
@@ -0,0 +1,98 @@
+# include "data.h"
+
+// need to rename this as an image function
+int imspline_apply (int argc, char **argv) {
+  
+  int i, j, I, J;
+  int nx, ny, Nx, Ny;
+  float rx, ry, x, y;
+  float *Tx1, *Tx2, *Txc, *Ty1, *Ty2, *Tyc, *V, *V1, *V2;
+  Buffer *out, *y1, *y2;
+
+  if (argc != 7) {
+    gprint (GP_ERR, "USAGE: imspline_apply <Y> <Y2> <out> (x/y) Nx Ny\n");
+    return (FALSE);
+  }
+
+  if ((y1  = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  if ((y2  = SelectBuffer (argv[2], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  if ((out = SelectBuffer (argv[3], ANYBUFFER, TRUE)) == NULL) return (FALSE);
+
+  // xdir = FALSE;
+  // if (!strcmp (argv[4], "x")) xdir = TRUE; 
+
+  nx = atoi (argv[5]);
+  ny = atoi (argv[6]);
+
+  Nx = y1[0].matrix.Naxis[0];
+  Ny = y1[0].matrix.Naxis[1];
+
+  rx = Nx / (float) nx;
+  ry = Ny / (float) ny;
+
+  /* create an output matrix buffer with desired nx, ny */
+  gfits_free_matrix (&out[0].matrix);
+  gfits_free_header (&out[0].header);
+
+  out[0].bitpix = y1[0].bitpix;
+  out[0].unsign = y1[0].unsign;
+  out[0].bscale = y1[0].bscale;
+  out[0].bzero  = y1[0].bzero;
+  gfits_copy_header (&y1[0].header, &out[0].header);
+  gfits_modify (&out[0].header, "NAXIS1", "%d", 1, nx);
+  gfits_modify (&out[0].header, "NAXIS2", "%d", 1, ny);
+
+  out[0].header.Naxis[0] = nx;
+  out[0].header.Naxis[1] = ny;
+  gfits_create_matrix (&out[0].header, &out[0].matrix);
+  if ((y1[0].file[0] != '*') && (y1[0].file[0] != '(')) {
+    sprintf (out[0].file, "*%s", y1[0].file);
+  } else {
+    sprintf (out[0].file, "%s", y1[0].file);
+  }
+
+  ALLOCATE (Ty2, float, Ny);
+  ALLOCATE (Ty1, float, Ny);
+  ALLOCATE (Tyc, float, Ny);
+  for (i = 0; i < Ny; i++) { Tyc[i] = i; }
+
+  ALLOCATE (Tx1, float, Nx);
+  ALLOCATE (Tx2, float, Nx);
+  ALLOCATE (Txc, float, Nx);
+  for (i = 0; i < Nx; i++) { Txc[i] = i; }
+
+  V = (float *)(out[0].matrix.buffer);
+
+  for (J = 0; J < ny; J++) {
+    y = J * ry;
+
+    /* construct spline for each element in this row */
+    for (i = 0; i < Nx; i++) {
+      V1 = (float *)(y1[0].matrix.buffer) + i;
+      V2 = (float *)(y2[0].matrix.buffer) + i;
+      for (j = 0; j < Ny; j++, V1+=Nx, V2+=Nx) {
+	Ty1[j] = *V1;
+	Ty2[j] = *V2;
+      }
+      Tx1[i] = spline_apply_flt (Tyc, Ty1, Ty2, Ny, y);
+    }
+    spline_construct_flt (Txc, Tx1, Nx, Tx2);
+
+    /* apply x-dir spline to new image */
+    for (I = 0; I < nx; I++, V++) {
+      x = I * rx;
+      *V = spline_apply_flt (Txc, Tx1, Tx2, Nx, x);
+    }
+  }
+
+  free (Ty1);
+  free (Ty2);
+  free (Tyc);
+  
+  free (Tx1);
+  free (Tx2);
+  free (Txc);
+  
+  return (TRUE);
+
+}
Index: /branches/eam_branches/ipp-20120905/Ohana/src/opihi/cmd.data/imspline_construct.c
===================================================================
--- /branches/eam_branches/ipp-20120905/Ohana/src/opihi/cmd.data/imspline_construct.c	(revision 34524)
+++ /branches/eam_branches/ipp-20120905/Ohana/src/opihi/cmd.data/imspline_construct.c	(revision 34524)
@@ -0,0 +1,72 @@
+# include "data.h"
+
+// need to rename this as an image function
+int imspline_construct (int argc, char **argv) {
+  
+  int i, j, Nx, Ny;
+  float *Tx, *Ty, *Ty2, *V;
+  Buffer *in, *out;
+
+  if (argc != 4) {
+    gprint (GP_ERR, "USAGE: imspline_construct <in> <out> (x/y)\n");
+    return (FALSE);
+  }
+
+  if ((in  = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  if ((out = SelectBuffer (argv[2], ANYBUFFER, TRUE)) == NULL) return (FALSE);
+
+  // XXX move this to gfits_create_matrix
+  free (out[0].matrix.buffer);
+  if ((in[0].file[0] != '*') && (in[0].file[0] != '(')) {
+    sprintf (out[0].file, "*%s", in[0].file);
+  } else {
+    sprintf (out[0].file, "%s", in[0].file);
+  }
+  out[0].bitpix = in[0].bitpix;
+  out[0].unsign = in[0].unsign;
+  out[0].bscale = in[0].bscale;
+  out[0].bzero  = in[0].bzero;
+  gfits_copy_matrix_info (&in[0].matrix, &out[0].matrix);
+  gfits_copy_header (&in[0].header, &out[0].header);
+  gfits_create_matrix (&out[0].header, &out[0].matrix);
+
+  // int xdir = FALSE;
+  // if (!strcmp (argv[3], "x")) xdir = TRUE; 
+  /* ideally, the resulting image should carry this info (in header?) */
+
+  Nx = in[0].matrix.Naxis[0];
+  Ny = in[0].matrix.Naxis[1];
+
+  ALLOCATE (Ty2, float, Ny);
+  ALLOCATE (Ty, float, Ny);
+  ALLOCATE (Tx, float, Ny);
+
+  /** for now only perform the operation for the ydir splines */
+
+  /* construct coordinate vector */
+  for (j = 0; j < Ny; j++) { Tx[j] = j; }
+  
+  for (i = 0; i < Nx; i++) {
+    
+    /* construct temp vector with values to spline */
+    V = (float *)(in[0].matrix.buffer) + i;
+    for (j = 0; j < Ny; j++, V+=Nx) {
+      Ty[j] = *V;
+    }
+  
+    spline_construct_flt (Tx, Ty, Ny, Ty2);
+  
+    /* copy derivatives to output buffer */
+    V = (float *)(out[0].matrix.buffer) + i;
+    for (j = 0; j < Ny; j++, V+=Nx) {
+      *V = Ty2[j];
+    }
+  }
+
+  free (Tx);
+  free (Ty);
+  free (Ty2);
+  
+  return (TRUE);
+
+}
Index: /branches/eam_branches/ipp-20120905/Ohana/src/opihi/cmd.data/init.c
===================================================================
--- /branches/eam_branches/ipp-20120905/Ohana/src/opihi/cmd.data/init.c	(revision 34523)
+++ /branches/eam_branches/ipp-20120905/Ohana/src/opihi/cmd.data/init.c	(revision 34524)
@@ -102,6 +102,6 @@
 int shift            PROTO((int, char **));
 int sort_vectors     PROTO((int, char **));
-int spline_apply_cmd PROTO((int, char **));
-int spline_construct_cmd PROTO((int, char **));
+int imspline_apply   PROTO((int, char **));
+int imspline_construct PROTO((int, char **));
 int stats            PROTO((int, char **));
 int imstats          PROTO((int, char **));
@@ -254,6 +254,6 @@
   {1, "shift",        shift,            "shift data in an image"},
   {1, "sort",         sort_vectors,     "sort list of vectors"},
-  {1, "spline.apply", spline_apply_cmd, "apply spline fit to generate an image"},
-  {1, "spline.const", spline_construct_cmd, "create spline 2nd deriv. terms"},
+  {1, "imspline.apply", imspline_apply, "apply spline fit to generate an image"},
+  {1, "imspline.const", imspline_construct, "create spline 2nd deriv. terms"},
   {1, "stats",        imstats,          "statistics on a portion of an image"},
   {1, "style",        style,            "set the style for graph plots"},
Index: anches/eam_branches/ipp-20120905/Ohana/src/opihi/cmd.data/spline_apply.c
===================================================================
--- /branches/eam_branches/ipp-20120905/Ohana/src/opihi/cmd.data/spline_apply.c	(revision 34523)
+++ 	(revision )
@@ -1,98 +1,0 @@
-# include "data.h"
-
-// need to rename this as an image function
-int imspline_apply (int argc, char **argv) {
-  
-  int i, j, I, J;
-  int nx, ny, Nx, Ny;
-  float rx, ry, x, y;
-  float *Tx1, *Tx2, *Txc, *Ty1, *Ty2, *Tyc, *V, *V1, *V2;
-  Buffer *out, *y1, *y2;
-
-  if (argc != 7) {
-    gprint (GP_ERR, "USAGE: imspline_apply <Y> <Y2> <out> (x/y) Nx Ny\n");
-    return (FALSE);
-  }
-
-  if ((y1  = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
-  if ((y2  = SelectBuffer (argv[2], OLDBUFFER, TRUE)) == NULL) return (FALSE);
-  if ((out = SelectBuffer (argv[3], ANYBUFFER, TRUE)) == NULL) return (FALSE);
-
-  // xdir = FALSE;
-  // if (!strcmp (argv[4], "x")) xdir = TRUE; 
-
-  nx = atoi (argv[5]);
-  ny = atoi (argv[6]);
-
-  Nx = y1[0].matrix.Naxis[0];
-  Ny = y1[0].matrix.Naxis[1];
-
-  rx = Nx / (float) nx;
-  ry = Ny / (float) ny;
-
-  /* create an output matrix buffer with desired nx, ny */
-  gfits_free_matrix (&out[0].matrix);
-  gfits_free_header (&out[0].header);
-
-  out[0].bitpix = y1[0].bitpix;
-  out[0].unsign = y1[0].unsign;
-  out[0].bscale = y1[0].bscale;
-  out[0].bzero  = y1[0].bzero;
-  gfits_copy_header (&y1[0].header, &out[0].header);
-  gfits_modify (&out[0].header, "NAXIS1", "%d", 1, nx);
-  gfits_modify (&out[0].header, "NAXIS2", "%d", 1, ny);
-
-  out[0].header.Naxis[0] = nx;
-  out[0].header.Naxis[1] = ny;
-  gfits_create_matrix (&out[0].header, &out[0].matrix);
-  if ((y1[0].file[0] != '*') && (y1[0].file[0] != '(')) {
-    sprintf (out[0].file, "*%s", y1[0].file);
-  } else {
-    sprintf (out[0].file, "%s", y1[0].file);
-  }
-
-  ALLOCATE (Ty2, float, Ny);
-  ALLOCATE (Ty1, float, Ny);
-  ALLOCATE (Tyc, float, Ny);
-  for (i = 0; i < Ny; i++) { Tyc[i] = i; }
-
-  ALLOCATE (Tx1, float, Nx);
-  ALLOCATE (Tx2, float, Nx);
-  ALLOCATE (Txc, float, Nx);
-  for (i = 0; i < Nx; i++) { Txc[i] = i; }
-
-  V = (float *)(out[0].matrix.buffer);
-
-  for (J = 0; J < ny; J++) {
-    y = J * ry;
-
-    /* construct spline for each element in this row */
-    for (i = 0; i < Nx; i++) {
-      V1 = (float *)(y1[0].matrix.buffer) + i;
-      V2 = (float *)(y2[0].matrix.buffer) + i;
-      for (j = 0; j < Ny; j++, V1+=Nx, V2+=Nx) {
-	Ty1[j] = *V1;
-	Ty2[j] = *V2;
-      }
-      Tx1[i] = spline_apply_flt (Tyc, Ty1, Ty2, Ny, y);
-    }
-    spline_construct_flt (Txc, Tx1, Nx, Tx2);
-
-    /* apply x-dir spline to new image */
-    for (I = 0; I < nx; I++, V++) {
-      x = I * rx;
-      *V = spline_apply_flt (Txc, Tx1, Tx2, Nx, x);
-    }
-  }
-
-  free (Ty1);
-  free (Ty2);
-  free (Tyc);
-  
-  free (Tx1);
-  free (Tx2);
-  free (Txc);
-  
-  return (TRUE);
-
-}
Index: anches/eam_branches/ipp-20120905/Ohana/src/opihi/cmd.data/spline_construct.c
===================================================================
--- /branches/eam_branches/ipp-20120905/Ohana/src/opihi/cmd.data/spline_construct.c	(revision 34523)
+++ 	(revision )
@@ -1,72 +1,0 @@
-# include "data.h"
-
-// need to rename this as an image function
-int imspline_construct (int argc, char **argv) {
-  
-  int i, j, Nx, Ny;
-  float *Tx, *Ty, *Ty2, *V;
-  Buffer *in, *out;
-
-  if (argc != 4) {
-    gprint (GP_ERR, "USAGE: imspline_construct <in> <out> (x/y)\n");
-    return (FALSE);
-  }
-
-  if ((in  = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
-  if ((out = SelectBuffer (argv[2], ANYBUFFER, TRUE)) == NULL) return (FALSE);
-
-  // XXX move this to gfits_create_matrix
-  free (out[0].matrix.buffer);
-  if ((in[0].file[0] != '*') && (in[0].file[0] != '(')) {
-    sprintf (out[0].file, "*%s", in[0].file);
-  } else {
-    sprintf (out[0].file, "%s", in[0].file);
-  }
-  out[0].bitpix = in[0].bitpix;
-  out[0].unsign = in[0].unsign;
-  out[0].bscale = in[0].bscale;
-  out[0].bzero  = in[0].bzero;
-  gfits_copy_matrix_info (&in[0].matrix, &out[0].matrix);
-  gfits_copy_header (&in[0].header, &out[0].header);
-  gfits_create_matrix (&out[0].header, &out[0].matrix);
-
-  // int xdir = FALSE;
-  // if (!strcmp (argv[3], "x")) xdir = TRUE; 
-  /* ideally, the resulting image should carry this info (in header?) */
-
-  Nx = in[0].matrix.Naxis[0];
-  Ny = in[0].matrix.Naxis[1];
-
-  ALLOCATE (Ty2, float, Ny);
-  ALLOCATE (Ty, float, Ny);
-  ALLOCATE (Tx, float, Ny);
-
-  /** for now only perform the operation for the ydir splines */
-
-  /* construct coordinate vector */
-  for (j = 0; j < Ny; j++) { Tx[j] = j; }
-  
-  for (i = 0; i < Nx; i++) {
-    
-    /* construct temp vector with values to spline */
-    V = (float *)(in[0].matrix.buffer) + i;
-    for (j = 0; j < Ny; j++, V+=Nx) {
-      Ty[j] = *V;
-    }
-  
-    spline_construct_flt (Tx, Ty, Ny, Ty2);
-  
-    /* copy derivatives to output buffer */
-    V = (float *)(out[0].matrix.buffer) + i;
-    for (j = 0; j < Ny; j++, V+=Nx) {
-      *V = Ty2[j];
-    }
-  }
-
-  free (Tx);
-  free (Ty);
-  free (Ty2);
-  
-  return (TRUE);
-
-}
