Index: trunk/psphot/src/psphotBlendFit.c
===================================================================
--- trunk/psphot/src/psphotBlendFit.c	(revision 6427)
+++ trunk/psphot/src/psphotBlendFit.c	(revision 6481)
@@ -3,4 +3,6 @@
 // XXX I don't like this name
 bool psphotBlendFit (pmReadout *readout, psMetadata *config, psArray *sources, pmPSF *psf) { 
+
+    bool status;
 
     psTimerStart ("psphot");
@@ -9,10 +11,17 @@
     sources = psArraySort (sources, psphotSortBySN);
     
+    // S/N limit to perform full non-linear fits
+    float FIT_SN_LIM = psMetadataLookupF32 (&status, config, "FULL_FIT_SN_LIM");
+
     psphotInitLimitsPSF (config);
     psphotInitLimitsEXT (config);
     psphotInitRadiusPSF (config, psf->type);
 
+    // option to limit analysis to a specific region
+    char *region = psMetadataLookupStr (&status, config, "ANALYSIS_REGION");
+    psRegion AnalysisRegion = psRegionForImage (readout->image, psRegionFromString (region));
+    if (psRegionIsNaN (AnalysisRegion)) psAbort ("psphot", "analysis region mis-defined");
+
     for (int i = 0; i < sources->n; i++) {
-
 	pmSource *source = sources->data[i];
 
@@ -22,6 +31,15 @@
 	if (source->type == PM_SOURCE_SATURATED) continue;
 
+	// limit selection to some SN limit
+	if (source->moments == NULL) continue;
+	if (source->moments->SN < FIT_SN_LIM) continue;
+
 	// if model is NULL, we don't have a starting guess
 	if (source->modelPSF == NULL) continue;
+
+	if (source->moments->x < AnalysisRegion.x0) continue;
+	if (source->moments->y < AnalysisRegion.y0) continue;
+	if (source->moments->x > AnalysisRegion.x1) continue;
+	if (source->moments->y > AnalysisRegion.y1) continue;
 
 	// replace object in image
@@ -29,5 +47,5 @@
 
 	psTrace ("psphot.blend", 5, "trying source at %f, %f\n", source->moments->x, source->moments->y);
-
+	
 	// try fitting PSFs, then try extended sources
 	if (psphotFitBlend (readout, source)) continue;
