Index: trunk/psModules/src/astrom/pmAstrometryDistortion.c
===================================================================
--- trunk/psModules/src/astrom/pmAstrometryDistortion.c	(revision 15591)
+++ trunk/psModules/src/astrom/pmAstrometryDistortion.c	(revision 19305)
@@ -7,6 +7,6 @@
 *  @author EAM, IfA
 *
-*  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2007-11-12 21:58:17 $
+*  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2008-09-02 19:05:09 $
 *
 *  Copyright 2006 Institute for Astronomy, University of Hawaii
@@ -98,6 +98,6 @@
                 pmAstromObj *ref = refstars->data[match->ref];
 
-                L->data.F32[Npts] = ref->FP->x;
-                M->data.F32[Npts] = ref->FP->y;
+                L->data.F32[Npts] = raw->FP->x;
+                M->data.F32[Npts] = raw->FP->y;
 
                 // P,Q = L,M + terms of order epsilon.
@@ -126,4 +126,6 @@
             grad = pmAstromGradientAlloc ();
 
+	    // XXX psTraceSetLevel("psLib.math.psVectorClipFitPolynomial2D", 7);
+
             // fit the collection of positions and offsets with a local 1st order gradient
             // apply 3hi/3lo sigma clipping to the fitted data values
@@ -135,4 +137,6 @@
             grad->dTPdL.x = local->coeff[1][0];
             grad->dTPdM.x = local->coeff[0][1];
+
+	    // XXX psTraceSetLevel("psLib.math.psVectorClipFitPolynomial2D", 0);
 
             // fit the collection of positions and offsets with a local 1st order gradient
