Index: /trunk/ippconfig/gpc1/camera.config
===================================================================
--- /trunk/ippconfig/gpc1/camera.config	(revision 31162)
+++ /trunk/ippconfig/gpc1/camera.config	(revision 31163)
@@ -136,4 +136,5 @@
   CMF.DATA STR {CHIP.NAME}.psf # use .PSF and .EXT?
   CMF.XSRC STR {CHIP.NAME}.xsrc # use .PSF and .EXT?
+  CMF.XRAD STR {CHIP.NAME}.xrad # use .PSF and .EXT?
   CMF.XFIT STR {CHIP.NAME}.xfit # use .PSF and .EXT?
   CMF.DETEFF STR {CHIP.NAME}.deteff
Index: /trunk/ippconfig/gpc1/ppStack.config
===================================================================
--- /trunk/ippconfig/gpc1/ppStack.config	(revision 31162)
+++ /trunk/ippconfig/gpc1/ppStack.config	(revision 31163)
@@ -38,2 +38,7 @@
     OUTPUT.LOGFLUX  BOOL    TRUE
 END
+
+# Recipe overrides for STACK
+STACKPHOT METADATA
+  PSF.MODEL	STR	PS_MODEL_QGAUSS	# Model for PSF match
+END
Index: /trunk/ippconfig/gpc1/psastro.config
===================================================================
--- /trunk/ippconfig/gpc1/psastro.config	(revision 31162)
+++ /trunk/ippconfig/gpc1/psastro.config	(revision 31163)
@@ -15,5 +15,7 @@
 PSASTRO.GRID.OFFSET    F32    1000.
 PSASTRO.GRID.SCALE     F32      50
-PSASTRO.GRID.NSTAR.MAX S32     800 # max stars accepted for fitting
+PSASTRO.GRID.NSTAR.MAX S32     800 # deprecated 
+PSASTRO.GRID.NREF.MAX  S32     800 # max stars accepted for fitting from ref catalog
+PSASTRO.GRID.NRAW.MAX  S32    1200 # max stars accepted for fitting from raw image
 
 PSASTRO.MAX.NRAW      S32      1000   # max stars accepted for fitting (0 for all)
@@ -24,5 +26,5 @@
 
 # 
-PSASTRO.MIN.INST.MAG.RAW       F32     -17.0   # min instrumental magnitude for stars accepted for fitting
+PSASTRO.MIN.INST.MAG.RAW       F32     -15.0   # min instrumental magnitude for stars accepted for fitting
 PSASTRO.MAX.INST.MAG.RAW       F32      -8.0   # max instrumental magnitude for stars accepted for fitting
 
@@ -44,6 +46,6 @@
 PSASTRO.MATCH.RADIUS.N5 F32    10
 PSASTRO.MATCH.RADIUS.N6 F32    10
-PSASTRO.MATCH.RADIUS.N7 F32     5
-PSASTRO.MATCH.FIT.NITER S32     8
+PSASTRO.MATCH.RADIUS.N7 F32    5
+PSASTRO.MATCH.FIT.NITER S32    8
 
 # for iterations >= N, require a single match per reference
@@ -304,2 +306,30 @@
     PSASTRO.CATDIR              STR      SAS.REF.V1
 END
+
+# these values worked to get solutions for the STS observations from 2009 & 2010
+# these field has damage from excessive persistence and the impact of burntool
+STS_DATASET  METADATA
+
+  # need to boost the total number of stars available for the fit:
+  # allow more stars per chip and boost the density to which we query
+  # from the reference database.
+  PSASTRO.MAX.NRAW      S32      2000   # 
+  PSASTRO.MAX.NREF      S32      8000   # max stars accepted for fitting (0 for all)
+  DVO.GETSTAR.MAX.RHO   F32      60000.0
+  
+  # the crowding is high, so unless we restrict somewhat tightly early
+  # on, we get very noisy (and wrong) fits.  These values are probably
+  # too restrictive for the general observation: we would risk missing
+  # matches.
+
+  # single-chip radius match in pixels
+  PSASTRO.MATCH.RADIUS.N0 F32    10
+  PSASTRO.MATCH.RADIUS.N1 F32    5
+  PSASTRO.MATCH.RADIUS.N2 F32    5
+  PSASTRO.MATCH.RADIUS.N3 F32    5
+  PSASTRO.MATCH.RADIUS.N4 F32    3
+  PSASTRO.MATCH.RADIUS.N5 F32    3
+  PSASTRO.MATCH.RADIUS.N6 F32    5
+  PSASTRO.MATCH.RADIUS.N7 F32    5
+  PSASTRO.MATCH.FIT.NITER S32    5
+END
Index: /trunk/ippconfig/gpc1/psphot.config
===================================================================
--- /trunk/ippconfig/gpc1/psphot.config	(revision 31162)
+++ /trunk/ippconfig/gpc1/psphot.config	(revision 31163)
@@ -1,5 +1,7 @@
 
-BACKGROUND.XBIN	                    S32   256           # size of background superpixels
-BACKGROUND.YBIN	                    S32   256           # size of background superpixels
+BACKGROUND.XBIN                     S32   400             # size of background superpixels
+BACKGROUND.YBIN                     S32   400             # size of background superpixels
+BACKGROUND.XSAMPLE                  F32   2.0             # size of background superpixels
+BACKGROUND.YSAMPLE                  F32   2.0             # size of background superpixels
 
 SOFTEN.VARIANCE                     BOOL  TRUE          # XXX drop? soften the errors for bright pixels
@@ -31,6 +33,6 @@
 DIAGNOSTIC.PLOTS METADATA
   IMAGE.BACKGROUND.CELL.HISTOGRAM   BOOL  FALSE
-  IMAGE.BACKGROUND.CELL.HISTOGRAM.X S32   32
-  IMAGE.BACKGROUND.CELL.HISTOGRAM.Y S32   15
+  IMAGE.BACKGROUND.CELL.HISTOGRAM.X S32   8
+  IMAGE.BACKGROUND.CELL.HISTOGRAM.Y S32   8
 END
 
Index: /trunk/ippconfig/recipes/ppSim.config
===================================================================
--- /trunk/ippconfig/recipes/ppSim.config	(revision 31162)
+++ /trunk/ippconfig/recipes/ppSim.config	(revision 31163)
@@ -89,4 +89,5 @@
 GALAXY.GRID.DY     S32    200             # Spacing between galaxies in grid in y
 GALAXY.GRID.RANDOM BOOL   FALSE		# randomize shape parameters in grid (or sequence?)
+GALAXY.GRID.PEAK   F32    100.0		# peak flux of the grid galaxies
 
 GALAXY.MODEL     STR    PS_MODEL_GAUSS
Index: /trunk/ippconfig/recipes/ppStack.config
===================================================================
--- /trunk/ippconfig/recipes/ppStack.config	(revision 31162)
+++ /trunk/ippconfig/recipes/ppStack.config	(revision 31163)
@@ -5,5 +5,5 @@
 
 COMBINE.ITER	F32	0.5		# Number of rejection iterations per input
-COMBINE.REJ	F32	2.5		# Rejection threshold in combination (sigma)
+COMBINE.REJ	F32	3.5		# Rejection threshold in combination (sigma)
 COMBINE.SYS	F32	0.1		# Relative systematic error in combination
 COMBINE.DISCARD	F32	0.2		# Discard fraction for Olympic weighted mean
@@ -74,4 +74,5 @@
 	w	F32	25.0
 END
+ZP.AIRMASS.TARGET F32 1.0
 
 PSF.INSTANCES	S32	15		# Number of instances for PSF generation
@@ -82,4 +83,7 @@
 PSF.AUTOSIZE	BOOL	TRUE		# Determine output PSF size from input PSFs?
 PSF.OUTPUT.FWHM	F32	5.0		# Target size for output PSF (if not auto-sized)
+
+PSF.INPUT.MAX           F32  NAN
+PSF.INPUT.CLIP.NSIGMA   F32  NAN
 
 TEMP.IMAGE	STR	conv.im.fits	# Suffix for temporary convolved images
@@ -100,4 +104,7 @@
 END
 
+# Recipe overrides for STACK
+STACKPHOT METADATA
+END
 
 # Debugging
Index: /trunk/ippconfig/recipes/ppSub.config
===================================================================
--- /trunk/ippconfig/recipes/ppSub.config	(revision 31162)
+++ /trunk/ippconfig/recipes/ppSub.config	(revision 31163)
@@ -125,4 +125,12 @@
 END
 
+# Difference of two stacks : uses SINGLE not DUAL convolution
+STACKPHOT	METADATA
+	DUAL		BOOL	FALSE	# Dual convolution?
+	INVERSE		BOOL	FALSE   # Generate inverse subtraction?
+	PHOTOMETRY	BOOL	TRUE	# Perform photometry?
+	CONVOLVE.TARGET STR     SINGLE2	# convolution direction
+END
+
 # Difference of warp - stack
 WARPSTACK_FORCED     METADATA
Index: /trunk/ippconfig/recipes/psastro.config
===================================================================
--- /trunk/ippconfig/recipes/psastro.config	(revision 31162)
+++ /trunk/ippconfig/recipes/psastro.config	(revision 31163)
@@ -40,5 +40,7 @@
 PSASTRO.GRID.OFFSET    F32  10000.
 PSASTRO.GRID.SCALE     F32    500.
-PSASTRO.GRID.NSTAR.MAX S32    300 # max stars accepted for fitting
+PSASTRO.GRID.NSTAR.MAX S32    300 # deprecated
+PSASTRO.GRID.NREF.MAX  S32    500 # max stars accepted for fitting
+PSASTRO.GRID.NRAW.MAX  S32   1000 # max stars accepted for fitting
 
 # sources with these mask flags raised should be ignored
@@ -244,2 +246,4 @@
 END
 
+STS_DATASET METADATA
+END
Index: /trunk/ippconfig/recipes/psphot.config
===================================================================
--- /trunk/ippconfig/recipes/psphot.config	(revision 31162)
+++ /trunk/ippconfig/recipes/psphot.config	(revision 31163)
@@ -11,4 +11,8 @@
 LOAD.PSF                            BOOL  FALSE
 
+# optional outputs for psphotStack
+SAVE.CNV                            BOOL  FALSE
+SAVE.CHISQ                          BOOL  FALSE
+
 # format for output CMF files
 OUTPUT.FORMAT                       STR   PS1_V3
@@ -20,4 +24,6 @@
 BACKGROUND.XBIN                     S32   128             # size of background superpixels
 BACKGROUND.YBIN                     S32   128             # size of background superpixels
+BACKGROUND.XSAMPLE                  F32   1.0             # size of background superpixels
+BACKGROUND.YSAMPLE                  F32   1.0             # size of background superpixels
 IMSTATS_NPIX                        S32   10000           # number of pixels to use for sky estimate boxes:
 
@@ -175,4 +181,5 @@
 EXTENDED_SOURCE_ANNULI              BOOL  FALSE
 EXTENDED_SOURCE_KRON                BOOL  FALSE
+PETROSIAN_FOR_STARS                 BOOL  FALSE
 
 # Extended source fit parameters
@@ -290,4 +297,8 @@
 TEST_FIT_PAR                        F32   NAN
 
+IMAGE.BACKGROUND.CELL.HISTOGRAM   BOOL  FALSE
+IMAGE.BACKGROUND.CELL.HISTOGRAM.X S32   0
+IMAGE.BACKGROUND.CELL.HISTOGRAM.Y S32   0
+
 DIAGNOSTIC.PLOTS                    METADATA
   IMAGE.BACKGROUND.CELL.HISTOGRAM   BOOL  FALSE
@@ -327,17 +338,4 @@
 
 # Extended source fit parameters
-STACKPHOT_TEST                       METADATA
-  EXTENDED_SOURCE_ANALYSIS            BOOL  TRUE  # perform any of the aperture-like measurements?
-  EXTENDED_SOURCE_SN_LIM              F32   20.0
-  EXTENDED_SOURCE_PETROSIAN           BOOL  TRUE
-  EXTENDED_SOURCE_ISOPHOTAL           BOOL  FALSE
-  EXTENDED_SOURCE_ANNULI              BOOL  TRUE
-  EXTENDED_SOURCE_KRON                BOOL  FALSE
-  PSPHOT.STACK.MATCH.PSF.SOURCE       STR   AUTO # which inputs to convolve? (RAW, CNV, AUTO)
-  PSPHOT.STACK.TARGET.PSF.AUTO        BOOL  F    # automatically determine target PSF size?
-  PSPHOT.STACK.TARGET.PSF.FWHM        F32   4.5  # FWHM of target PSF (if NOT AUTO sized; pixels)
-END
-
-# Extended source fit parameters
 STACKPHOT                             METADATA
   EXTENDED_SOURCE_FITS                BOOL  TRUE  # perform any of the aperture-like measurements?
@@ -348,5 +346,6 @@
   PSPHOT.STACK.MATCH.PSF.SOURCE       STR   AUTO # which inputs to convolve? (RAW, CNV, AUTO)
   PSPHOT.STACK.TARGET.PSF.AUTO        BOOL  F    # automatically determine target PSF size?
-  @PSPHOT.STACK.TARGET.PSF.FWHM        F32   5.0 6.5 8.0 # FWHM of target PSF (if NOT AUTO sized; pixels)
+  PSPHOT.STACK.USE.RAW                BOOL  F    # perform photometry & morphology analysis on the raw image
+  @PSPHOT.STACK.TARGET.PSF.FWHM       F32   6.5 8.0 # FWHM of target PSF (if NOT AUTO sized; pixels)
   RADIAL_APERTURES                    BOOL  T    # calculate flux in circular radial apertures?
   RADIAL_APERTURES_SN_LIM             F32   0.0  # S/N limit for radial aperture calculation
@@ -354,5 +353,25 @@
 
   EXT_FIT_MAX_RADIUS                  F32   50.0
-  PSF_MODEL                           STR   PS_MODEL_GAUSS 
+  PSF_MODEL                           STR   PS_MODEL_QGAUSS 
+  EXT_MODEL                           STR   PS_MODEL_SERSIC
+END
+
+# Extended source fit parameters
+STACKPHOT_TEST                        METADATA
+  EXTENDED_SOURCE_FITS                BOOL  TRUE  # perform any of the aperture-like measurements?
+  EXTENDED_SOURCE_ANALYSIS            BOOL  TRUE  # perform any of the aperture-like measurements?
+  EXTENDED_SOURCE_SN_LIM              F32   20.0
+  EXTENDED_SOURCE_PETROSIAN           BOOL  TRUE
+  EXTENDED_SOURCE_ANNULI              BOOL  TRUE
+  PSPHOT.STACK.MATCH.PSF.SOURCE       STR   AUTO # which inputs to convolve? (RAW, CNV, AUTO)
+  PSPHOT.STACK.TARGET.PSF.AUTO        BOOL  F    # automatically determine target PSF size?
+  PSPHOT.STACK.USE.RAW                BOOL  F    # perform photometry & morphology analysis on the raw image
+  @PSPHOT.STACK.TARGET.PSF.FWHM       F32   8.0 10.0 # FWHM of target PSF (if NOT AUTO sized; pixels)
+  RADIAL_APERTURES                    BOOL  T    # calculate flux in circular radial apertures?
+  RADIAL_APERTURES_SN_LIM             F32   0.0  # S/N limit for radial aperture calculation
+  OUTPUT.FORMAT                       STR   PS1_SV1
+
+  EXT_FIT_MAX_RADIUS                  F32   50.0
+  PSF_MODEL                           STR   PS_MODEL_QGAUSS 
   EXT_MODEL                           STR   PS_MODEL_SERSIC
 END
Index: /trunk/ippconfig/recipes/reductionClasses.mdc
===================================================================
--- /trunk/ippconfig/recipes/reductionClasses.mdc	(revision 31162)
+++ /trunk/ippconfig/recipes/reductionClasses.mdc	(revision 31163)
@@ -144,18 +144,20 @@
 # basic science analysis
 DEFAULT		METADATA
-	CHIP_PPIMAGE	STR	CHIP
-	CHIP_PSPHOT	STR	CHIP
-	WARP_PSWARP	STR	WARP
-	STACK_PPSTACK	STR	STACK
-	STACK_PPSUB	STR	STACK
-	STACK_PSPHOT	STR	STACK
-	DIFF_PPSUB	STR	DIFF
-	DIFF_PSPHOT	STR	DIFF
-	JPEG_BIN1	STR	PPIMAGE_J1
-	JPEG_BIN2	STR	PPIMAGE_J2
-	FAKEPHOT	STR	FAKEPHOT
-	ADDSTAR		STR	ADDSTAR
-	PSASTRO		STR	DEFAULT_RECIPE
-	STACKPHOT       STR     STACKPHOT
+	CHIP_PPIMAGE	  STR	  CHIP
+	CHIP_PSPHOT	  STR	  CHIP
+	WARP_PSWARP	  STR	  WARP
+	STACK_PPSTACK	  STR	  STACK
+	STACK_PPSUB	  STR	  STACK
+	STACK_PSPHOT	  STR	  STACK
+	DIFF_PPSUB	  STR	  DIFF
+	DIFF_PSPHOT	  STR	  DIFF
+	JPEG_BIN1	  STR	  PPIMAGE_J1
+	JPEG_BIN2	  STR	  PPIMAGE_J2
+	FAKEPHOT	  STR	  FAKEPHOT
+	ADDSTAR		  STR	  ADDSTAR
+	PSASTRO		  STR	  DEFAULT_RECIPE
+	STACKPHOT_PSPHOT  STR     STACKPHOT
+	STACKPHOT_PPSUB   STR     STACKPHOT
+	STACKPHOT_PPSTACK STR     STACKPHOT
 	BACKGROUND_PPBACKGROUND	STR	BACKGROUND
 	BACKGROUND_PSWARP	STR	BACKGROUND
@@ -330,4 +332,11 @@
 	PSASTRO		STR	PS1_REFERENCE
 	STACKPHOT       STR     STACKPHOT
+END
+
+# stackphot (static sky) test reduction
+STACKPHOT_TEST	METADATA
+	STACKPHOT_PSPHOT  STR     STACKPHOT_TEST
+	STACKPHOT_PPSUB   STR     STACKPHOT
+	STACKPHOT_PPSTACK STR     STACKPHOT
 END
 
