Index: trunk/psModules/src/objects/pmPSF.c
===================================================================
--- trunk/psModules/src/objects/pmPSF.c	(revision 15004)
+++ trunk/psModules/src/objects/pmPSF.c	(revision 15016)
@@ -6,6 +6,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-09-25 04:49:13 $
+ *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-09-25 22:05:05 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -160,10 +160,10 @@
     psf->psfTrendStats = psMemIncrRefCounter (options->stats);
 
-    // the order of the PSF parameter (X,Y) fits is determined by the psfTrendMask polynomial
-    // (user-specified as in the recipe). the masks of psfTrendMask are applied to each
-    // parameter.  if psfTrendMask is NULL, these polynomials are not allocated.  in this case,
-    // the user must set them by hand (as in pmPSFfromMD).  the parameters which are not fitted
-    // are left as NULL.  these are selected by testing for them by the named values (
-    // PM_PAR_XPOS, etc)
+    // the psf parameters may have 2D variations represented as either a polynomial (ordinary
+    // or chebychev) or as an image map.  The size of the image map is determined by pmPSFtry
+    // by minimizing the scatter in the fitted data and the rms error in the complete image
+    // map.  In this case, the user-supplied options of psfTrendNx and psfTrendNy are the
+    // maximum value used for these axes.  For the polynomial terms, the order is not currently
+    // set, dynamically.  The value of psfTrendNx and psfTrendNy are used.
 
     psImageBinning *binning = psImageBinningAlloc();
@@ -172,4 +172,8 @@
     binning->nXfine = options->psfFieldNx;
     binning->nYfine = options->psfFieldNy;
+
+    // for polynomial representations, nXruff, nYruff are the order number, and may be 0.
+    // in this case, we cannot set the psImageBinning scale because 0 would be invalid.  these
+    // elements are only used by the image map representation
     if (options->psfTrendMode == PM_TREND_MAP) {
 	psImageBinningSetScale (binning, PS_IMAGE_BINNING_CENTER);
@@ -177,8 +181,12 @@
     }
 
-    psf->fieldNx = options->psfFieldNx;
-    psf->fieldNy = options->psfFieldNy;
-    psf->fieldXo = options->psfFieldXo;
-    psf->fieldYo = options->psfFieldYo;
+    // trendNx & trendNy are used in pmPSFtry as the max for these values
+    psf->psfTrendMode = options->psfTrendMode;
+    psf->trendNx      = options->psfTrendNx;
+    psf->trendNy      = options->psfTrendNy;
+    psf->fieldNx      = options->psfFieldNx;
+    psf->fieldNy      = options->psfFieldNy;
+    psf->fieldXo      = options->psfFieldXo;
+    psf->fieldYo      = options->psfFieldYo;
 
     // define the parameter trends
