Index: /trunk/psModules/src/astrom/pmAstrometryObjects.c
===================================================================
--- /trunk/psModules/src/astrom/pmAstrometryObjects.c	(revision 15101)
+++ /trunk/psModules/src/astrom/pmAstrometryObjects.c	(revision 15102)
@@ -8,6 +8,6 @@
 *  @author EAM, IfA
 *
-*  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2007-09-28 00:37:59 $
+*  @version $Revision: 1.34 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2007-09-29 02:28:04 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -236,4 +236,7 @@
     *results->xStats = *stats;
     *results->yStats = *stats;
+
+    int nIter = stats->clipIter;
+
     results->xStats->clipIter = 1;
     results->yStats->clipIter = 1;
@@ -242,5 +245,5 @@
     // we run 'clipIter' cycles clipping in each of x and y, with only one iteration each
     // need to use the stats lookups functions to get the width and center
-    for (int i = 0; i < stats->clipIter; i++) {
+    for (int i = 0; i < nIter; i++) {
         psVectorClipFitPolynomial2D (map->x, results->xStats, mask, 0xff, x, wt, X, Y);
         // psTrace ("psModules.astrom", 3, "x resid: %f +/- %f (%ld of %ld)\n", results->xStats->robustMedian, results->xStats->robustStdev, results->xStats->clippedNvalues, x->n);
@@ -583,5 +586,4 @@
 
         # if 0
-
         char line[16];
         psFits *fits = psFitsOpen ("grid.image.fits", "w");
