Index: branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_DV1.c
===================================================================
--- branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_DV1.c	(revision 30904)
+++ branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_DV1.c	(revision 30931)
@@ -292,4 +292,7 @@
 
         source->moments = pmMomentsAlloc ();
+        source->moments->Mx = source->peak->xf; // we don't have both Mx,My and xf,yf in the cmf
+        source->moments->My = source->peak->yf; // we don't have both Mx,My and xf,yf in the cmf
+
         source->moments->Mxx = psMetadataLookupF32 (&status, row, "MOMENTS_XX");
         source->moments->Mxy = psMetadataLookupF32 (&status, row, "MOMENTS_XY");
Index: branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_DV2.c
===================================================================
--- branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_DV2.c	(revision 30904)
+++ branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_DV2.c	(revision 30931)
@@ -311,4 +311,7 @@
 
         source->moments = pmMomentsAlloc ();
+        source->moments->Mx = source->peak->xf; // we don't have both Mx,My and xf,yf in the cmf
+        source->moments->My = source->peak->yf; // we don't have both Mx,My and xf,yf in the cmf
+
         source->moments->Mxx = psMetadataLookupF32 (&status, row, "MOMENTS_XX");
         source->moments->Mxy = psMetadataLookupF32 (&status, row, "MOMENTS_XY");
Index: branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_SV1.c
===================================================================
--- branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_SV1.c	(revision 30904)
+++ branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_SV1.c	(revision 30931)
@@ -310,4 +310,7 @@
 
         source->moments = pmMomentsAlloc ();
+        source->moments->Mx = source->peak->xf; // we don't have both Mx,My and xf,yf in the cmf
+        source->moments->My = source->peak->yf; // we don't have both Mx,My and xf,yf in the cmf
+
         source->moments->Mxx = psMetadataLookupF32 (&status, row, "MOMENTS_XX");
         source->moments->Mxy = psMetadataLookupF32 (&status, row, "MOMENTS_XY");
@@ -753,10 +756,5 @@
 	    assert (radialAper);
 
-	    bool useMoments = true;
-	    useMoments = (useMoments && source->moments);          // can't if there are no moments
-	    useMoments = (useMoments && source->moments->nPixels); // can't if the moments were not measured
-	    useMoments = (useMoments && !(source->mode && PM_SOURCE_MODE_MOMENTS_FAILURE)); // can't if the moments failed...
-
-	    if (useMoments) {
+	    if (pmSourcePositionUseMoments(source)) {
 		xPos = source->moments->Mx;
 		yPos = source->moments->My;
Index: branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_V1.c
===================================================================
--- branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_V1.c	(revision 30904)
+++ branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_V1.c	(revision 30931)
@@ -277,4 +277,7 @@
 
         source->moments = pmMomentsAlloc ();
+        source->moments->Mx = source->peak->xf; // we don't have both Mx,My and xf,yf in the cmf
+        source->moments->My = source->peak->yf; // we don't have both Mx,My and xf,yf in the cmf
+
         source->moments->Mxx = psMetadataLookupF32 (&status, row, "MOMENTS_XX");
         source->moments->Mxy = psMetadataLookupF32 (&status, row, "MOMENTS_XY");
Index: branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_V2.c
===================================================================
--- branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_V2.c	(revision 30904)
+++ branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_V2.c	(revision 30931)
@@ -283,4 +283,7 @@
 
         source->moments = pmMomentsAlloc ();
+        source->moments->Mx = source->peak->xf; // we don't have both Mx,My and xf,yf in the cmf
+        source->moments->My = source->peak->yf; // we don't have both Mx,My and xf,yf in the cmf
+
         source->moments->Mxx = psMetadataLookupF32 (&status, row, "MOMENTS_XX");
         source->moments->Mxy = psMetadataLookupF32 (&status, row, "MOMENTS_XY");
Index: branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_V3.c
===================================================================
--- branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_V3.c	(revision 30904)
+++ branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_V3.c	(revision 30931)
@@ -307,4 +307,7 @@
 
         source->moments = pmMomentsAlloc ();
+        source->moments->Mx = source->peak->xf; // we don't have both Mx,My and xf,yf in the cmf
+        source->moments->My = source->peak->yf; // we don't have both Mx,My and xf,yf in the cmf
+
         source->moments->Mxx = psMetadataLookupF32 (&status, row, "MOMENTS_XX");
         source->moments->Mxy = psMetadataLookupF32 (&status, row, "MOMENTS_XY");
Index: branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceOutputs.c
===================================================================
--- branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceOutputs.c	(revision 30904)
+++ branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceOutputs.c	(revision 30931)
@@ -77,4 +77,12 @@
 }
 
+// what is the correct postion?
+// * if we have a PSF model fit, use PM_PAR_XPOS,YPOS for X_PSF,Y_PSF 
+// * if we do not have a model:
+// ** if we have moments:
+// *** if the star is saturated, use the moments
+// *** if the moments and peak agree to < DR, use the moments
+// *** otherwise, use the peak
+
 bool pmSourceOutputsSetValues (pmSourceOutputs *outputs, pmSource *source, pmChip *chip, float fwhmMajor, float fwhmMinor, float magOffset) {
 
@@ -112,8 +120,5 @@
 	outputs->apRadius = source->apRadius;
     } else {
-	bool useMoments = true;
-	useMoments = (useMoments && source->moments);          // can't if there are no moments
-	useMoments = (useMoments && source->moments->nPixels); // can't if the moments were not measured
-	useMoments = (useMoments && !(source->mode && PM_SOURCE_MODE_MOMENTS_FAILURE)); // can't if the moments failed...
+	bool useMoments = pmSourcePositionUseMoments(source);
 
 	if (useMoments) {
@@ -175,2 +180,23 @@
     return true;
 }
+
+// this function decides if the source position should be based on the peak or the moments.
+// this is only used if we know we should not use a model fit position (eg, no model, or no
+// model yet)
+bool pmSourcePositionUseMoments(pmSource *source) {
+
+    if (!source->moments) return false;		 // can't if there are no moments
+    if (!source->moments->nPixels) return false; // can't if the moments were not measured
+    if (source->mode && PM_SOURCE_MODE_MOMENTS_FAILURE) return false; // can't if the moments failed...
+
+    if (source->mode & PM_SOURCE_MODE_SATSTAR) return true; // moments are best for SATSTARs
+
+    float dX = source->moments->Mx - source->peak->xf;
+    float dY = source->moments->My - source->peak->yf;
+    float dR = hypot(dX, dY);
+    
+    // only use the moments position if the moment-peak offset is small or the star is saturated
+    if (dR > 1.5) return false
+
+    return true;
+}
Index: branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceOutputs.h
===================================================================
--- branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceOutputs.h	(revision 30904)
+++ branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceOutputs.h	(revision 30931)
@@ -60,3 +60,5 @@
 bool pmSourceOutputsSetMoments (pmSourceOutputsMoments *moments, pmSource *source);
 
+bool pmSourcePositionUseMoments(pmSource *source);
+
 # endif
