Index: trunk/psphot/src/psphotReplaceUnfit.c
===================================================================
--- trunk/psphot/src/psphotReplaceUnfit.c	(revision 35769)
+++ trunk/psphot/src/psphotReplaceUnfit.c	(revision 38515)
@@ -316,4 +316,6 @@
     }
 
+    pmSourceFitOptions *fitOptions = psMetadataLookupPtr (&status, readout->analysis, "PCM_FIT_OPTIONS");
+    psAssert (fitOptions, "missing pcm fit options");
 
     // XXX the sources have already been copied (merge into here?)
@@ -368,8 +370,9 @@
 	    source->modelPSF = modelPSF;
 	    source->modelPSF->fitRadius = radius;
-	    model = source->modelPSF;
+	    //  model = source->modelPSF;
 	}
 
 	if (model->isPCM) {
+#if 0
 	    psAssert(false, "this section is not complete");
 
@@ -389,10 +392,19 @@
 
 	    psImageConvolveFFT (source->modelFlux, rawModelFlux, NULL, 0, psfKernel);
-	  
 	    psFree (psfKernel);
 	    psFree (rawModelFlux);
-	}
-
-	pmSourceCacheModel (source, maskVal);  // ALLOC x14 (!)
+#endif
+           pmPCMdata *pcm = pmPCMinit (source, fitOptions, model, maskVal, psfSize);
+            if (pcm) {
+                // pmPCMMakeModel (source, model, pcm->nsigma, maskVal, psfSize);
+                pmPCMCacheModel (source, maskVal, psfSize, pcm->nsigma);
+                psFree(pcm);
+            } else {
+                psAssert (pcm, "pmPCMinit failed!");
+            }
+	  
+	} else {
+            pmSourceCacheModel (source, maskVal);  // ALLOC x14 (!)
+        }
     }
 
