Index: trunk/ippconfig/recipes/ppSim.config
===================================================================
--- trunk/ippconfig/recipes/ppSim.config	(revision 25751)
+++ trunk/ippconfig/recipes/ppSim.config	(revision 25756)
@@ -50,7 +50,7 @@
 
 STARS.FAKE      BOOL    TRUE		# Add fake stars, randomly distributed?
-STARS.LUM	F32	0.6		# Stellar luminosity function slope (magnitude slope)
-STARS.MAG	F32	15.5		# Brightest magnitude for fake stars
-STARS.DENSITY	F32     50.0		# Stellar density (per square degree) at the brightest magnitude
+STARS.LUM	F32	0.35		# Stellar luminosity function slope (magnitude slope)
+STARS.MAG	F32	15.5		# Brightest magnitude for fake stars (choose based on real catalog limit)
+STARS.DENSITY	F32      1.0		# Stellar density (per square degree) at the brightest magnitude
 STARS.SIGMA.LIM F32      5.0            # significance of faintest sources
 
@@ -185,4 +185,10 @@
 END
 
+STACKTEST.MAKE  METADATA
+END
+
+STACKTEST.RUN  METADATA
+END
+
 # Overrides for creating large holes in the image
 LARGEHOLES	METADATA
Index: trunk/ippconfig/recipes/psphot.config
===================================================================
--- trunk/ippconfig/recipes/psphot.config	(revision 25751)
+++ trunk/ippconfig/recipes/psphot.config	(revision 25756)
@@ -2,12 +2,12 @@
 # these options turn on different inputs and/or outputs
 SAVE.OUTPUT                         BOOL  TRUE
-SAVE.BACKMDL                        BOOL  FALSE
+SAVE.BACKMDL                        BOOL  TRUE
 SAVE.BACKMDL.STDEV                  BOOL  FALSE
 SAVE.BACKGND                        BOOL  FALSE
 SAVE.BACKSUB                        BOOL  FALSE
 SAVE.RESID                          BOOL  FALSE
+SAVE.PLOTS                          BOOL  FALSE
 SAVE.PSF                            BOOL  TRUE
 LOAD.PSF                            BOOL  FALSE
-SAVE.PLOTS                          BOOL  FALSE
 
 # format for output CMF files
@@ -15,7 +15,5 @@
 
 # the zero point is used to set a basic scale for DVO
-# XXX it may not currently be read : double check this (EAM)
-ZERO_POINT                          F32   25.000          # zero point used by DVO
-ZERO_PT                             F32   25.000          # zero point used by DVO
+ZERO_PT                             F32   25.000          # zero point used by DVO XXX deprecate this
 
 # these parameter govern how the background is measured
@@ -23,4 +21,8 @@
 BACKGROUND.YBIN                     S32   128             # size of background superpixels
 IMSTATS_NPIX                        S32   10000           # number of pixels to use for sky estimate boxes:
+
+# soften the errors for bright pixels:
+SOFTEN.VARIANCE                     BOOL  FALSE
+SOFTEN.VARIANCE.FRACTION            F32   0.0
 
 SKY_BIAS                            F32   0.0             # offset applied to measured sky (FOR TESTING)
@@ -43,26 +45,38 @@
 PEAKS_SMOOTH_SIGMA                  F32   1.0             # smoothing kernel sigma in pixels
 PEAKS_SMOOTH_NSIGMA                 F32   2.0             # smoothing kernel width in sigmas
-PEAKS_NSIGMA_LIMIT                  F32   25.0            # peak significance threshold
+PEAKS_NSIGMA_LIMIT                  F32   20.0            # peak significance threshold
 PEAKS_NSIGMA_LIMIT_2                F32   5.0             # peak significance threshold
-PEAKS_NMAX                          S32   0               # on first pass, only keep NMAX peaks (0 == all)
-PEAKS_MIN_GAUSS                     F32   0.5             # Minimum valid fraction of kernel
+PEAKS_NMAX                          S32   5000            # on first pass, only keep NMAX peaks (0 == all)
+PEAKS_MIN_GAUSS                     F32   0.5             # On quick convolution, mask pixels for which the 
+				    	  		  # input pixels contribute less than this fraction of the flux
+# parameters which adjust the footprint analysis
+USE_FOOTPRINTS                      BOOL  TRUE       	  # use new pmFootprint peak packaging
+FOOTPRINT_NPIXMIN                   S32   5       	  # Minimum size of a pmFootprint
+FOOTPRINT_GROW_RADIUS               S32   3       	  # How much to grow bright footprints
+FOOTPRINT_GROW_RADIUS_2             S32   5       	  # How much to grow faint footprints
+FOOTPRINT_CULL_NSIGMA_DELTA         F32   4       	  # Cull peaks that aren't nsigma above coll to neighbour
+FOOTPRINT_CULL_NSIGMA_MIN           F32   1       	  # Minimum height of colls in units of skyStdev
+FOOTPRINT_CULL_NSIGMA_PAD           F32   0.01       	  # Fractional Padding for stdev
+
+# parameter for the simple deblending
+DEBLEND_PEAK_FRACTION               F32   0.1
+DEBLEND_SKY_NSIGMA                  F32   10.0
 
 # parameters to control the selection of the peak in the Sx,Sy plane
 MOMENTS_SCALE                       F32   0.25       
-MOMENTS_SN_MIN                      F32   10.0           # min S/N to measure moments
+MOMENTS_SN_MIN                      F32   0.0             # min S/N to measure moments (default: measure all objects)
 MOMENTS_SX_MAX                      F32   50.0
 MOMENTS_SY_MAX                      F32   50.0
 MOMENTS_AR_MAX                      F32   1.5             # maximum axial ratio: 1 / AR < (sx / sy) < AR
-MOMENTS_MIN_PIXEL_SN		    F32	  0.0		  # XXX caution on this: too high and we will excessively clip
-MOMENTS_GAUSS_SIGMA		    F32	  4.0		  # XXX TEST THIS: sigma in pixels (should be >> seeing equiv)
+MOMENTS_GAUSS_SIGMA		    F32	  4.0		  # XXX this is now autoscaled
 
 # basic object statistics
 SKY_INNER_RADIUS                    F32   15              # square annulus for local sky measurement
 SKY_OUTER_RADIUS                    F32   25              # square annulus for local sky measurement
-PSF_MOMENTS_RADIUS                  F32   3               # calculate initial source moments with this radius
-PSF_SN_LIM                          F32   50              # minimum S/N for stars used for PSF model
-PSF_MAX_NSTARS                      S32   200             # limit number of stars used for PSF model
+PSF_MOMENTS_RADIUS                  F32   3               # XXX this is now autoscaled
+PSF_SN_LIM                          F32   20              # minimum S/N for stars used for PSF model
+PSF_MAX_NSTARS                      S32   500             # limit number of stars used for PSF model
 PSF_CLUMP_NSIGMA                    F32   1.5             # region of Sx,Sy plane to use for selecting PSF stars
-PSF_CLUMP_GRID_SCALE                F32   0.5             # size of Sx,Sy image pixel
+PSF_CLUMP_GRID_SCALE                F32   0.2             # size of Sx,Sy image pixel
 
 PSF_CLUMP_NX                        S32   1               # subdivide image in to NX x NY regions for 
@@ -80,6 +94,4 @@
 PSF_MODEL                           STR   PS_MODEL_GAUSS
 # PSF_MODEL                         STR   PS_MODEL_PGAUSS
-# PSF_MODEL                         STR   PS_MODEL_QGAUSS
-# PSF_MODEL                         STR   PS_MODEL_TGAUSS # not well tested, not very successful
 
 # PSF.TREND.MASK must be a 2D polynomial
@@ -98,13 +110,16 @@
 PSF.FAKE.ALLOW                      BOOL  FALSE           # Allow use of fake PSFs when having trouble?
 
-PSF_FIT_RADIUS                      F32   15.0            # fitting radius for test PSF model
+PSF_FIT_RADIUS                      F32   15.0            # XXX this is now autoscaled
 PSF_REF_RADIUS                      F32   25.0            # aperture magnitudes are scaled via 
-                                         # curve-of-growth to this radius
+                                                          # curve-of-growth to this radius
+
+PSF_FIT_RADIUS_SCALE                F32   7.0            # fitting radius for test PSF model
+PSF_APERTURE_SCALE                  F32   4.5            # fitting radius for test PSF model
+
 # PSF-like source model parameters
 PSF_FIT_NSIGMA                      F32   1.0             # significance for pixel included in fit
 PSF_FIT_PADDING                     F32   2.0             # extra annulus to use for fit 
-PSF_SHAPE_NSIGMA                    F32   3.0             # max significance for shape variation
 PSF_MIN_SN                          F32   2.0             # reject objects below this significance
-PSF_MAX_CHI                         F32   50.0            # reject objects worse that this
+PSF_MAX_CHI                         F32   50.0            # reject objects worse than this
 FULL_FIT_SN_LIM                     F32   50.0
 
@@ -117,12 +132,13 @@
 PSF.RESIDUALS.STATISTIC             STR   ROBUST_MEDIAN   # statistic to use for generating the residual
 PSF.RESIDUALS.SPATIAL_ORDER         S32   0               # fit spatial variations of the residuals at this order (0,1)
-PSF.RESIDUALS.PIX.SN                F32   5.0             # keep this pixel if residual is more significant than this
+PSF.RESIDUALS.PIX.SN                F32   0.0             # keep this pixel if residual is more significant than this
+PSF.RESIDUALS.RADIUS                F32   8.0             # keep this pixel if residual is more significant than this
  
 # this model is used for approximate subtraction in the main object analysis step
 EXT_MODEL                           STR   PS_MODEL_QGAUSS
-EXT_MIN_SN                          F32   50.0            # fit galaxies above this S/N limit
 EXT_FIT_NSIGMA                      F32   1               # significance for pixel included in fit
 EXT_FIT_PADDING                     F32   5               # extra annulus to use for fit 
 EXT_MOMENTS_RADIUS                  F32   31
+EXT_FIT_MAX_RADIUS                  F32   128             # non-sensical to fit objects larger than the background mesh
 
 EXT_FIT_ITER                        S32   20              # Maximum number of fitting iterations for EXT
@@ -172,12 +188,8 @@
 PETROSIAN_FLUX_RATIO                F32    0.1 # we measure out to where flux = R0 * FLUX_RATIO
 
-FITMODE                             STR   BLEND  
-DEBLEND_PEAK_FRACTION               F32   0.1
-DEBLEND_SKY_NSIGMA                  F32   10.0
-
 # APTREND                           STR   NONE, CONSTANT, SKYBIAS, SKYSAT, XY_LIN, SKY_XY_LIN, SKYSAT_XY_LIN, ALL
-MEASURE.APTREND	                    BOOL  FALSE		### Gene says there's bugs in this part
+MEASURE.APTREND	                    BOOL  TRUE
 APTREND                             STR   CONSTANT
-AP_MIN_SN                           F32   25.0
+AP_MIN_SN                           F32   0.0 # measure apMags for all sources by default
 APTREND.NSTAR.MIN                   S32   5
 APTREND.ORDER.MAX                   S32   5
@@ -196,5 +208,5 @@
 
 IGNORE_GROWTH                       BOOL  FALSE
-CONSTANT_PHOTOMETRIC_WEIGHTS        BOOL  TRUE 		  # Should the photometric code [currently only ensemblePSF] refuse to weight each pixel by it's significance?
+CONSTANT_PHOTOMETRIC_WEIGHTS        BOOL  FALSE 
 INTERPOLATE_AP                      BOOL  TRUE
 
@@ -207,14 +219,4 @@
 NOISE.FACTOR                        F32   5.0
 NOISE.SIZE                          F32   2.0
-
-USE_FOOTPRINTS                      BOOL  F       	  # use new pmFootprint peak packaging
-FOOTPRINT_NPIXMIN                   S32   5       	  # Minimum size of a pmFootprint
-FOOTPRINT_NSIGMA_LIMIT              F32   20      	  # threshold for bright pmFootprint detection
-FOOTPRINT_NSIGMA_LIMIT_2            F32   4       	  # threshold for faint pmFootprint detection
-FOOTPRINT_GROW_RADIUS               S32   3       	  # How much to grow bright footprints
-FOOTPRINT_GROW_RADIUS_2             S32   5       	  # How much to grow faint footprints
-FOOTPRINT_CULL_NSIGMA_DELTA         F32   4       	  # Cull peaks that aren't nsigma above coll to neighbour
-FOOTPRINT_CULL_NSIGMA_MIN           F32   1       	  # Minimum height of colls in units of skyStdev
-FOOTPRINT_CULL_NSIGMA_PAD           F32   0.01       	  # Fractional Padding for stdev
 
 # alternate PSPHOT-type recipes
@@ -261,5 +263,6 @@
 
 PSPHOT.CR.NSIGMA.LIMIT              F32   3.0  # sources with crNsigma greater that this get tagged as likely cosmic rays
-PSPHOT.EXT.NSIGMA.LIMIT             F32   4.0  # sources with extNsigma greater that this get tagged as likely extended sources
+PSPHOT.EXT.NSIGMA.LIMIT             F32   3.0  # sources with extNsigma greater that this get tagged as likely extended sources
+PSPHOT.EXT.NSIGMA.MOMENTS           F32   2.0  # sources with extNsigma greater that this get tagged as likely extended sources
 PSPHOT.CR.GROW                      S32   1               # Number of pixels to grow CR mask
 PSPHOT.CR.NSIGMA.SOFTEN             F32   0.0025          # Softening parameter for weights
