Index: trunk/ippconfig/cfh12k/psphot.config
===================================================================
--- trunk/ippconfig/cfh12k/psphot.config	(revision 25751)
+++ trunk/ippconfig/cfh12k/psphot.config	(revision 25756)
@@ -1,36 +1,10 @@
 
 # turn these on to see specific outputs
-SAVE.OUTPUT	BOOL 	TRUE
-SAVE.BACKMDL	BOOL 	TRUE
-SAVE.PSF	BOOL 	TRUE
 SAVE.PLOTS	BOOL 	TRUE
-
-BACKGROUND.XBIN	    S32   128           # size of background superpixels
-BACKGROUND.YBIN	    S32   128           # size of background superpixels
-
-# image background parameters
-IMSTATS_NPIX        S32  10000    	 # number of pixels to use for sky estimate boxes:
-
-PSF_SN_LIM          F32  50              # minimum S/N for stars used for PSF model
-PSF_MAX_NSTARS      S32  300             # limit number of stars used for PSF model
-
-PEAKS_NSIGMA_LIMIT     F32   25.0            # peak significance threshold
-PEAKS_NSIGMA_LIMIT_2   F32   10.0            # peak significance threshold
 
 # PSF model parameters : choose the PSF model desired
 PSF_MODEL           STR  PS_MODEL_QGAUSS
 
-MOMENTS_SN_MIN       F32  20.0           # min S/N to measure moments
-EXT_MIN_SN           F32  50.0           # fit galaxies above this S/N limit
-FULL_FIT_SN_LIM      F32  50.0
-AP_MIN_SN            F32  25.0
-MEASURE.APTREND	                    BOOL  FALSE
-
-# BREAK_POINT may be one of (PEAKS, MOMENTS, PSFMODEL, ENSEMBLE)
-# BREAK_POINT         STR ENSEMBLE
-
-OUTPUT.FORMAT       STR PS1_DEV_1
-
-# masking parameters (XXX EAM : rework this to use psRegion like ANALYSIS_REGION)
+# XXX are these needed?
 XMIN                F32   +10        	 # minimum valid x-coord
 XMAX                F32   -10        	 # maximum valid x-coord
@@ -38,3 +12,2 @@
 YMAX                F32   -10        	 # maximum valid y-coord
 
-USE_FOOTPRINTS                      BOOL  TRUE       	  # use new pmFootprint peak packaging
Index: trunk/ippconfig/esowfi/psphot.config
===================================================================
--- trunk/ippconfig/esowfi/psphot.config	(revision 25751)
+++ trunk/ippconfig/esowfi/psphot.config	(revision 25756)
@@ -1,30 +1,3 @@
 
-SAVE.BACKMDL	BOOL 	TRUE
-SAVE.BACKMDL.STDEV BOOL 	TRUE
-SAVE.BACKGND	BOOL 	TRUE
-SAVE.BACKSUB	BOOL 	TRUE
-SAVE.PLOTS      BOOL    FALSE
-SAVE.RESID	BOOL 	TRUE
-SAVE.PSF	BOOL 	TRUE
-LOAD.PSF	BOOL 	FALSE
-
-IMSTATS_NPIX        S32  3000    	 # number of pixels to use for sky estimate boxes:
-
-#PSPHOT_TEST METADATA
-# SAVE.BACKSUB	BOOL 	FALSE
-# SAVE.RESID	BOOL 	TRUE
-#END
-#
-#PEAKS_OUTPUT_FILE   STR  peaks.dat
-#MOMENTS_OUTPUT_FILE STR  moments.dat
-
-#PSF_SN_LIM          F32  20.0            # minimum S/N for stars used for PSF model
-MOMENTS_SN_MIN      F32  20.0            # min S/N to measure moments
-FULL_FIT_SN_LIM     F32  100.0
-EXT_MIN_SN          F32  100.0           # fit galaxies above this S/N limit
-
-PEAKS_NSIGMA_LIMIT  F32  10.0 	   	 # peak significance threshold
-BREAK_POINT         STR  ENSEMBLE        # limit total processing for now (for speed)
-
-
-SKY_STAT            STR  ROBUST_MEDIAN   # statistic used to measure background
+# choose the PSF model
+PSF_MODEL                           STR   PS_MODEL_QGAUSS
Index: trunk/ippconfig/gpc1/psphot.config
===================================================================
--- trunk/ippconfig/gpc1/psphot.config	(revision 25751)
+++ trunk/ippconfig/gpc1/psphot.config	(revision 25756)
@@ -1,56 +1,31 @@
 
-# turn these on to see specific outputs
-SAVE.OUTPUT	BOOL 	TRUE
-SAVE.BACKMDL	BOOL 	TRUE
-SAVE.PSF	BOOL 	TRUE
-SAVE.PLOTS     	BOOL    TRUE
+BACKGROUND.XBIN	                    S32   256           # size of background superpixels
+BACKGROUND.YBIN	                    S32   256           # size of background superpixels
 
-# for testing:
-# BREAK_POINT STR BACKMDL
+SOFTEN.VARIANCE                     BOOL  TRUE          # XXX drop? soften the errors for bright pixels
+SOFTEN.VARIANCE.FRACTION            F32   0.005
 
-BACKGROUND.XBIN	    S32  256            # size of background superpixels
-BACKGROUND.YBIN	    S32  256            # size of background superpixels
+PEAKS_SMOOTH_SIGMA                  F32   2.5           # smoothing kernel sigma in pixels
 
-# image background parameters
-IMSTATS_NPIX        S32  10000    	 # number of pixels to use for sky estimate boxes:
-SKY_STAT            STR  FITTED_MEAN_V4  # statistic used to measure background
-SKY_CLIP_SIGMA      F32  2.0             # statistic used to measure background
+PSF_CLUMP_NX                        S32   3             # subdivide image in to NX x NY regions for 
+PSF_CLUMP_NY                        S32   3             # selecting PSF stars
+PSF_CLUMP_GRID_SCALE                F32   2.5		# XXX too large? size of Sx,Sy image pixel
 
-PEAKS_SMOOTH_SIGMA  F32   2.5            # smoothing kernel sigma in pixels
-PEAKS_NMAX          S32   5000           # on first pass, only keep NMAX peaks (0 == all)
-PEAKS_NSIGMA_LIMIT  F32   25.0           # peak significance threshold
-PEAKS_NSIGMA_LIMIT_2 F32   5.0           # peak significance threshold
-
-PSF_SN_LIM          F32  25              # minimum S/N for stars used for PSF model
-PSF_MAX_NSTARS      S32  300             # limit number of stars used for PSF model
-PSF_CLUMP_NX        S32   3               # subdivide image in to NX x NY regions for 
-PSF_CLUMP_NY        S32   3               # selecting PSF stars
-PSF_MOMENTS_RADIUS  F32  12               # calculate initial source moments with this radius
-PSF_CLUMP_GRID_SCALE F32 2.5		# size of Sx,Sy image pixel
-
-PSF.RESIDUALS       BOOL  TRUE            # generate the residuals?
+PSF.RESIDUALS.RADIUS   		    F32   9.0           # keep this pixel if residual is more significant than this
+PSF.RESIDUALS.SPATIAL_ORDER 	    S32   1             # fit spatial variations of the residuals at this order (0,1)
 
 # PSF model parameters : choose the PSF model desired
-PSF_MODEL           STR  PS_MODEL_PS1_V1
-PSPHOT.CR.NSIGMA.SOFTEN             F32   0.0025            # Softening parameter for weights
+PSF_MODEL              	 	    STR   PS_MODEL_PS1_V1
+PSPHOT.CR.NSIGMA.SOFTEN             F32   0.0025        # Softening parameter for weights in CR stat
 
-PSF.TREND.MODE                      STR   MAP # other options: POLY_CHEB, POLY_ORD
 PSF.TREND.NX                        S32   3
 PSF.TREND.NY                        S32   3
 
-EXT_MIN_SN           F32  50.0           # fit galaxies above this S/N limit
-FULL_FIT_SN_LIM      F32  25.0
-MOMENTS_SN_MIN      F32    5.0
-AP_MIN_SN            F32   5.0
+# rename NONLINEAR_FIT_SN_LIM?
+FULL_FIT_SN_LIM      		    F32   25.0
 
-OUTPUT.FORMAT        STR  PS1_V2
+APTREND.ORDER.MAX    		    S32   3
 
-PSF_SHAPE_NSIGMA     F32  3.0		 # max significance for shape variation
-PSF_MAX_CHI          F32  50.0		 # reject objects worse that this
-
-MEASURE.APTREND      BOOL TRUE           ### XXX for now, skip this (too many errors)
-APTREND.ORDER.MAX    S32  3
-
-DIAGNOSTIC.PLOTS                    METADATA
+DIAGNOSTIC.PLOTS METADATA
   IMAGE.BACKGROUND.CELL.HISTOGRAM   BOOL  FALSE
   IMAGE.BACKGROUND.CELL.HISTOGRAM.X S32   32
@@ -58,8 +33,6 @@
 END
 
-USE_FOOTPRINTS                      BOOL  TRUE       	  # use new pmFootprint peak packaging
-
-DIFF	METADATA
-	BACKGROUND.XBIN	    S32  32            # size of background superpixels
-	BACKGROUND.YBIN	    S32  32            # size of background superpixels
+DIFF METADATA
+  BACKGROUND.XBIN		    S32  32            # size of background superpixels
+  BACKGROUND.YBIN	    	    S32  32            # size of background superpixels
 END
Index: trunk/ippconfig/isp/psphot.config
===================================================================
--- trunk/ippconfig/isp/psphot.config	(revision 25751)
+++ trunk/ippconfig/isp/psphot.config	(revision 25756)
@@ -1,76 +1,13 @@
 
 # turn these on to see specific outputs
-SAVE.BACKMDL	BOOL 	TRUE
-SAVE.BACKGND	BOOL 	TRUE
-SAVE.BACKSUB	BOOL 	TRUE
-SAVE.RESID	BOOL 	TRUE
-SAVE.PSF	BOOL 	TRUE
 SAVE.PLOTS      BOOL    TRUE
 
-# image statistics parameters
-IMSTATS_NPIX        S32  5000    	 # number of pixels to use for sky estimate boxes:
-SKY_STAT            STR  FITTED_MEAN_V4  # statistic used to measure background
-
-PSF_SN_LIM          F32  30              # minimum S/N for stars used for PSF model
-PSF_MAX_NSTARS      S32  300             # limit number of stars used for PSF model
-
+# PSF model parameters : choose the PSF model
 PSF_MODEL           STR  PS_MODEL_PGAUSS
 
-MOMENTS_SN_MIN      F32   30.0
-MOMENTS_AR_MAX      F32   2.0		 # maximum axial ratio: 1 / AR < (sx / sy) < AR
-
-#EXT_MIN_SN           F32  50.0           # fit galaxies above this S/N limit
-#FULL_FIT_SN_LIM      F32  50.0
-#AP_MIN_SN            F32  20.0
+# xxx check this:
 PSF_CLUMP_NSIGMA   F32  3.5             # region of Sx,Sy plane to use for selecting PSF stars
 
-# PSFTREND must be a 2D polynomial
-# the specified values are ignored but define the active components of the polynomial
-PSF.TREND.MASK  METADATA  
-   NORDER_X         S32       3                # number of x orders
-   NORDER_Y         S32       3                # number of y orders
-   VAL_X00_Y00      F64       1                # polynomial coefficient
-
-   VAL_X01_Y00      F64       1                # polynomial coefficient
-   VAL_X00_Y01      F64       1                # polynomial coefficient
-
-   VAL_X02_Y00      F64       1                # polynomial coefficient
-   VAL_X01_Y01      F64       1                # polynomial coefficient
-   VAL_X00_Y02      F64       1                # polynomial coefficient
-
-   VAL_X03_Y00      F64       1                # polynomial coefficient
-   VAL_X02_Y01      F64       1                # polynomial coefficient
-   VAL_X01_Y02      F64       1                # polynomial coefficient
-   VAL_X00_Y03      F64       1                # polynomial coefficient
-   NELEMENTS        S32       10               # number of unmasked components
-END  # folder for 4D polynomial
-
+# XXX set other 2D trends
 PSF.TREND.NX S32 4
 PSF.TREND.NY S32 4
-
-XMIN F32 15
-
-PSF.RESIDUALS       BOOL true
-PSF.RESIDUALS.SPATIAL_ORDER S32 1
-
-BREAK_POINT         STR  ENSEMBLE
-OUTPUT.FORMAT       STR  PS1_DEV_0
-
-PSPHOT.SUMMIT METADATA
- PEAKS_SMOOTH_SIGMA  F32  0.8 	   	 # peak significance threshold
- PEAKS_NSIGMA_LIMIT  F32  50.0 	   	 # peak significance threshold
- PEAKS_NMAX          S32  1000
- SAVE.RESID	BOOL 	FALSE
- PSF_SN_LIM          F32  25              # minimum S/N for stars used for PSF model
- MOMENTS_SN_MIN      F32   25.0
- PSF_MODEL         STR  PS_MODEL_PGAUSS
-END
-
-DIAGNOSTIC.PLOTS		METADATA
-  IMAGE.BACKGROUND.CELL.HISTOGRAM   BOOL FALSE
-  IMAGE.BACKGROUND.CELL.HISTOGRAM.X S32  4
-  IMAGE.BACKGROUND.CELL.HISTOGRAM.Y S32  7
-END
-
-SKY_BIAS F32 0.5
-AP_MIN_SN            F32  30.0
Index: trunk/ippconfig/lbc_red/psphot.config
===================================================================
--- trunk/ippconfig/lbc_red/psphot.config	(revision 25751)
+++ trunk/ippconfig/lbc_red/psphot.config	(revision 25756)
@@ -1,42 +1,6 @@
 
 # turn these on to see specific outputs
-SAVE.OUTPUT	BOOL 	TRUE
-SAVE.BACKMDL	BOOL 	TRUE
-SAVE.PSF	BOOL 	TRUE
 SAVE.PLOTS     	BOOL    TRUE
-
-BACKGROUND.XBIN	    S32  128            # size of background superpixels
-BACKGROUND.YBIN	    S32  128            # size of background superpixels
-
-# image background parameters
-IMSTATS_NPIX        S32  10000    	 # number of pixels to use for sky estimate boxes:
-SKY_STAT            STR  FITTED_MEAN_V4  # statistic used to measure background
-SKY_CLIP_SIGMA      F32  2.0             # statistic used to measure background
-
-PSF_SN_LIM          F32  100             # minimum S/N for stars used for PSF model
-PSF_MAX_NSTARS      S32  300             # limit number of stars used for PSF model
 
 # PSF model parameters : choose the PSF model desired
 PSF_MODEL           STR  PS_MODEL_QGAUSS
-
-MOMENTS_SN_MIN      F32   30.0
-EXT_MIN_SN           F32  50.0           # fit galaxies above this S/N limit
-FULL_FIT_SN_LIM      F32  50.0
-AP_MIN_SN            F32  50.0
-
-# OUTPUT.FORMAT       STR SMPDATA
-OUTPUT.FORMAT       STR PS1_DEV_1
-
-PSF_SHAPE_NSIGMA     F32  3.0		 # max significance for shape variation
-PSF_MAX_CHI          F32  50.0		 # reject objects worse that this
-
-#PSF.TREND.MODE STR MAP
-#PSF.TREND.NX   S32 1
-#PSF.TREND.NY   S32 1
-
-DIAGNOSTIC.PLOTS		METADATA
-  IMAGE.BACKGROUND.CELL.HISTOGRAM   BOOL FALSE
-  IMAGE.BACKGROUND.CELL.HISTOGRAM.X S32 -1
-  IMAGE.BACKGROUND.CELL.HISTOGRAM.Y S32 12
-END
-
Index: trunk/ippconfig/lulin/psphot.config
===================================================================
--- trunk/ippconfig/lulin/psphot.config	(revision 25751)
+++ trunk/ippconfig/lulin/psphot.config	(revision 25756)
@@ -1,43 +1,6 @@
 
 # turn these on to see specific outputs
-SAVE.OUTPUT	BOOL 	TRUE
-SAVE.BACKMDL	BOOL 	TRUE
-SAVE.PSF	BOOL 	TRUE
 SAVE.PLOTS     	BOOL    TRUE
-
-BACKGROUND.XBIN	    S32  128            # size of background superpixels
-BACKGROUND.YBIN	    S32  128            # size of background superpixels
-
-# image background parameters
-IMSTATS_NPIX        S32  10000    	 # number of pixels to use for sky estimate boxes:
-SKY_STAT            STR  FITTED_MEAN_V4  # statistic used to measure background
-SKY_CLIP_SIGMA      F32  2.0             # statistic used to measure background
-
-PSF_SN_LIM          F32  100             # minimum S/N for stars used for PSF model
-PSF_MAX_NSTARS      S32  300             # limit number of stars used for PSF model
 
 # PSF model parameters : choose the PSF model desired
 PSF_MODEL           STR  PS_MODEL_QGAUSS
-
-MOMENTS_SN_MIN      F32   30.0
-EXT_MIN_SN           F32  50.0           # fit galaxies above this S/N limit
-FULL_FIT_SN_LIM      F32  50.0
-AP_MIN_SN            F32  50.0
-
-# OUTPUT.FORMAT       STR SMPDATA
-OUTPUT.FORMAT       STR PS1_DEV_1
-
-PSF_SHAPE_NSIGMA     F32  3.0		 # max significance for shape variation
-PSF_MAX_CHI          F32  50.0		 # reject objects worse that this
-
-#PSF.TREND.MODE STR MAP
-#PSF.TREND.NX   S32 1
-#PSF.TREND.NY   S32 1
-
-DIAGNOSTIC.PLOTS		METADATA
-  IMAGE.BACKGROUND.CELL.HISTOGRAM   BOOL FALSE
-  IMAGE.BACKGROUND.CELL.HISTOGRAM.X S32 -1
-  IMAGE.BACKGROUND.CELL.HISTOGRAM.Y S32 12
-END
-
-USE_FOOTPRINTS                      BOOL  TRUE       	  # use new pmFootprint peak packaging
Index: trunk/ippconfig/megacam/psphot.config
===================================================================
--- trunk/ippconfig/megacam/psphot.config	(revision 25751)
+++ trunk/ippconfig/megacam/psphot.config	(revision 25756)
@@ -1,44 +1,10 @@
 
 # turn these on to see specific outputs
-SAVE.OUTPUT	BOOL 	TRUE
-SAVE.BACKMDL	BOOL 	TRUE
-SAVE.PSF	BOOL 	TRUE
 SAVE.PLOTS     	BOOL    TRUE
-
-BACKGROUND.XBIN	    S32  128            # size of background superpixels
-BACKGROUND.YBIN	    S32  128            # size of background superpixels
-
-# image background parameters
-IMSTATS_NPIX        S32  10000    	 # number of pixels to use for sky estimate boxes:
-SKY_STAT            STR  FITTED_MEAN_V4  # statistic used to measure background
-SKY_CLIP_SIGMA      F32  2.0             # statistic used to measure background
-
-PSF_SN_LIM          F32  20             # minimum S/N for stars used for PSF model
-PSF_MAX_NSTARS      S32  300             # limit number of stars used for PSF model
 
 # PSF model parameters : choose the PSF model desired
 PSF_MODEL           STR  PS_MODEL_QGAUSS
 
-PSF_MOMENTS_RADIUS  F32   10.0           # calculate initial source moments with this radius
-
-MOMENTS_SN_MIN      F32    2.0
-EXT_MIN_SN           F32  50.0           # fit galaxies above this S/N limit
-FULL_FIT_SN_LIM      F32  10.0
-AP_MIN_SN            F32   2.0
-
-PSF_SHAPE_NSIGMA     F32  3.0		 # max significance for shape variation
-PSF_MAX_CHI          F32  50.0		 # reject objects worse that this
-
 PSF.TREND.MODE STR MAP
 PSF.TREND.NX   S32 1
 PSF.TREND.NY   S32 1
-
-DIAGNOSTIC.PLOTS		METADATA
-  IMAGE.BACKGROUND.CELL.HISTOGRAM   BOOL FALSE
-  IMAGE.BACKGROUND.CELL.HISTOGRAM.X S32 -1
-  IMAGE.BACKGROUND.CELL.HISTOGRAM.Y S32 12
-END
-
-USE_FOOTPRINTS                      BOOL  TRUE       	  # use new pmFootprint peak packaging
-
-PEAKS_NSIGMA_LIMIT	F32	10.0
Index: trunk/ippconfig/mosaic2/camera.config
===================================================================
--- trunk/ippconfig/mosaic2/camera.config	(revision 25751)
+++ trunk/ippconfig/mosaic2/camera.config	(revision 25756)
@@ -90,4 +90,5 @@
   CMF.XSRC STR {CHIP.NAME}.xsrc # use .PSF and .EXT?
   CMF.XFIT STR {CHIP.NAME}.xfit # use .PSF and .EXT?
+  CMF.DETEFF STR {CHIP.NAME}.deteff
 
   PSF.HEAD  STR {CHIP.NAME}.hdr
Index: trunk/ippconfig/mosaic2/psphot.config
===================================================================
--- trunk/ippconfig/mosaic2/psphot.config	(revision 25751)
+++ trunk/ippconfig/mosaic2/psphot.config	(revision 25756)
@@ -1,44 +1,32 @@
 	
-# turn these on to see specific outputs
-SAVE.RESID	BOOL 	TRUE
+IMSTATS_NPIX                         S32   10000    	 # number of pixels to use for sky estimate boxes:
 
-IMSTATS_NPIX        S32  1000    	 # number of pixels to use for sky estimate boxes:
+# robust vs fitted??  gpc1 uses fitted...  robust median gives better background stdev --> test with flat-field photometry
+SKY_STAT                             STR   ROBUST_MEDIAN    # statistic used to measure background
 
-PSF_SN_LIM          F32  20             # minimum S/N for stars used for PSF model
-PSF_MAX_NSTARS      S32  300             # limit number of stars used for PSF model
+PSF_MODEL                            STR   PS_MODEL_QGAUSS
+PSF_MAX_NSTARS                       S32   300              # limit number of stars used for PSF model
 
-# PSF model parameters : choose the PSF model
-# list as many PSF_MODEL options as desired
-# if you want to list multiple entries, uncomment 'MULTI' here
-# PSF_MODEL           MULTI
-PSF_MODEL           STR  PS_MODEL_QGAUSS
-# PSF_MODEL           STR  PS_MODEL_GAUSS
-# PSF_MODEL           STR  PS_MODEL_PGAUSS
-# PSF_MODEL           STR  PS_MODEL_TGAUSS  ## not well tested, not very successful
+# Mosaic 2 has substantial IQ variations in the y-direction
+PSF_CLUMP_NX                         S32   1               # subdivide image in to NX x NY regions for 
+PSF_CLUMP_NY                         S32   3               # selecting PSF stars
 
-MOMENTS_SN_MIN       F32  10.0           # min S/N to measure moments
-EXT_MIN_SN           F32  20.0           # fit galaxies above this S/N limit
-FULL_FIT_SN_LIM      F32  20.0
-AP_MIN_SN            F32  25.0
+# Mosaic 2 has substantial IQ variations in the y-direction
+PSF.TREND.NX                         S32   1
+PSF.TREND.NY                         S32   3
 
-USE_FOOTPRINTS                      BOOL  TRUE       	  # use new pmFootprint peak packaging
+PEAKS_NSIGMA_LIMIT                   F32   15.0            # peak significance threshold
+FOOTPRINT_NSIGMA_LIMIT               F32   14.0      	  # threshold for bright pmFootprint detection
 
-## gene's overrides for testing:
-PEAKS_NSIGMA_LIMIT_2 F32  10.0 	   	 # peak significance threshold
+PSF_SN_LIM                           F32   20.0            # minimum S/N for stars used for PSF model
+FULL_FIT_SN_LIM                      F32   10.0
+EXT_MIN_SN                           F32   10.0           # fit galaxies above this S/N limit
 
-EXT_MODEL           STR  PS_MODEL_QGAUSS
+EXT_MODEL                            STR   PS_MODEL_QGAUSS
 
-TEST_FIT            BOOL FALSE
-TEST_FIT_X          F32  781
-TEST_FIT_Y          F32  830
+EXTENDED_SOURCE_SN_LIM               F32   3.0
+#EXTENDED_SOURCE_ANALYSIS            BOOL  TRUE  # perform any of the aperture-like measurements?
+#EXTENDED_SOURCE_PETROSIAN           BOOL  TRUE
 
-TEST_FIT_MODE       STR  CONV
-#TEST_FIT_MODE       STR PSF
-#TEST_FIT_MODE       STR  EXT
-
-#TEST_FIT_MODEL      STR  PS_MODEL_SERSIC
-TEST_FIT_MODEL      STR  PS_MODEL_QGAUSS
-TEST_MOMENTS_RADIUS F32 9.0
-OUTPUT.FORMAT       STR PS1_DEV_1
-
-PSF_MOMENTS_RADIUS  F32    7               # calculate initial source moments with this radius
+# 3 to match PSF and Moments 2D variations
+APTREND.ORDER.MAX                    S32   3
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
Index: trunk/ippconfig/sdss/psphot.config
===================================================================
--- trunk/ippconfig/sdss/psphot.config	(revision 25751)
+++ trunk/ippconfig/sdss/psphot.config	(revision 25756)
@@ -1,61 +1,8 @@
-
-# turn these on to see specific outputs
-SAVE.BACKMDL	BOOL 	TRUE
-#SAVE.BACKGND	BOOL 	TRUE
-#SAVE.BACKSUB	BOOL 	TRUE
-#SAVE.RESID	BOOL 	TRUE
-SAVE.PSF	BOOL 	TRUE
-SAVE.PLOTS      BOOL    TRUE
-
-# image statistics parameters
-IMSTATS_NPIX        S32  3000    	 # number of pixels to use for sky estimate boxes:
-
-PSF_SN_LIM          F32  10              # minimum S/N for stars used for PSF model
-PSF_MAX_NSTARS      S32  300             # limit number of stars used for PSF model
 
 PSF_MODEL         STR  PS_MODEL_QGAUSS
 
-MOMENTS_SN_MIN      F32   10.0
-#EXT_MIN_SN           F32  50.0           # fit galaxies above this S/N limit
-#FULL_FIT_SN_LIM      F32  50.0
-#AP_MIN_SN            F32  20.0
+# check:
 PSF_CLUMP_NSIGMA   F32  2.5             # region of Sx,Sy plane to use for selecting PSF stars
 
-# PSFTREND must be a 2D polynomial
-# the specified values are ignored but define the active components of the polynomial
-PSF.TREND.MASK  METADATA  
-   NORDER_X         S32       3                # number of x orders
-   NORDER_Y         S32       3                # number of y orders
-   VAL_X00_Y00      F64       1                # polynomial coefficient
-
-   VAL_X01_Y00      F64       1                # polynomial coefficient
-   VAL_X00_Y01      F64       1                # polynomial coefficient
-
-   VAL_X02_Y00      F64       1                # polynomial coefficient
-   VAL_X01_Y01      F64       1                # polynomial coefficient
-   VAL_X00_Y02      F64       1                # polynomial coefficient
-
-   VAL_X03_Y00      F64       1                # polynomial coefficient
-   VAL_X02_Y01      F64       1                # polynomial coefficient
-   VAL_X01_Y02      F64       1                # polynomial coefficient
-   VAL_X00_Y03      F64       1                # polynomial coefficient
-   NELEMENTS        S32       10               # number of unmasked components
-END  # folder for 4D polynomial
-
+# is this needed to mask bad regions?
 XMIN F32 15
-
-PSF.RESIDUALS       BOOL true
-PSF.RESIDUALS.SPATIAL_ORDER S32 1
-
-# BREAK_POINT         STR  ENSEMBLE
-OUTPUT.FORMAT       STR  PS1_DEV_0
-
-PSPHOT.SUMMIT METADATA
- PEAKS_SMOOTH_SIGMA  F32  0.8 	   	 # peak significance threshold
- PEAKS_NSIGMA_LIMIT  F32  50.0 	   	 # peak significance threshold
- PEAKS_NMAX          S32  1000
- SAVE.RESID	BOOL 	FALSE
- PSF_SN_LIM          F32  25              # minimum S/N for stars used for PSF model
- MOMENTS_SN_MIN      F32   25.0
- PSF_MODEL         STR  PS_MODEL_PGAUSS
-END
Index: trunk/ippconfig/sdssmosaic/psphot.config
===================================================================
--- trunk/ippconfig/sdssmosaic/psphot.config	(revision 25751)
+++ trunk/ippconfig/sdssmosaic/psphot.config	(revision 25756)
@@ -1,42 +1,15 @@
-
-# turn these on to see specific outputs
-SAVE.OUTPUT	BOOL 	TRUE
-SAVE.BACKMDL	BOOL 	TRUE
-#SAVE.RESID	BOOL 	TRUE
-#SAVE.BACKGND	BOOL 	TRUE
-SAVE.BACKSUB	BOOL 	TRUE
-SAVE.PSF	BOOL 	TRUE
-#LOAD.PSF	BOOL 	FALSE
-#SAVE.PLOTS     	BOOL    TRUE
-
-# for testing:
-# BREAK_POINT STR BACKMDL
-
 
 BACKGROUND.XBIN	    S32  256            # size of background superpixels
 BACKGROUND.YBIN	    S32  256            # size of background superpixels
 
-# image background parameters
-IMSTATS_NPIX        S32  10000    	 # number of pixels to use for sky estimate boxes:
-SKY_STAT            STR  FITTED_MEAN_V4  # statistic used to measure background
-SKY_CLIP_SIGMA      F32  2.0             # statistic used to measure background
-
-PEAKS_SMOOTH_SIGMA  F32   2.5            # smoothing kernel sigma in pixels
-PEAKS_NMAX          S32   5000           # on first pass, only keep NMAX peaks (0 == all)
-PEAKS_NSIGMA_LIMIT  F32   25.0           # peak significance threshold
-PEAKS_NSIGMA_LIMIT_2 F32   5.0           # peak significance threshold
-
-PSF_SN_LIM          F32  25              # minimum S/N for stars used for PSF model
-PSF_MAX_NSTARS      S32  300             # limit number of stars used for PSF model
+# what is the 2D variation of the SDSS PSF?
 PSF_CLUMP_NX        S32   3               # subdivide image in to NX x NY regions for 
 PSF_CLUMP_NY        S32   3               # selecting PSF stars
-PSF_MOMENTS_RADIUS  F32  12               # calculate initial source moments with this radius
+
+# test this:
 PSF_CLUMP_GRID_SCALE F32 2.5		# size of Sx,Sy image pixel
-
-PSF.RESIDUALS       BOOL  TRUE            # generate the residuals?
 
 # PSF model parameters : choose the PSF model desired
 PSF_MODEL           STR  PS_MODEL_PS1_V1
-PSPHOT.CR.NSIGMA.SOFTEN             F32   0.0025            # Softening parameter for weights
 
 # Use same default setting as in 2.6.1 (MAP is now global default)
@@ -45,32 +18,8 @@
 PSF.TREND.NY                        S32   0
 
-EXT_MIN_SN           F32  50.0           # fit galaxies above this S/N limit
-FULL_FIT_SN_LIM      F32  25.0
-MOMENTS_SN_MIN      F32    5.0
-AP_MIN_SN            F32   5.0
-
-OUTPUT.FORMAT        STR  PS1_V1
-
-PSF_SHAPE_NSIGMA     F32  3.0		 # max significance for shape variation
-PSF_MAX_CHI          F32  50.0		 # reject objects worse that this
-
-MEASURE.APTREND      BOOL TRUE           ### XXX for now, skip this (too many errors)
-APTREND.ORDER.MAX    S32  3
-
-# BREAK_POINT STR PASS1
-
+# match the SDSS radius:
 PSF_REF_RADIUS      F32  18.7            # aperture magnitudes are scaled via 
 					 # curve-of-growth to this radius
-
-DIAGNOSTIC.PLOTS                    METADATA
-  IMAGE.BACKGROUND.CELL.HISTOGRAM   BOOL  FALSE
-  IMAGE.BACKGROUND.CELL.HISTOGRAM.X S32   32
-  IMAGE.BACKGROUND.CELL.HISTOGRAM.Y S32   15
-END
-
-USE_FOOTPRINTS                      BOOL  TRUE       	  # use new pmFootprint peak packaging
-
-# Default is noap, nopsf; following recipes turn on one or both of these
-
+# for tests: Default is noap, nopsf; following recipes turn on one or both of these
 PSPHOT_NOAP_PSF METADATA
  PSF.TREND.MODE		STR	MAP
@@ -96,4 +45,5 @@
 END
 
+# put these values in the master?
 DIFF	METADATA
 	BACKGROUND.XBIN	    S32  32            # size of background superpixels
Index: trunk/ippconfig/simmosaic/psphot.config
===================================================================
--- trunk/ippconfig/simmosaic/psphot.config	(revision 25751)
+++ trunk/ippconfig/simmosaic/psphot.config	(revision 25756)
@@ -1,40 +1,3 @@
 
-SAVE.BACKMDL	BOOL 	TRUE
-SAVE.BACKGND	BOOL 	TRUE
-SAVE.BACKSUB	BOOL 	TRUE
-SAVE.PLOTS      BOOL    FALSE
-SAVE.RESID	BOOL 	TRUE
-SAVE.PSF	BOOL 	TRUE
-LOAD.PSF	BOOL 	FALSE
-
-IMSTATS_NPIX        S32  3000    	 # number of pixels to use for sky estimate boxes:
-SKY_INNER_RADIUS    F32    10            # square annulus for local sky measurement
-
-PSF_MOMENTS_RADIUS  F32    7               # calculate initial source moments with this radius
-
-
-
-#PSPHOT_TEST METADATA
-# SAVE.BACKSUB	BOOL 	FALSE
-# SAVE.RESID	BOOL 	TRUE
-#END
-#
-#PEAKS_OUTPUT_FILE   STR  peaks.dat
-#MOMENTS_OUTPUT_FILE STR  moments.dat
-
-#PSF_SN_LIM          F32  20.0            # minimum S/N for stars used for PSF model
-MOMENTS_SN_MIN      F32  10.0            # min S/N to measure moments
-FULL_FIT_SN_LIM     F32  100.0
-EXT_MIN_SN          F32  100.0           # fit galaxies above this S/N limit
-
-MOMENTS_SX_MAX                      F32   25.0
-MOMENTS_SY_MAX                      F32   25.0
-
-
-PEAKS_NSIGMA_LIMIT  F32  25.0 	   	 # peak significance threshold
-PEAKS_NSIGMA_LIMIT_2 F32  10.0 	   	 # peak significance threshold
-
-BREAK_POINT         STR  ENSEMBLE        # limit total processing for now (for speed)
-
-
-SKY_STAT            STR  ROBUST_MEDIAN   # statistic used to measure background
+# ppSim currently uses PS_MODEL_GAUSS
+PSF_MODEL                           STR   PS_MODEL_PGAUSS
Index: trunk/ippconfig/simple/psphot.config
===================================================================
--- trunk/ippconfig/simple/psphot.config	(revision 25751)
+++ trunk/ippconfig/simple/psphot.config	(revision 25756)
@@ -1,17 +1,2 @@
 
-SAVE.BACKMDL	BOOL 	FALSE
-SAVE.BACKGND	BOOL 	FALSE
-SAVE.BACKSUB	BOOL 	FALSE
-SAVE.PLOTS      BOOL    TRUE
 SAVE.RESID	BOOL 	TRUE
-SAVE.PSF	BOOL 	TRUE
-LOAD.PSF	BOOL 	FALSE
-
-IMSTATS_NPIX        S32  3000    	 # number of pixels to use for sky estimate boxes:
-
-MOMENTS_SN_MIN      F32  20.0           # min S/N to measure moments
-FULL_FIT_SN_LIM     F32  100.0
-EXT_MIN_SN          F32  100.0           # fit galaxies above this S/N limit
-
-PEAKS_NSIGMA_LIMIT  F32  10.0 	   	 # peak significance threshold
-USE_FOOTPRINTS      BOOL  T       	  # use new pmFootprint peak packaging
Index: trunk/ippconfig/simtest/camera.config
===================================================================
--- trunk/ippconfig/simtest/camera.config	(revision 25751)
+++ trunk/ippconfig/simtest/camera.config	(revision 25756)
@@ -64,4 +64,5 @@
   CMF.XSRC STR {CHIP.NAME}.xsrc # use .PSF and .EXT?
   CMF.XFIT STR {CHIP.NAME}.xfit # use .PSF and .EXT?
+  CMF.DETEFF STR {CHIP.NAME}.deteff
 
   PSF.HEAD  STR	{CHIP.NAME}.hdr
Index: trunk/ippconfig/simtest/format.config
===================================================================
--- trunk/ippconfig/simtest/format.config	(revision 25751)
+++ trunk/ippconfig/simtest/format.config	(revision 25756)
@@ -69,6 +69,6 @@
 	CELL.X0		S32	0
 	CELL.Y0		S32	0
-	CELL.XSIZE	S32	2048
-	CELL.YSIZE	S32	2048
+	CELL.XSIZE	S32	1024
+	CELL.YSIZE	S32	1024
 	CELL.XWINDOW	S32	0
 	CELL.YWINDOW	S32	0
Index: trunk/ippconfig/simtest/ppSim.config
===================================================================
--- trunk/ippconfig/simtest/ppSim.config	(revision 25751)
+++ trunk/ippconfig/simtest/ppSim.config	(revision 25756)
@@ -9,7 +9,66 @@
  BIAS            BOOL    FALSE
  FLAT            BOOL    FALSE
+ BIAS.LEVEL	 F32	 1000.0		# Bias level (e)
+ BIAS.RANGE	 F32	 20.0		# Range of bias values (e)
+ BIAS.ORDER	 S32 	 7		# Order for overscan polynomial
+
+ STARS.MAG	 F32	 10.0		# Brightest magnitude for fake stars
+ STARS.DENSITY	 F32     100.0		# Stellar density (per square degree) at the brightest magnitude
+ STARS.SIGMA.LIM F32     5.0            # significance of faintest sources
+ STARS.LUM	 F32	 0.35		# Stellar luminosity function slope (magnitude slope)
+END
+
+# for a quick test, we are going to skip shutter and dark corrections
+STACKTEST.MAKE  METADATA
+ PSF.MODEL       STR     PS_MODEL_PGAUSS
+ SHUTTER.TIME	 F32	 0.0
+ DARK.RATE       F32     0.0         
+ SCATTER.FRAC    F32     0.0
+ BIAS            BOOL    FALSE
+ FLAT            BOOL    FALSE
  BIAS.LEVEL	 F32	1000.0		# Bias level (e)
  BIAS.RANGE	 F32	20.0		# Range of bias values (e)
  BIAS.ORDER	 S32	7		# Order for overscan polynomial
+
+ # generate a set of fake stars
+ STARS.REAL	 BOOL	FALSE		# Add stars from a catalogue?
+ STARS.FAKE      BOOL   TRUE		# Add fake stars, randomly distributed?
+ MATCH.DENSITY   BOOL   TRUE            # significance of faintest sources
+
+ EXPTIME     	 F32    10.0
+ RA          	 F32    5.0
+ DEC         	 F32    5.0
+ PA          	 F32    0.0
+ SEEING      	 F32    1.0
+ SCALE       	 F32    0.25
+ ZEROPOINT   	 F32    25.0
+ SKY.MAGS    	 F32    22.0
 END
 
+# for a quick test, we are going to skip shutter and dark corrections
+STACKTEST.RUN  METADATA
+ PSF.MODEL       STR     PS_MODEL_GAUSS
+ SHUTTER.TIME	 F32	 0.0
+ DARK.RATE       F32     0.0         
+ SCATTER.FRAC    F32     0.0
+ BIAS            BOOL    FALSE
+ FLAT            BOOL    FALSE
+ BIAS.LEVEL	 F32	1000.0		# Bias level (e)
+ BIAS.RANGE	 F32	20.0		# Range of bias values (e)
+ BIAS.ORDER	 S32	7		# Order for overscan polynomial
+
+ # generate a set of fake stars
+ STARS.REAL	 BOOL	TRUE		# Add stars from a catalogue?
+ STARS.FAKE      BOOL   FALSE		# Add fake stars, randomly distributed?
+ MATCH.DENSITY   BOOL   TRUE            # significance of faintest sources
+
+ EXPTIME     	 F32    10.0
+ RA          	 F32    5.0
+ DEC         	 F32    5.0
+ PA          	 F32    0.0
+ SEEING      	 F32    1.0
+ SCALE       	 F32    0.25
+ ZEROPOINT   	 F32    25.0
+ SKY.MAGS    	 F32    22.0
+END
+
Index: trunk/ippconfig/simtest/psastro.config
===================================================================
--- trunk/ippconfig/simtest/psastro.config	(revision 25751)
+++ trunk/ippconfig/simtest/psastro.config	(revision 25756)
@@ -3,5 +3,5 @@
 
 PSASTRO.GRID.OFFSET    F32    500.
-PSASTRO.GRID.SCALE     F32     50.
+PSASTRO.GRID.SCALE     F32     10.
 
 PSASTRO.IGNORE         STR    CRLIMIT,SATURATED,DEFECT,BLEND
@@ -9,5 +9,5 @@
 PSASTRO.CATDIR		STR	SYNTH.SIMTEST
 DVO.GETSTAR.PHOTCODE	STR	r
-PSASTRO.MAX.NSTAR	S32	50	# max stars accepted for fitting
+PSASTRO.MAX.NSTAR	S32	200	# max stars accepted for fitting
 DVO.GETSTAR.MAX.RHO     F32    10000.0
 DVO.GETSTAR.MIN.MAG     F32      10.0
@@ -34,2 +34,3 @@
   PHOTCODE STR z_SYNTH
 END
+
Index: trunk/ippconfig/simtest/psphot.config
===================================================================
--- trunk/ippconfig/simtest/psphot.config	(revision 25751)
+++ trunk/ippconfig/simtest/psphot.config	(revision 25756)
@@ -1,36 +1,4 @@
 
-SAVE.BACKMDL	BOOL 	TRUE
-SAVE.BACKGND	BOOL 	TRUE
-SAVE.BACKSUB	BOOL 	TRUE
-SAVE.PLOTS      BOOL    TRUE
-SAVE.RESID	BOOL 	TRUE
-SAVE.PSF	BOOL 	TRUE
-LOAD.PSF	BOOL 	FALSE
-
-IMSTATS_NPIX        S32  3000    	 # number of pixels to use for sky estimate boxes:
-SKY_INNER_RADIUS    F32    10            # square annulus for local sky measurement
-
-PSF_MOMENTS_RADIUS  F32    7               # calculate initial source moments with this radius
-
-#PSPHOT_TEST METADATA
-# SAVE.BACKSUB	BOOL 	FALSE
-# SAVE.RESID	BOOL 	TRUE
-#END
-#
-#PEAKS_OUTPUT_FILE   STR  peaks.dat
-#MOMENTS_OUTPUT_FILE STR  moments.dat
-
-#PSF_SN_LIM          F32  20.0            # minimum S/N for stars used for PSF model
-MOMENTS_SN_MIN      F32  10.0            # min S/N to measure moments
-FULL_FIT_SN_LIM     F32  100.0
-EXT_MIN_SN          F32  100.0           # fit galaxies above this S/N limit
-
-MOMENTS_SX_MAX                      F32   25.0
-MOMENTS_SY_MAX                      F32   25.0
-
-PEAKS_NSIGMA_LIMIT   F32  25.0 	 	 # peak significance threshold
-PEAKS_NSIGMA_LIMIT_2 F32  10.0 	   	 # peak significance threshold
-BREAK_POINT         STR  NONE            # limit total processing for now (for speed)
-
-
-SKY_STAT            STR  ROBUST_MEDIAN   # statistic used to measure background
+# same as ppSim.config (if YES, <apResid> should be 0.0)
+# ppSim currently uses PS_MODEL_GAUSS
+PSF_MODEL                           STR   PS_MODEL_PGAUSS
Index: trunk/ippconfig/tek/psphot.config
===================================================================
--- trunk/ippconfig/tek/psphot.config	(revision 25751)
+++ trunk/ippconfig/tek/psphot.config	(revision 25756)
@@ -1,57 +1,3 @@
-
-# turn these on to see specific outputs
-#SAVE.BACKMDL	BOOL 	TRUE
-#SAVE.BACKGND	BOOL 	TRUE
-#SAVE.BACKSUB	BOOL 	TRUE
-SAVE.RESID	BOOL 	TRUE
-#SAVE.PSF	BOOL 	TRUE
-
-# image statistics parameters
-IMSTATS_NPIX        S32  3000    	 # number of pixels to use for sky estimate boxes:
-
-PSF_SN_LIM          F32  10              # minimum S/N for stars used for PSF model
-PSF_MAX_NSTARS      S32  300             # limit number of stars used for PSF model
 
 PSF_MODEL         STR  PS_MODEL_QGAUSS
 
-MOMENTS_SN_MIN      F32   10.0
-#EXT_MIN_SN           F32  50.0           # fit galaxies above this S/N limit
-#FULL_FIT_SN_LIM      F32  50.0
-#AP_MIN_SN            F32  20.0
-PSF_CLUMP_NSIGMA   F32  2.5             # region of Sx,Sy plane to use for selecting PSF stars
-
-# PSFTREND must be a 2D polynomial
-# the specified values are ignored but define the active components of the polynomial
-PSF.TREND.MASK  METADATA  
-   NORDER_X         S32       3                # number of x orders
-   NORDER_Y         S32       3                # number of y orders
-   VAL_X00_Y00      F64       1                # polynomial coefficient
-
-   VAL_X01_Y00      F64       1                # polynomial coefficient
-   VAL_X00_Y01      F64       1                # polynomial coefficient
-
-   VAL_X02_Y00      F64       1                # polynomial coefficient
-   VAL_X01_Y01      F64       1                # polynomial coefficient
-   VAL_X00_Y02      F64       1                # polynomial coefficient
-
-   VAL_X03_Y00      F64       1                # polynomial coefficient
-   VAL_X02_Y01      F64       1                # polynomial coefficient
-   VAL_X01_Y02      F64       1                # polynomial coefficient
-   VAL_X00_Y03      F64       1                # polynomial coefficient
-   NELEMENTS        S32       10               # number of unmasked components
-END  # folder for 4D polynomial
-
-XMIN F32 15
-PSF.RESIDUALS       BOOL false
-BREAK_POINT         STR  ENSEMBLE
-OUTPUT.FORMAT       STR  PS1_DEV_0
-
-PSPHOT.SUMMIT METADATA
- PEAKS_SMOOTH_SIGMA  F32  0.8 	   	 # peak significance threshold
- PEAKS_NSIGMA_LIMIT  F32  50.0 	   	 # peak significance threshold
- PEAKS_NMAX          S32  1000
- SAVE.RESID	BOOL 	FALSE
- PSF_SN_LIM          F32  25              # minimum S/N for stars used for PSF model
- MOMENTS_SN_MIN      F32   25.0
- PSF_MODEL         STR  PS_MODEL_PGAUSS
-END
Index: trunk/ippconfig/ucam/psphot.config
===================================================================
--- trunk/ippconfig/ucam/psphot.config	(revision 25751)
+++ trunk/ippconfig/ucam/psphot.config	(revision 25756)
@@ -1,27 +1,2 @@
 
-# turn these on to see specific outputs
-#SAVE.BACKMDL	BOOL 	TRUE
-#SAVE.BACKGND	BOOL 	TRUE
-#SAVE.BACKSUB	BOOL 	TRUE
-SAVE.RESID	BOOL 	TRUE
-#SAVE.PSF	BOOL 	TRUE
-#LOAD.PSF	BOOL 	FALSE
-
-IMSTATS_NPIX        S32  1000    	 # number of pixels to use for sky estimate boxes:
-
-PSF_SN_LIM          F32  100             # minimum S/N for stars used for PSF model
-PSF_MAX_NSTARS      S32  300             # limit number of stars used for PSF model
-
-# PSF model parameters : choose the PSF model
-# list as many PSF_MODEL options as desired
-# if you want to list multiple entries, uncomment 'MULTI' here
-# PSF_MODEL           MULTI
 PSF_MODEL           STR  PS_MODEL_QGAUSS
-# PSF_MODEL           STR  PS_MODEL_GAUSS
-# PSF_MODEL           STR  PS_MODEL_PGAUSS
-# PSF_MODEL           STR  PS_MODEL_TGAUSS  ## not well tested, not very successful
-
-MOMENTS_SN_MIN      F32  20.0           # min S/N to measure moments
-EXT_MIN_SN           F32  50.0           # fit galaxies above this S/N limit
-FULL_FIT_SN_LIM      F32  50.0
-AP_MIN_SN            F32  25.0
Index: trunk/ippconfig/uh8k/psphot.config
===================================================================
--- trunk/ippconfig/uh8k/psphot.config	(revision 25751)
+++ trunk/ippconfig/uh8k/psphot.config	(revision 25756)
@@ -1,37 +1,5 @@
-
-# turn these on to see specific outputs
-SAVE.OUTPUT	BOOL 	TRUE
-SAVE.BACKMDL	BOOL 	TRUE
-SAVE.PSF	BOOL 	TRUE
-SAVE.PLOTS     	BOOL    TRUE
-
-BACKGROUND.XBIN	    S32  128            # size of background superpixels
-BACKGROUND.YBIN	    S32  128            # size of background superpixels
-
-# image background parameters
-IMSTATS_NPIX        S32  10000    	 # number of pixels to use for sky estimate boxes:
-SKY_STAT            STR  FITTED_MEAN_V4  # statistic used to measure background
-SKY_CLIP_SIGMA      F32  2.0             # statistic used to measure background
-
-PSF_SN_LIM          F32  100             # minimum S/N for stars used for PSF model
-PSF_MAX_NSTARS      S32  300             # limit number of stars used for PSF model
 
 # PSF model parameters : choose the PSF model desired
 PSF_MODEL           STR  PS_MODEL_QGAUSS
-
-MOMENTS_SN_MIN      F32   30.0
-EXT_MIN_SN           F32  50.0           # fit galaxies above this S/N limit
-FULL_FIT_SN_LIM      F32  50.0
-AP_MIN_SN            F32  50.0
-
-# OUTPUT.FORMAT       STR SMPDATA
-OUTPUT.FORMAT       STR PS1_DEV_1
-
-PSF_SHAPE_NSIGMA     F32  3.0		 # max significance for shape variation
-PSF_MAX_CHI          F32  50.0		 # reject objects worse that this
-
-#PSF.TREND.MODE STR MAP
-#PSF.TREND.NX   S32 1
-#PSF.TREND.NY   S32 1
 
 DIAGNOSTIC.PLOTS		METADATA
@@ -40,4 +8,2 @@
   IMAGE.BACKGROUND.CELL.HISTOGRAM.Y S32 12
 END
-
-USE_FOOTPRINTS                      BOOL  TRUE       	  # use new pmFootprint peak packaging
Index: trunk/ippconfig/vysos5/psphot.config
===================================================================
--- trunk/ippconfig/vysos5/psphot.config	(revision 25751)
+++ trunk/ippconfig/vysos5/psphot.config	(revision 25756)
@@ -1,31 +1,16 @@
 
-SAVE.BACKMDL	BOOL 	TRUE
-SAVE.BACKGND	BOOL 	FALSE
-SAVE.BACKSUB	BOOL 	FALSE
-SAVE.PLOTS      BOOL    TRUE
-SAVE.RESID	BOOL 	FALSE
-SAVE.PSF	BOOL 	TRUE
-LOAD.PSF	BOOL 	FALSE
+# XXX check on this value
+PSF_CLUMP_NSIGMA                    F32   3.5             # region of Sx,Sy plane to use for selecting PSF stars
 
-PEAKS_NSIGMA_LIMIT                  F32   20.0            # peak significance threshold
-PEAKS_NSIGMA_LIMIT_2                F32   10.0             # peak significance threshold
-PSF_MOMENTS_RADIUS  		    F32    7               # calculate initial source moments with this radius
-PSF_CLUMP_NSIGMA                    F32   3.5             # region of Sx,Sy plane to use for selecting PSF stars
-PSF_MAX_NSTARS                      S32   400             # limit number of stars used for PSF model
-MEASURE.APTREND	                    BOOL  TRUE
-
+# do we want to do 2-pass analysis?
 BREAK_POINT                         STR   PASS1     
 
+# keep these large since psfs are so undersampled
 PSPHOT.CR.NSIGMA.LIMIT              F32   5.0  # sources with crNsigma greater that this get tagged as likely cosmic rays
 PSPHOT.EXT.NSIGMA.LIMIT             F32   5.0  # sources with extNsigma greater that this get tagged as likely extended sources
 
-USE_FOOTPRINTS                      BOOL  TRUE       	  # use new pmFootprint peak packaging
-FOOTPRINT_NPIXMIN                   S32   5       	  # Minimum size of a pmFootprint
-FOOTPRINT_NSIGMA_LIMIT              F32   10      	  # threshold for bright pmFootprint detection
-FOOTPRINT_NSIGMA_LIMIT_2            F32   10       	  # threshold for faint pmFootprint detection
+# small psfs so small grow radius
 FOOTPRINT_GROW_RADIUS               S32   1       	  # How much to grow bright footprints
 FOOTPRINT_GROW_RADIUS_2             S32   2       	  # 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
 
 PSF_MODEL                           STR   PS_MODEL_PGAUSS
