Index: branches/eam_branches/ipp-dev-20210817/psModules/src/astrom/pmAstrometryModel.c
===================================================================
--- branches/eam_branches/ipp-dev-20210817/psModules/src/astrom/pmAstrometryModel.c	(revision 41826)
+++ branches/eam_branches/ipp-dev-20210817/psModules/src/astrom/pmAstrometryModel.c	(revision 41832)
@@ -500,5 +500,5 @@
         int nY = psMetadataLookupS32(&status, row, "NYORDER"); REQUIRE (status, "missing NYORDER");
         if (chip->toFPA == NULL) {
-            chip->toFPA = psPlaneTransformAlloc(nX, nY);
+	    chip->toFPA = psPlaneTransformAlloc(nX, nY, PS_POLYNOMIAL_ORD); // chip->fpa uses ordinary poly
         } else {
             REQUIRE (chip->toFPA->x->nX == nX, "mismatch in chip order");
@@ -569,5 +569,5 @@
         if (file->fpa->toTPA == NULL) {
             // allocate the new transformation
-            file->fpa->toTPA = psPlaneTransformAlloc(nX, nY);
+            file->fpa->toTPA = psPlaneTransformAlloc(nX, nY, PS_POLYNOMIAL_ORD); // fpa->tpa uses ORD
         } else {
             REQUIRE (file->fpa->toTPA->x->nX == nX, "mismatch in chip order");
Index: branches/eam_branches/ipp-dev-20210817/psModules/src/astrom/pmAstrometryUtils.c
===================================================================
--- branches/eam_branches/ipp-dev-20210817/psModules/src/astrom/pmAstrometryUtils.c	(revision 41826)
+++ branches/eam_branches/ipp-dev-20210817/psModules/src/astrom/pmAstrometryUtils.c	(revision 41832)
@@ -131,11 +131,15 @@
 
 // convert a transformation L(x,y) to L'(x-xo,y-yo)
+// is this used for an upward (e.g., chip->fpa) or a downward (fpa->chip) transform?
 psPlaneTransform *psPlaneTransformSetCenter (psPlaneTransform *output, psPlaneTransform *input, double Xo, double Yo)
 {
 
-    // validate fit order
+    // validate fit type:
+    // polynomial in input transforms must match type -- and for now be ORD
+    psAssert (input->x->type == PS_POLYNOMIAL_ORD, "fix for CHEB");
+    psAssert (input->y->type == PS_POLYNOMIAL_ORD, "fix for CHEB");
 
     if (output == NULL) {
-        output = psPlaneTransformAlloc(input->x->nX, input->x->nY);
+        output = psPlaneTransformAlloc(input->x->nX, input->x->nY, PS_POLYNOMIAL_ORD);
     }
 
@@ -180,5 +184,5 @@
 
 // rotate a transformation L(x,y) by theta
-psPlaneTransform *psPlaneTransformRotate (psPlaneTransform *output, psPlaneTransform *input, double theta)
+psPlaneTransform *psPlaneTransformRotate  (psPlaneTransform *output, psPlaneTransform *input, double theta)
 {
     /* given the polynomial transformations:
@@ -192,5 +196,6 @@
 
     if (output == NULL) {
-        output = psPlaneTransformAlloc(input->x->nX, input->x->nY);
+	// generate a new transform using the same order and type as the input
+        output = psPlaneTransformAlloc(input->x->nX, input->x->nY, input->x->type);
     }
 
@@ -227,5 +232,5 @@
 
     // all coeffs and masks initially set to 0
-    transform = psPlaneTransformAlloc (order, order);
+    transform = psPlaneTransformAlloc (order, order, PS_POLYNOMIAL_ORD);
 
     for (int i = 0; i <= order; i++) {
Index: branches/eam_branches/ipp-dev-20210817/psModules/src/astrom/pmAstrometryWCS.c
===================================================================
--- branches/eam_branches/ipp-dev-20210817/psModules/src/astrom/pmAstrometryWCS.c	(revision 41826)
+++ branches/eam_branches/ipp-dev-20210817/psModules/src/astrom/pmAstrometryWCS.c	(revision 41832)
@@ -554,5 +554,5 @@
         // apply the exiting fromTPA transformation to make the new toFPA consistent with the toTPA layter
         // XXX this only works if toTPA is at most a linear transformation
-        psPlaneTransform *toFPAnew = psPlaneTransformAlloc(toFPA->x->nX, toFPA->x->nY);
+        psPlaneTransform *toFPAnew = psPlaneTransformAlloc(toFPA->x->nX, toFPA->x->nY, PS_POLYNOMIAL_ORD);
         for (int i = 0; i <= toFPA->x->nX; i++) {
             for (int j = 0; j <= toFPA->x->nY; j++) {
@@ -656,5 +656,5 @@
       chip->toFPA = psPlaneTransformSetCenter (NULL, wcs->trans, -wcs->crpix1, -wcs->crpix2);
     } else {
-      chip->toFPA = psPlaneTransformAlloc(wcs->trans->x->nX, wcs->trans->x->nY);
+      chip->toFPA = psPlaneTransformAlloc(wcs->trans->x->nX, wcs->trans->x->nY, PS_POLYNOMIAL_ORD);
 
       // copy the toFPA x,y, transformations to the wcs version
@@ -743,5 +743,5 @@
     // XXX require fpa->toTPA->nX == 1
 
-    psPlaneTransform *toTPA = psPlaneTransformAlloc(chip->toFPA->x->nX, chip->toFPA->x->nY);
+    psPlaneTransform *toTPA = psPlaneTransformAlloc(chip->toFPA->x->nX, chip->toFPA->x->nY, PS_POLYNOMIAL_ORD);
 
     for (int i = 0; i <= toTPA->x->nX; i++) {
@@ -962,5 +962,5 @@
     }
 
-    psPlaneTransform *newTrans = psPlaneTransformAlloc(1, 1);
+    psPlaneTransform *newTrans = psPlaneTransformAlloc(1, 1, PS_POLYNOMIAL_ORD);
 
     if (!psPlaneTransformFit(newTrans, src, dst, 0, 0)) {
@@ -1122,5 +1122,5 @@
     }
 
-    psPlaneTransform *newToFPA = psPlaneTransformAlloc(1, 1);
+    psPlaneTransform *newToFPA = psPlaneTransformAlloc(1, 1, PS_POLYNOMIAL_ORD);
     newToFPA->x->coeffMask[1][1] = 1;
     newToFPA->y->coeffMask[1][1] = 1;
@@ -1193,5 +1193,6 @@
     psMemSetDeallocator(wcs, (psFreeFunc) pmAstromWCSFree);
 
-    wcs->trans = psPlaneTransformAlloc (nXorder, nYorder);
+    // note: WCS transforms are always defined as chip to sky
+    wcs->trans = psPlaneTransformAlloc (nXorder, nYorder, PS_POLYNOMIAL_ORD);
     wcs->toSky = NULL;
     wcs->wcsCDkeys = 0;
