Index: trunk/psModules/src/astrom/pmAstrometryDistortion.c
===================================================================
--- trunk/psModules/src/astrom/pmAstrometryDistortion.c	(revision 9730)
+++ trunk/psModules/src/astrom/pmAstrometryDistortion.c	(revision 10603)
@@ -7,6 +7,6 @@
 *  @author EAM, IfA
 *
-*  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-10-24 22:55:04 $
+*  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2006-12-10 02:06:47 $
 *
 *  Copyright 2006 Institute for Astronomy, University of Hawaii
@@ -181,11 +181,11 @@
     // the order of the gradient fits need to be 1 less than the distortion term
     // determine the gradient order(s) from the fpa->toTP structure
-    localX = psPolynomial2DAlloc (PS_POLYNOMIAL_ORD, fpa->toTangentPlane->x->nX-1, fpa->toTangentPlane->x->nY);
-    localY = psPolynomial2DAlloc (PS_POLYNOMIAL_ORD, fpa->toTangentPlane->x->nX,   fpa->toTangentPlane->x->nY-1);
+    localX = psPolynomial2DAlloc (PS_POLYNOMIAL_ORD, fpa->toTPA->x->nX-1, fpa->toTPA->x->nY);
+    localY = psPolynomial2DAlloc (PS_POLYNOMIAL_ORD, fpa->toTPA->x->nX,   fpa->toTPA->x->nY-1);
 
     // set masks based on fpa->toTP
-    for (int i = 0; i < fpa->toTangentPlane->x->nX; i++) {
-        for (int j = 0; j < fpa->toTangentPlane->x->nY; j++) {
-            if (fpa->toTangentPlane->x->mask[i][j][0][0]) {
+    for (int i = 0; i < fpa->toTPA->x->nX; i++) {
+        for (int j = 0; j < fpa->toTPA->x->nY; j++) {
+            if (fpa->toTPA->x->mask[i][j][0][0]) {
                 localX->mask[i-1][j] = 1;
                 localY->mask[i][j-1] = 1;
@@ -203,19 +203,19 @@
 
     // update fpa->toTP distortion terms
-    fpa->toTangentPlane->x->coeff[0][0][0][0] = 0;
-    for (int i = 1; i < fpa->toTangentPlane->x->nX; i++) {
-        if (!fpa->toTangentPlane->x->mask[i][0][0][0]) {
-            fpa->toTangentPlane->x->coeff[i][0][0][0] = localX->coeff[i-1][0] / i;
-        }
-    }
-    for (int j = 1; j < fpa->toTangentPlane->x->nY; j++) {
-        if (!fpa->toTangentPlane->x->mask[0][j][0][0]) {
-            fpa->toTangentPlane->x->coeff[0][j][0][0] = localY->coeff[0][j-1] / j;
-        }
-    }
-    for (int i = 1; i < fpa->toTangentPlane->x->nX; i++) {
-        for (int j = 1; j < fpa->toTangentPlane->x->nY; j++) {
-            if (!fpa->toTangentPlane->x->mask[i][j][0][0]) {
-                fpa->toTangentPlane->x->coeff[i][j][0][0] = 0.5*(localX->coeff[i-1][j] / i + localY->coeff[i][j-1] / j);
+    fpa->toTPA->x->coeff[0][0][0][0] = 0;
+    for (int i = 1; i < fpa->toTPA->x->nX; i++) {
+        if (!fpa->toTPA->x->mask[i][0][0][0]) {
+            fpa->toTPA->x->coeff[i][0][0][0] = localX->coeff[i-1][0] / i;
+        }
+    }
+    for (int j = 1; j < fpa->toTPA->x->nY; j++) {
+        if (!fpa->toTPA->x->mask[0][j][0][0]) {
+            fpa->toTPA->x->coeff[0][j][0][0] = localY->coeff[0][j-1] / j;
+        }
+    }
+    for (int i = 1; i < fpa->toTPA->x->nX; i++) {
+        for (int j = 1; j < fpa->toTPA->x->nY; j++) {
+            if (!fpa->toTPA->x->mask[i][j][0][0]) {
+                fpa->toTPA->x->coeff[i][j][0][0] = 0.5*(localX->coeff[i-1][j] / i + localY->coeff[i][j-1] / j);
             }
         }
@@ -226,11 +226,11 @@
     // the order of the gradient fits need to be 1 less than the distortion term
     // determine the gradient order(s) from the fpa->toTP structure
-    localX = psPolynomial2DAlloc (PS_POLYNOMIAL_ORD, fpa->toTangentPlane->y->nX-1, fpa->toTangentPlane->y->nY);
-    localY = psPolynomial2DAlloc (PS_POLYNOMIAL_ORD, fpa->toTangentPlane->y->nX,   fpa->toTangentPlane->y->nY-1);
+    localX = psPolynomial2DAlloc (PS_POLYNOMIAL_ORD, fpa->toTPA->y->nX-1, fpa->toTPA->y->nY);
+    localY = psPolynomial2DAlloc (PS_POLYNOMIAL_ORD, fpa->toTPA->y->nX,   fpa->toTPA->y->nY-1);
 
     // set masks based on fpa->toTP
-    for (int i = 0; i < fpa->toTangentPlane->y->nX; i++) {
-        for (int j = 0; j < fpa->toTangentPlane->y->nY; j++) {
-            if (fpa->toTangentPlane->y->mask[i][j][0][0]) {
+    for (int i = 0; i < fpa->toTPA->y->nX; i++) {
+        for (int j = 0; j < fpa->toTPA->y->nY; j++) {
+            if (fpa->toTPA->y->mask[i][j][0][0]) {
                 localX->mask[i-1][j] = 1;
                 localY->mask[i][j-1] = 1;
@@ -259,19 +259,19 @@
 
     // update fpa->toTP distortion terms
-    fpa->toTangentPlane->y->coeff[0][0][0][0] = 0;
-    for (int i = 1; i < fpa->toTangentPlane->y->nX; i++) {
-        if (!fpa->toTangentPlane->y->mask[i][0][0][0]) {
-            fpa->toTangentPlane->y->coeff[i][0][0][0] = localX->coeff[i-1][0] / i;
-        }
-    }
-    for (int j = 1; j < fpa->toTangentPlane->y->nY; j++) {
-        if (!fpa->toTangentPlane->y->mask[0][j][0][0]) {
-            fpa->toTangentPlane->y->coeff[0][j][0][0] = localY->coeff[0][j-1] / j;
-        }
-    }
-    for (int i = 1; i < fpa->toTangentPlane->y->nX; i++) {
-        for (int j = 1; j < fpa->toTangentPlane->y->nY; j++) {
-            if (!fpa->toTangentPlane->y->mask[i][j][0][0]) {
-                fpa->toTangentPlane->y->coeff[i][j][0][0] = 0.5*(localX->coeff[i-1][j] / i + localY->coeff[i][j-1] / j);
+    fpa->toTPA->y->coeff[0][0][0][0] = 0;
+    for (int i = 1; i < fpa->toTPA->y->nX; i++) {
+        if (!fpa->toTPA->y->mask[i][0][0][0]) {
+            fpa->toTPA->y->coeff[i][0][0][0] = localX->coeff[i-1][0] / i;
+        }
+    }
+    for (int j = 1; j < fpa->toTPA->y->nY; j++) {
+        if (!fpa->toTPA->y->mask[0][j][0][0]) {
+            fpa->toTPA->y->coeff[0][j][0][0] = localY->coeff[0][j-1] / j;
+        }
+    }
+    for (int i = 1; i < fpa->toTPA->y->nX; i++) {
+        for (int j = 1; j < fpa->toTPA->y->nY; j++) {
+            if (!fpa->toTPA->y->mask[i][j][0][0]) {
+                fpa->toTPA->y->coeff[i][j][0][0] = 0.5*(localX->coeff[i-1][j] / i + localY->coeff[i][j-1] / j);
             }
         }
