Index: trunk/Ohana/src/opihi/cmd.astro/coords.c
===================================================================
--- trunk/Ohana/src/opihi/cmd.astro/coords.c	(revision 3144)
+++ trunk/Ohana/src/opihi/cmd.astro/coords.c	(revision 3393)
@@ -1,3 +1,5 @@
 # include "astro.h"
+
+enum {NONE, SKY, PIXEL};
 
 int coords (int argc, char **argv) {
@@ -5,8 +7,16 @@
   int mode, N;
   double X, Y, R, D;
-  Coords coords;
-  Buffer *buf;
+  char *MOSAIC;
+  Coords coords, moscoords;
+  Buffer *buf, *mosbuffer;
 
-  mode = 0;
+  MOSAIC = NULL;
+  if ((N = get_argument (argc, argv, "-mosaic"))) {
+    remove_argument (N, &argc, argv);
+    MOSAIC = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  mode = NONE;
   if ((N = get_argument (argc, argv, "-p"))) {
     remove_argument (N, &argc, argv);
@@ -15,11 +25,8 @@
     Y = atof(argv[N]);
     remove_argument (N, &argc, argv);
-    mode = 1;
+    mode = SKY;
   }
   if ((N = get_argument (argc, argv, "-c"))) {
-    if (mode == 1) {
-      fprintf (stderr, "only one of -p or -c can be used\n");
-      return (FALSE);
-    }
+    if (mode == SKY) goto syntax;
     remove_argument (N, &argc, argv);
     R = atof(argv[N]);
@@ -27,29 +34,43 @@
     D = atof(argv[N]);
     remove_argument (N, &argc, argv);
-    mode = 2;
+    mode = PIXEL;
   }
-  if ((mode == 0) || (argc != 2)) {
-    fprintf (stderr, "USAGE: coords [buffer] (-c R D) / (-p X Y)\n");
-    return (FALSE);
-  }    
+  if (mode == NONE) goto syntax;
+  if (argc != 2) goto syntax;
 
-  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) goto escape;
   GetCoords (&coords, &buf[0].header);
+  if (strcmp(&coords.ctype[4], "-WRP")) {
+    if (MOSAIC == NULL) {
+      fprintf (stderr, "must supply mosaic for WRP coords\n");
+      return (FALSE);
+    }
+    if ((mosbuffer = SelectBuffer (MOSAIC, OLDBUFFER, TRUE)) == NULL) goto escape;
+    GetCoords (&moscoords, &mosbuffer[0].header);
+    RegisterMosaic (&moscoords);
+  }
   
-  if (mode == 1) {
+  if (mode == SKY) {
     XY_to_RD (&R, &D, X, Y, &coords);
     fprintf (stderr, "%10.6f %10.6f\n", R, D);
     set_variable ("RA", R);
     set_variable ("DEC", D);
+    return (TRUE);
   }
     
-  if (mode == 2) {
+  if (mode == PIXEL) {
     RD_to_XY (&X, &Y, R, D, &coords);
     fprintf (stderr, "%7.2f %7.2f\n", X, Y);
     set_variable ("Xc", X);
     set_variable ("Yc", Y);
+    return (TRUE);
   }
+  return (FALSE);
 
-  return (TRUE);
-
+ syntax:
+  fprintf (stderr, "USAGE: coords [buffer] (-c R D) / (-p X Y)\n");
+  fprintf (stderr, "only one of -p or -c can be used\n");
+ escape:
+  if (MOSAIC != NULL) free (MOSAIC);
+  return (FALSE);
 }
Index: trunk/Ohana/src/opihi/cmd.astro/drizzle.c
===================================================================
--- trunk/Ohana/src/opihi/cmd.astro/drizzle.c	(revision 3144)
+++ trunk/Ohana/src/opihi/cmd.astro/drizzle.c	(revision 3393)
@@ -1,3 +1,5 @@
 # include "astro.h"
+
+/*** needs mosaic astrometry ***/
 
 static double XO, XX, XY;
