Index: trunk/psphot/src/psphot.c
===================================================================
--- trunk/psphot/src/psphot.c	(revision 5628)
+++ trunk/psphot/src/psphot.c	(revision 5643)
@@ -49,11 +49,29 @@
     if (!strcasecmp (breakPt, "PSFFIT")) exit (0);
 
-    // test PSF on all except SATURATE and DEFECT (artifacts)
-    psphotApplyPSF (imdata, config, sources, psf, sky);
-    if (!strcasecmp (breakPt, "PSFSUB")) exit (0);
+    int FITMODE = psMetadataLookupS32 (&status, config, "FIT_MODE");
+    if (!status) FITMODE = 0;
 
-    // fit extended objects with galaxy models
-    psphotFitGalaxies (imdata, config, sources, sky);
-    if (!strcasecmp (breakPt, "GALSUB")) exit (0);
+    switch (FITMODE) {
+      case 0:
+	psphotFixedPSF (imdata, config, sources, psf, sky);
+	break;
+
+      case 1:
+	// test PSF on all except SATURATE and DEFECT (artifacts)
+	psphotApplyPSF (imdata, config, sources, psf, sky);
+	break;
+
+      case 2:
+      // fit extended objects with galaxy models
+	psphotApplyPSF (imdata, config, sources, psf, sky);
+	psphotFitGalaxies (imdata, config, sources, sky);
+	break;
+
+      case 3:
+      // fit extended objects with galaxy models
+	psphotFixedPSF (imdata, config, sources, psf, sky);
+	psphotFitGalaxies (imdata, config, sources, sky);
+	break;
+    }
 
     // write out data in appropriate format
