Index: /trunk/Ohana/src/libdvo/src/coordops.c
===================================================================
--- /trunk/Ohana/src/libdvo/src/coordops.c	(revision 8241)
+++ /trunk/Ohana/src/libdvo/src/coordops.c	(revision 8242)
@@ -20,14 +20,15 @@
   type = &coords[0].ctype[4];
   
-  /* DIS is equiv to TAN with higher order terms
-     PLY is cartesian with higher order terms
+  /* PLY is equiv to LIN with higher order terms
+     ZPL is equiv to ZEA with higher order terms
+     DIS is equiv to TAN with higher order terms
      WRP is equiv to PLY, with implied mosaic */
 
-  Polynomial = !strcmp(type, "-PLY") || !strcmp(type, "-DIS") || !strcmp(type, "-WRP");
+  Polynomial = !strcmp(type, "-PLY") || !strcmp(type, "-DIS") || !strcmp(type, "-WRP") || !strcmp(type, "-ZPL");
   Cartesian  = !strcmp(type, "-LIN") || !strcmp(type, "-PLY") || !strcmp(type, "-WRP") || !strcmp(&coords[0].ctype[0], "GENE");
   PseudoCyl  = !strcmp(type, "-AIT") || !strcmp(type, "-GLS") || !strcmp(type, "-PAR");
   Zenith1    = !strcmp(type, "-DIS") || !strcmp(type, "-TAN") || !strcmp(type, "-STG");
   Zenith2    = !strcmp(type, "-SIN") || !strcmp(&coords[0].ctype[0], "MM");
-  Zenithal   = !strcmp(type, "-ZEA") || Zenith1 || Zenith2;
+  Zenithal   = !strcmp(type, "-ZEA") || !strcmp(type, "-ZPL") || Zenith1 || Zenith2;
   if (!Zenithal && !Cartesian && !PseudoCyl) return (FALSE);
 
@@ -90,5 +91,5 @@
       stht = sqrt (1 - ctht*ctht);
     }
-    if (!strcmp(type, "-ZEA")) {
+    if (!strcmp(type, "-ZEA") || !strcmp(type, "-ZPL")) {
       stht = 1 - 0.5*SQ(R*RAD_DEG);
       ctht = sqrt (1 - stht*stht);
@@ -166,10 +167,10 @@
   L = M = 0;
 
-  Polynomial = !strcmp(type, "-PLY") || !strcmp(type, "-DIS") || !strcmp(type, "-WRP");
+  Polynomial = !strcmp(type, "-PLY") || !strcmp(type, "-DIS") || !strcmp(type, "-WRP") || !strcmp(type, "-ZPL");
   Cartesian  = !strcmp(type, "-LIN") || !strcmp(type, "-PLY") || !strcmp(type, "-WRP") || !strcmp(&coords[0].ctype[0], "GENE");
   PseudoCyl  = !strcmp(type, "-AIT") || !strcmp(type, "-GLS") || !strcmp(type, "-PAR");
   Zenith1    = !strcmp(type, "-DIS") || !strcmp(type, "-TAN") || !strcmp(type, "-STG");
   Zenith2    = !strcmp(type, "-SIN") || !strcmp(&coords[0].ctype[0], "MM");
-  Zenithal   = !strcmp(type, "-ZEA") || Zenith1 || Zenith2;
+  Zenithal   = !strcmp(type, "-ZEA") || !strcmp(type, "-ZPL") || Zenith1 || Zenith2;
   if (!Zenithal && !Cartesian && !PseudoCyl) return (FALSE);
 
@@ -209,5 +210,5 @@
       M = -DEG_RAD * cphi;
     }
-    if (!strcmp(type, "-ZEA")) {
+    if (!strcmp(type, "-ZEA") || !strcmp(type, "-ZPL")) {
       Rc = DEG_RAD * M_SQRT2 / sqrt (1 + stht);
       L =  Rc * sphi;
@@ -253,5 +254,5 @@
   /** extra polynomial terms **/
   if (Polynomial) {
-    for (i = 0; i < 3; i++) {
+    for (i = 0; i < 10; i++) {
       Lo = (X*coords[0].pc1_1 + Y*coords[0].pc1_2);
       Mo = (X*coords[0].pc2_1 + Y*coords[0].pc2_2);
@@ -266,7 +267,8 @@
       dL = (L - Lo);
       dM = (M - Mo);
+      // fprintf (stderr, "%d: %f,%f : %f,%f : %f,%f : %f,%f\n", i, L, M, X, Y, Lo, Mo, dL, dM);
 
       X += determ * (coords[0].pc2_2*dL - coords[0].pc1_2*dM);
-      Y += determ * (coords[0].pc1_1*dM - coords[0].pc2_1*dL);
+      Y += determ * (coords[0].pc1_1*dM - coords[0].pc2_1*dM);
     }
   }
