Index: trunk/Ohana/src/opihi/mana/deimos.c
===================================================================
--- trunk/Ohana/src/opihi/mana/deimos.c	(revision 40617)
+++ trunk/Ohana/src/opihi/mana/deimos.c	(revision 40617)
@@ -0,0 +1,32 @@
+# include "data.h"
+
+int deimos_list (int argc, char **argv);
+
+static Command book_commands[] = {
+  {1, "list",     book_list,     "list books"},
+};
+
+int book_command (int argc, char **argv) {
+
+  int i, N, status;
+
+  if (argc < 2) {
+    gprint (GP_ERR, "USAGE: book (command)\n");
+    gprint (GP_ERR, "    book list                                  : list books\n");
+    return (FALSE);
+  }
+
+  N = sizeof (book_commands) / sizeof (Command);
+
+  /* find the book sub-command which matches */
+  for (i = 0; i < N; i++) {
+    if (!strcmp (book_commands[i].name, argv[1])) {
+      status = (*book_commands[i].func) (argc - 1, argv + 1);
+      return (status);
+    }
+  }
+
+  gprint (GP_ERR, "unknown book command %s\n", argv[1]);
+  return (FALSE);
+}
+
Index: trunk/Ohana/src/opihi/mana/deimos_commands.c
===================================================================
--- trunk/Ohana/src/opihi/mana/deimos_commands.c	(revision 40617)
+++ trunk/Ohana/src/opihi/mana/deimos_commands.c	(revision 40617)
@@ -0,0 +1,50 @@
+# include "data.h"
+
+int deimos_mkslit (int argc, char **argv) {
+  OHANA_UNUSED_PARAM(argv);
+  if (argc != 5) {
+    gprint (GP_ERR, "USAGE: deimos mkslit (profile) (trace) (flux) (buffer)\n");
+    return FALSE;
+  }
+
+  // generate model observed flux given a uniformly illuminated slit
+
+  // input parameters:
+  //   slit profile response : vector of fractional flux vs x-coord
+  //   trace                 : spline fit of slit central x pos vs y-coord
+  //   flux                  : vector of input signal vs y-coord
+
+  Vector *profile = NULL;
+  Vector *flux = NULL;
+  Spline *trace = NULL;
+  Buffer *buff = NULL;
+
+  // XXX I probably should rename FindSpline as SelectSpline and give it the same behavior
+  if ((profile = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((trace   = FindSpline (argv[2])) == NULL) return (FALSE);
+  if ((flux    = SelectVector (argv[3], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((buff    = SelectBuffer (argv[4], ANYBUFFER, TRUE)) == NULL) return (FALSE);
+  
+  // define the output window
+  int Nx = 2*profile[0].Nelements;
+  int Ny = flux[0].Nelements;
+  
+  ResetBuffer (buff, Nx, Ny, -32, 0.0, 1.0);
+  
+
+  // loop over the y positions
+  for (iy = 0; iy < flux->Nelements; iy++) {
+
+    // evaluate the trace spline at this y-coord to find the x-coord of the profile center
+    opihi_flt dx = spline_apply_dbl (trace->xk, trace->yk, trace->y2, trace->Nknots, iy);
+    
+    // interpolate the profile with offset of dx
+    for (ix = 0; ix < profile->Nelements; ix++) {
+      // interpolate from profile->elements.Flt[ix], interpolate from profile->elements.Flt[ix+1] to ix+dx
+    }
+
+  }
+
+  return TRUE;
+}
+
