Index: /trunk/Ohana/src/opihi/cmd.astro/cdensify.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.astro/cdensify.c	(revision 41514)
+++ /trunk/Ohana/src/opihi/cmd.astro/cdensify.c	(revision 41515)
@@ -144,7 +144,5 @@
 
     float F = 1.0;
-    if (vv) {
-      F = isFloatScale ? Fs[i] : Is[i];
-    }
+    if (vv) { F = isFloatScale ? Fs[i] : Is[i]; }
 
     switch (PSFTYPE) {
Index: /trunk/Ohana/src/opihi/cmd.astro/cgrid.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.astro/cgrid.c	(revision 41514)
+++ /trunk/Ohana/src/opihi/cmd.astro/cgrid.c	(revision 41515)
@@ -40,5 +40,5 @@
   OnPic = FALSE;							\
   First = TRUE;								\
-  for (d = firstDEC; (d < 90 + dD) && (LOnPic || NorthPole || SouthPole); d += dD) { \
+  for (d = firstDEC; (d < 90 + dD) && (LOnPic || NorthPole || SouthPole || InvalidCorner); d += dD) { \
     D = MAX (-90, MIN(90, d));						\
     ADD_COORDINATE((RA), D);						\
@@ -47,5 +47,5 @@
   First = TRUE;								\
   LOnPic = TRUE;							\
-  for (d = firstDEC; (d > -90 - dD) && (LOnPic || NorthPole || SouthPole); d -= dD) { \
+  for (d = firstDEC; (d > -90 - dD) && (LOnPic || NorthPole || SouthPole || InvalidCorner); d -= dD) { \
     D = MAX (-90, MIN(90, d));						\
     ADD_COORDINATE((RA), D);						\
@@ -59,5 +59,5 @@
   First = TRUE;								\
   lastRA = graphmode.coords.crval1 + 180.0;				\
-  for (r = firstRA; (r < lastRA + dR) && (LOnPic || NorthPole || SouthPole); r += dR) { \
+  for (r = firstRA; (r < lastRA + dR) && (LOnPic || NorthPole || SouthPole || InvalidCorner); r += dR) { \
     R = MIN (r, lastRA);					\
     ADD_COORDINATE(R, D);						\
@@ -67,5 +67,5 @@
   LOnPic = TRUE;							\
   lastRA = graphmode.coords.crval1 - 180.0;				\
-  for (r = firstRA; (r > lastRA - dR) && (LOnPic || NorthPole || SouthPole); r -= dR) { \
+  for (r = firstRA; (r > lastRA - dR) && (LOnPic || NorthPole || SouthPole || InvalidCorner); r -= dR) { \
     R = MAX (r, lastRA);					\
     ADD_COORDINATE(R, D);						\
@@ -167,6 +167,18 @@
     SouthPole = TRUE;
 
+  // PSEUDOCYL modes need center R,D to be 0,0 and center pixel to be adjusted
+  OhanaProjection proj = GetProjection (graphmode.coords.ctype);
+  OhanaProjectionMode mode = GetProjectionMode (proj);
+  int InvalidCorner = FALSE;
+  if (mode == PROJ_MODE_PSEUDOCYL) {
+    // for PSEUDOCYL, the ra range is 360 if the corners are invalid 
+    InvalidCorner |= XY_to_RD (&r, &d, graphmode.xmin, graphmode.ymin, &graphmode.coords); 
+    InvalidCorner |= XY_to_RD (&r, &d, graphmode.xmax, graphmode.ymin, &graphmode.coords); 
+    InvalidCorner |= XY_to_RD (&r, &d, graphmode.xmax, graphmode.ymax, &graphmode.coords); 
+    InvalidCorner |= XY_to_RD (&r, &d, graphmode.xmin, graphmode.ymax, &graphmode.coords); 
+  }    
+
   range = MIN (fabs(graphmode.coords.cdelt1*(graphmode.xmax-graphmode.xmin)), fabs(graphmode.coords.cdelt2*(graphmode.ymax-graphmode.ymin)));
-  if (NorthPole || SouthPole) range = 360;
+  if (NorthPole || SouthPole || InvalidCorner) range = 360;
   dR = range * GRID_SPACING;
   dD = range * GRID_SPACING;
Index: /trunk/Ohana/src/opihi/cmd.astro/coords.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.astro/coords.c	(revision 41514)
+++ /trunk/Ohana/src/opihi/cmd.astro/coords.c	(revision 41515)
@@ -7,9 +7,9 @@
   int i, mode, form, N, Quiet;
   double Xin, Yin, Xout, Yout;
-  char *MOSAIC;
   Coords coords, moscoords;
   Buffer *buf, *mosbuffer;
   Vector *xvec = NULL;
   Vector *yvec = NULL;
+  char *MOSAIC = NULL;
 
   if ((N = get_argument (argc, argv, "-copy"))) {
@@ -36,5 +36,4 @@
   }
 
-  MOSAIC = NULL;
   if ((N = get_argument (argc, argv, "-mosaic"))) {
     remove_argument (N, &argc, argv);
Index: /trunk/Ohana/src/opihi/cmd.astro/region.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.astro/region.c	(revision 41514)
+++ /trunk/Ohana/src/opihi/cmd.astro/region.c	(revision 41515)
@@ -165,14 +165,39 @@
 got_ctype:
   
-  graphmode.coords.crval1 = Ra;
-  graphmode.coords.crval2 = Dec;
-
-  float pc1_1 = (graphmode.flipeast)  ? -1 : 1;
-  float pc2_2 = (graphmode.flipnorth) ? -1 : 1;
-
-  graphmode.coords.pc1_1 =  cos(Angle*RAD_DEG)*pc1_1;
-  graphmode.coords.pc1_2 =  sin(Angle*RAD_DEG)*pc2_2;
-  graphmode.coords.pc2_1 = -sin(Angle*RAD_DEG)*pc1_1;
-  graphmode.coords.pc2_2 =  cos(Angle*RAD_DEG)*pc2_2;
+  // set the rotation
+  {
+    float pc1_1 = (graphmode.flipeast)  ? -1 : 1;
+    float pc2_2 = (graphmode.flipnorth) ? -1 : 1;
+
+    graphmode.coords.pc1_1 =  cos(Angle*RAD_DEG)*pc1_1;
+    graphmode.coords.pc1_2 =  sin(Angle*RAD_DEG)*pc2_2;
+    graphmode.coords.pc2_1 = -sin(Angle*RAD_DEG)*pc1_1;
+    graphmode.coords.pc2_2 =  cos(Angle*RAD_DEG)*pc2_2;
+  }
+
+  // determine central pixel for projection:
+  {
+    // PSEUDOCYL modes need center R,D to be 0,0 and center pixel to be adjusted
+    OhanaProjection proj = GetProjection (graphmode.coords.ctype);
+    OhanaProjectionMode mode = GetProjectionMode (proj);
+
+    graphmode.coords.crpix1 = 0.0;
+    graphmode.coords.crpix2 = 0.0;
+
+    if (mode == PROJ_MODE_PSEUDOCYL) {
+      graphmode.coords.crval1 = Ra;
+      graphmode.coords.crval2 = 0.0;
+    } else {
+      graphmode.coords.crval1 = Ra;
+      graphmode.coords.crval2 = Dec;
+    }
+
+    if (mode == PROJ_MODE_PSEUDOCYL) {
+      double Xc, Yc;
+      RD_to_XY (&Xc, &Yc, Ra, Dec, &graphmode.coords);
+      graphmode.coords.crpix2 = -Yc;
+      fprintf (stderr, "center pixel is %f, %f\n", Xc, Yc);
+    }
+  }
 
   // ask kapa for coordinate limits, to get the right aspect ratio 
