Index: trunk/psModules/src/objects/pmSourcePhotometry.c
===================================================================
--- trunk/psModules/src/objects/pmSourcePhotometry.c	(revision 15090)
+++ trunk/psModules/src/objects/pmSourcePhotometry.c	(revision 15104)
@@ -3,6 +3,6 @@
  *  @author EAM, IfA; GLG, MHPCC
  *
- *  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-09-29 00:15:51 $
+ *  @version $Revision: 1.34 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-09-29 02:34:31 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -98,5 +98,6 @@
     // measure PSF model photometry
     if (psf->FluxScale) {
-	double fluxScale = pmTrend2DEval (psf->FluxScale, x, y);
+	// the source peak pixel is guaranteed to be on the image, and only minimally different from the source center
+	double fluxScale = pmTrend2DEval (psf->ApTrend, (float)source->peak->x, (float)source->peak->y);
 	if (!isfinite(fluxScale)) {
 	    // XXX objects on the edge can be slightly outside -- if we get an 
@@ -120,4 +121,6 @@
     // for PSFs, correct both apMag and psfMag to same system, consistent with infinite flux star in aperture RADIUS
     if ((mode & PM_SOURCE_PHOT_APCORR) && isPSF && psf && psf->ApTrend) {
+	// the source peak pixel is guaranteed to be on the image, and only minimally different from the source center
+	double apTrend = pmTrend2DEval (psf->ApTrend, (float)source->peak->x, (float)source->peak->y);
         source->psfMag += pmTrend2DEval (psf->ApTrend, x, y);
     }
