Index: /branches/eam_branches/ipp-20151113/Ohana/src/opihi/cmd.astro/Makefile
===================================================================
--- /branches/eam_branches/ipp-20151113/Ohana/src/opihi/cmd.astro/Makefile	(revision 39182)
+++ /branches/eam_branches/ipp-20151113/Ohana/src/opihi/cmd.astro/Makefile	(revision 39183)
@@ -74,4 +74,5 @@
 $(SRC)/vshimage.$(ARCH).o         \
 $(SRC)/shimage.$(ARCH).o         \
+$(SRC)/wcs.$(ARCH).o         \
 $(SRC)/imsub.$(ARCH).o		   \
 $(SRC)/imfit.$(ARCH).o		   \
Index: /branches/eam_branches/ipp-20151113/Ohana/src/opihi/cmd.astro/init.c
===================================================================
--- /branches/eam_branches/ipp-20151113/Ohana/src/opihi/cmd.astro/init.c	(revision 39182)
+++ /branches/eam_branches/ipp-20151113/Ohana/src/opihi/cmd.astro/init.c	(revision 39183)
@@ -64,4 +64,5 @@
 int vshimage                PROTO((int, char **));
 int shimage                 PROTO((int, char **));
+int wcs                     PROTO((int, char **));
 
 static Command cmds[] = {  
@@ -127,4 +128,5 @@
   {1, "vshimage",    vshimage,     "generate images for vector spherical harmonic terms"},
   {1, "shimage",     shimage,      "generate images for spherical harmonic terms"},
+  {1, "wcs",         wcs,          "set the wcs for the given image"},
 }; 
 
Index: /branches/eam_branches/ipp-20151113/Ohana/src/opihi/cmd.astro/region.c
===================================================================
--- /branches/eam_branches/ipp-20151113/Ohana/src/opihi/cmd.astro/region.c	(revision 39182)
+++ /branches/eam_branches/ipp-20151113/Ohana/src/opihi/cmd.astro/region.c	(revision 39183)
@@ -83,5 +83,5 @@
   if ((argc != 4) && (argc != 5)) {
     gprint (GP_ERR, "USAGE: region Ra Dec Radius [projection] [orientation]\n");
-    gprint (GP_ERR, "  [-image] [-ew] [+ew] [-ns] [+ns] [-no-clear]\n");
+    gprint (GP_ERR, "  [-image] [-ew] [+ew] [-ns] [+ns] [-no-clear] [-angle theta]\n");
     gprint (GP_ERR, " current: %f %f (%f x %f) (%s)\n", 
 	     graphmode.coords.crval1, graphmode.coords.crval2, 
Index: /branches/eam_branches/ipp-20151113/Ohana/src/opihi/cmd.astro/wcs.c
===================================================================
--- /branches/eam_branches/ipp-20151113/Ohana/src/opihi/cmd.astro/wcs.c	(revision 39183)
+++ /branches/eam_branches/ipp-20151113/Ohana/src/opihi/cmd.astro/wcs.c	(revision 39183)
@@ -0,0 +1,93 @@
+# include "astro.h"
+
+int wcs (int argc, char **argv) {
+  
+  int N;
+
+  int flipeast = TRUE;
+  if ((N = get_argument (argc, argv, "-ew"))) {
+    remove_argument (N, &argc, argv);
+    flipeast = TRUE;
+  }
+  if ((N = get_argument (argc, argv, "+ew"))) {
+    remove_argument (N, &argc, argv);
+    flipeast = FALSE;
+  }
+
+  int flipnorth = FALSE;
+  if ((N = get_argument (argc, argv, "-ns"))) {
+    remove_argument (N, &argc, argv);
+    flipnorth = TRUE;
+  }
+  if ((N = get_argument (argc, argv, "+ns"))) {
+    remove_argument (N, &argc, argv);
+    flipnorth = FALSE;
+  }
+
+  float Angle = 0.0;
+  if ((N = get_argument (argc, argv, "-angle"))) {
+    remove_argument (N, &argc, argv);
+    Angle = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if ((argc != 4) && (argc != 5)) {
+    gprint (GP_ERR, "USAGE: wcs (buffer) Ra Dec platescale [projection] [orientation]\n");
+    gprint (GP_ERR, "  [-ew] [+ew] [-ns] [+ns] [-angle theta]\n");
+    return (FALSE);
+  }
+  
+  double Ra, Dec;
+  if (!ohana_str_to_radec (&Ra, &Dec, argv[2], argv[3])) return (FALSE);
+  float platescale = atof (argv[4]); // arcsec per pixel
+
+  Buffer *buf = NULL;
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) {
+    gprint (GP_ERR, "cannot define buffer %s\n", argv[1]);
+    return FALSE;
+  }
+
+  Coords coords;
+  InitCoords (&coords, "DEC--TAN");
+
+  if (argc == 6) {
+    if (!strcasecmp (argv[5], "TAN")) 
+      strcpy (coords.ctype, "DEC--TAN");
+    if (!strcasecmp (argv[5], "SIN")) 
+      strcpy (coords.ctype, "DEC--SIN");
+    if (!strcasecmp (argv[5], "ARC")) 
+      strcpy (coords.ctype, "DEC--ARC");
+    if (!strcasecmp (argv[5], "STG")) 
+      strcpy (coords.ctype, "DEC--STG");
+    if (!strcasecmp (argv[5], "ZEA"))
+      strcpy (coords.ctype, "DEC--ZEA");
+    if (!strcasecmp (argv[5], "AIT")) 
+      strcpy (coords.ctype, "DEC--AIT");
+    if (!strcasecmp (argv[5], "GLS")) 
+      strcpy (coords.ctype, "DEC--GLS");
+    if (!strcasecmp (argv[5], "PAR")) 
+      strcpy (coords.ctype, "DEC--PAR");
+  }
+  
+  coords.crval1 = Ra;
+  coords.crval2 = Dec;
+
+  // reference pixel is the image center
+  coords.crpix1 = 0.5 * buf[0].header.Naxis[0]; // Ohana / IPP center of a pixel is X.5,X.5
+  coords.crpix2 = 0.5 * buf[0].header.Naxis[1]; // Ohana / IPP center of a pixel is X.5,X.5
+
+  float pc1_1 = flipeast  ? -1 : 1;
+  float pc2_2 = flipnorth ? -1 : 1;
+
+  coords.pc1_1 =  cos(Angle*RAD_DEG)*pc1_1;
+  coords.pc1_2 =  sin(Angle*RAD_DEG)*pc2_2;
+  coords.pc2_1 = -sin(Angle*RAD_DEG)*pc1_1;
+  coords.pc2_2 =  cos(Angle*RAD_DEG)*pc2_2;
+
+  coords.cdelt1 = platescale / 3600.0;
+  coords.cdelt2 = platescale / 3600.0;
+
+  PutCoords (&coords, &buf[0].header);
+  return (TRUE);
+}
+
Index: /branches/eam_branches/ipp-20151113/Ohana/src/opihi/dvo/imlist.c
===================================================================
--- /branches/eam_branches/ipp-20151113/Ohana/src/opihi/dvo/imlist.c	(revision 39182)
+++ /branches/eam_branches/ipp-20151113/Ohana/src/opihi/dvo/imlist.c	(revision 39183)
@@ -21,4 +21,14 @@
   }
 
+  int VERBOSE = TRUE;
+  if ((N = get_argument (argc, argv, "-quiet"))) {
+    VERBOSE = FALSE;
+    remove_argument (N, &argc, argv);
+  }
+  if ((N = get_argument (argc, argv, "-q"))) {
+    VERBOSE = FALSE;
+    remove_argument (N, &argc, argv);
+  }
+
   TimeSelect = FALSE;
   if ((N = get_argument (argc, argv, "-time"))) {
@@ -35,5 +45,5 @@
     remove_argument (N, &argc, argv);
     TimeSelect = TRUE;
-    gprint (GP_ERR, "plotting in range %ds - %ds (%f seconds)\n", (int)tzero, (int)(tzero + trange), trange);
+    if (VERBOSE) gprint (GP_ERR, "plotting in range %ds - %ds (%f seconds)\n", (int)tzero, (int)(tzero + trange), trange);
   }
 
@@ -88,4 +98,6 @@
   GetTimeFormat (&TimeReference, &TimeFormat);
 
+  int Nfound = 0;
+
   for (j = 0; j < MAX_LIST; j++) {
     i = subset[j];
@@ -104,7 +116,13 @@
       XY_to_RD (&r, &d, 0.5*image[i].NX, 0.5*image[i].NY, &image[i].coords);
     }
-    gprint (GP_LOG, "%3lld %s %8lld %8.4f %8.4f %f %5d %2d %4.2f %5.3f %5.3f\n", 
-	    (long long) i, image[i].name, (long long) image[i].imageID, r, d, t, image[i].nstar, image[i].photcode, image[i].secz, image[i].Mcal, image[i].dMcal);
+    if (VERBOSE) gprint (GP_LOG, "%3lld %s %8lld %8.4f %8.4f %f %5d %2d %4.2f %5.3f %5.3f\n", 
+			 (long long) i, image[i].name, (long long) image[i].imageID, r, d, t, image[i].nstar, image[i].photcode, image[i].secz, image[i].Mcal, image[i].dMcal);
+
+    char name[80];
+    sprintf (name, "imlist:%d", Nfound);
+    set_str_variable (name, image[i].name);
+    Nfound ++;
   }
+  set_int_variable ("imlist:n", Nfound);
 
   FreeImagesDVO(image);
