Index: /trunk/ippconfig/sdssmosaic/psphot.config
===================================================================
--- /trunk/ippconfig/sdssmosaic/psphot.config	(revision 20556)
+++ /trunk/ippconfig/sdssmosaic/psphot.config	(revision 20557)
@@ -1,47 +1,34 @@
 
 # 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.RESID	BOOL 	TRUE
+SAVE.BACKSUB	BOOL 	TRUE
 SAVE.PSF	BOOL 	TRUE
-SAVE.PLOTS      BOOL    TRUE
+#LOAD.PSF	BOOL 	FALSE
+#SAVE.PLOTS     	BOOL    TRUE
 
-# image statistics parameters
-IMSTATS_NPIX        S32  3000    	 # number of pixels to use for sky estimate boxes:
+BACKGROUND.XBIN	    S32  256            # size of background superpixels
+BACKGROUND.YBIN	    S32  256            # size of background superpixels
 
-PSF_SN_LIM          F32  10              # minimum S/N for stars used for PSF model
+# 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  10.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_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
-# This is where aperture correction gets turned on and off - used to be false up to 2008-10-06
-MEASURE.APTREND	                    BOOL  FALSE
-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
+# PSF model parameters : choose the PSF model desired
+PSF_MODEL           STR  PS_MODEL_PS1_V1
 
 # Use same default setting as in 2.6.1 (MAP is now global default)
@@ -50,36 +37,50 @@
 PSF.TREND.NY                        S32   0
 
-# Turn on variable PSF fitting - MAP tries to trade off between not having many stars and not having many bins.
-# Try nx, ny up to 3 or 5.
-# Note that MAP with NX, NY = 1 is the default in recipes/psphot.config now!
-# PSF.TREND.MODE	STR	MAP
-# PSF.TREND.NX		S32	5
-# PSF.TREND.NY		S32	5
+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
 
-XMIN F32 15
+OUTPUT.FORMAT       STR PS1_DEV_1
 
-PSF.RESIDUALS       BOOL true
-PSF.RESIDUALS.SPATIAL_ORDER S32 1
+PSF_SHAPE_NSIGMA     F32  3.0		 # max significance for shape variation
+PSF_MAX_CHI          F32  50.0		 # reject objects worse that this
+APTREND.ORDER.MAX    S32  1
 
-# The parameter BREAK_POINT stopped the analysis after first linear
-# fit to sources.  Should be NONE or commented out.
-# BREAK_POINT         STR  ENSEMBLE
-OUTPUT.FORMAT       STR  PS1_DEV_1
+MEASURE.APTREND      BOOL TRUE           ### XXX for now, skip this (too many errors)
+# BREAK_POINT STR PASS1
 
-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
+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
 
-# Turn on use of footprints to avoid objectcs being found in
-# diffraction spikes etc. of bright stars
-USE_FOOTPRINTS			BOOL	T	# use new pmFootprint peak packaging
+USE_FOOTPRINTS                      BOOL  TRUE       	  # use new pmFootprint peak packaging
 
-# Set aperture correction radius to same 7.4" as SDSS (see EDR paper)
-PSF_REF_RADIUS      F32  18.7            # aperture magnitudes are scaled via 
-					 # curve-of-growth to this radius
+# Default is noap, nopsf; following recipes turn on one or both of these
+
+PSPHOT_NOAP_PSF METADATA
+ PSF.TREND.MODE		STR	MAP
+ PSF.TREND.NX		S32	3
+ PSF.TREND.NY		S32	3
+ MEASURE.APTREND        BOOL  FALSE
+END
+
+PSPHOT_AP_NOPSF METADATA
+ PSF.TREND.MODE		STR	POLY_ORD
+ PSF.TREND.NX		S32	0
+ PSF.TREND.NY		S32	0
+ MEASURE.APTREND        BOOL  TRUE
+END
+
+PSPHOT_AP_PSF METADATA
+ PSF.TREND.MODE		STR	MAP
+ PSF.TREND.NX		S32	3
+ PSF.TREND.NY		S32	3
+ MEASURE.APTREND        BOOL  TRUE
+END
+
