Index: branches/eam_branches/ps2-tc3-20130727/ippconfig/dvo.photcodes
===================================================================
--- branches/eam_branches/ps2-tc3-20130727/ippconfig/dvo.photcodes	(revision 37397)
+++ branches/eam_branches/ps2-tc3-20130727/ippconfig/dvo.photcodes	(revision 37403)
@@ -903,4 +903,10 @@
   11400 GPC1.y.SkyChip       dep  25.000  0.000 0.000     -     - 0.0000     0     5   0.000 0.000 0.000  0.000   0x0000 0x0000  0x0000 0x0000
   11500 GPC1.w.SkyChip       dep  25.000  0.000 0.000     -     - 0.0000     0     9   0.000 0.000 0.000  0.000   0x0000 0x0000  0x0000 0x0000
+  12000 GPC1.g.ForcedWarp    dep  25.000  0.000 0.000     -     - 0.0000     0     1   0.000 0.000 0.000  0.000   0x0000 0x0000  0x0000 0x0000
+  12100 GPC1.r.ForcedWarp    dep  25.000  0.000 0.000     -     - 0.0000     0     2   0.000 0.000 0.000  0.000   0x0000 0x0000  0x0000 0x0000
+  12200 GPC1.i.ForcedWarp    dep  25.000  0.000 0.000     -     - 0.0000     0     3   0.000 0.000 0.000  0.000   0x0000 0x0000  0x0000 0x0000
+  12300 GPC1.z.ForcedWarp    dep  25.000  0.000 0.000     -     - 0.0000     0     4   0.000 0.000 0.000  0.000   0x0000 0x0000  0x0000 0x0000
+  12400 GPC1.y.ForcedWarp    dep  25.000  0.000 0.000     -     - 0.0000     0     5   0.000 0.000 0.000  0.000   0x0000 0x0000  0x0000 0x0000
+  12500 GPC1.w.ForcedWarp    dep  25.000  0.000 0.000     -     - 0.0000     0     9   0.000 0.000 0.000  0.000   0x0000 0x0000  0x0000 0x0000
   160   MOSAIC2.B.00         dep  25.107  0.000 0.000     -     - 0.0000     0     1   0.000 0.000 1.000  0.000   0x0000 0x3888  0x0000 0x0000
   161   MOSAIC2.B.01         dep  25.120  0.000 0.000     -     - 0.0000     0     1   0.000 0.000 1.000  0.000   0x0000 0x3888  0x0000 0x0000
Index: branches/eam_branches/ps2-tc3-20130727/ippconfig/gpc1/format_20100723.config
===================================================================
--- branches/eam_branches/ps2-tc3-20130727/ippconfig/gpc1/format_20100723.config	(revision 37397)
+++ branches/eam_branches/ps2-tc3-20130727/ippconfig/gpc1/format_20100723.config	(revision 37403)
@@ -210,4 +210,6 @@
         FPA.BURNTOOL.APPLIED STR BTOOLAPP
 	CHIP.VIDEOCELL  STR     CELLMODE
+
+        FPA.SHUTOUTC	STR	SHUTOUTC
 
         FPA.PON.TIME    STR     PONTIME
Index: branches/eam_branches/ps2-tc3-20130727/ippconfig/gpc1/ppImage.config
===================================================================
--- branches/eam_branches/ps2-tc3-20130727/ippconfig/gpc1/ppImage.config	(revision 37397)
+++ branches/eam_branches/ps2-tc3-20130727/ippconfig/gpc1/ppImage.config	(revision 37403)
@@ -26,4 +26,9 @@
 
 APPLY.BURNTOOL          BOOL    TRUE           # apply burntool correction in ppImage
+
+PATTERN.CELL.SUBSET METADATA		   # Menu of chips and/or cells for cell pattern correction
+# XXX TEST ONLY (I was trying to median-subtract each cell using PATTERN.CELL to generate laser flat samples)
+#   XY40 STR 0111111111111111111111111111111111111111111111111111111111111111
+END
 
 # Final detrending options 
Index: branches/eam_branches/ps2-tc3-20130727/ippconfig/gpc1/ppStack.config
===================================================================
--- branches/eam_branches/ps2-tc3-20130727/ippconfig/gpc1/ppStack.config	(revision 37397)
+++ branches/eam_branches/ps2-tc3-20130727/ippconfig/gpc1/ppStack.config	(revision 37403)
@@ -79,4 +79,21 @@
    MATCH.REJ        F32    4.0
    SAFE		 BOOL	F
+
+END
+
+STACK_CNP  METADATA                   ## Based on STACK_THREEPI and STACK_MD_DEEP_1DG 
+    OUTPUT.NOCOMP   	    BOOL  FALSE
+    OUTPUT.LOGFLUX  	    BOOL  TRUE
+    STACK.TYPE              STR   DEEP_STACK
+    PSF.INPUT.CLIP.SIMPLE   BOOL  True
+    PSF.INPUT.MAX           F32   10.0    #  
+    PSF.INPUT.CLIP.NSIGMA   F32   100.0
+    PSF.INPUT.THRESH        F32   NAN
+    PSF.INPUT.ASYMMETRY     F32   NAN
+
+   MATCH.REJ        F32    4.0
+   SAFE		 BOOL	F
+
+    PSF.TARGET.AS.MAX.EPSILON F32 0.1
 
 END
@@ -137,5 +154,5 @@
 END
 
-STACK_MD_REF_1DG       METADATA  ## revised config for MD refstacks vs PS1_REFERENCE above after ppStack mods 5/03/13
+STACK_MD_IQ_1DG       METADATA  ## revised config for MD refstacks vs PS1_REFERENCE above after ppStack mods 5/03/13
     OUTPUT.NOCOMP           BOOL  TRUE
     OUTPUT.LOGFLUX          BOOL  FALSE
@@ -143,6 +160,6 @@
     STACK.TYPE              STR   DEEP_STACK  ## needed?
     PSF.INPUT.CLIP.SIMPLE   BOOL  True
-    PSF.INPUT.MAX           F32   6.0   # never really want >6 pixels in refstack, even on edges 
-    PSF.INPUT.CLIP.NSIGMA   F32   1.0   # sample typically on rising side of distribution (set even smaller?)
+    PSF.INPUT.MAX           F32   10.0   # center/edge can vary 1-2 pix, prefer <6 pix but needs to be <10 pix for edges until code improved..
+    PSF.INPUT.CLIP.NSIGMA   F32   100.0  # any change to inputs can greatly impact edge filling factor..
     PSF.INPUT.THRESH        F32   NAN
     PSF.INPUT.ASYMMETRY     F32   NAN
@@ -151,4 +168,40 @@
     PSF.TARGET.AS.MAX       BOOL  TRUE      # Set the target PSF FWHM as the maximum of accepted input FWHM values.
     PSF.TARGET.AS.MAX.EPSILON F32 0.1       # Amount to set the target PSF FWHM larger than the maximum input. Target = eps + max(input)
+    THRESHOLD.MASK  F32     0.1             # Threshold for mask deconvolution (0..1)
+    COMBINE.ITER    F32     0.5             # Number of rejection iterations per input
+    COMBINE.REJ     F32     3.0             # 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
+    IMAGE.REJ       F32     0.1             # Rejected pixel fraction threshold for rejecting entire image
+    NMINPIX         S32     4               # Minimum input per pixel
+    MASK.VAL        STR     SUSPECT,MASK.VALUE,CONV.BAD,GHOST # Mask value of input bad pixels
+    MASK.BLANKBORDER S32    20              # Mask blank border in final stack output
+    BSCALEOFFSET    BOOL    TRUE            # HACK for removing bscale offset from input warps because of compression (0.5*BSCALE)
+END
+
+STACK_MD_REF_1DG       METADATA  ## revised config for MD refstacks vs PS1_REFERENCE above after ppStack mods 5/03/13
+    OUTPUT.NOCOMP           BOOL  TRUE
+    OUTPUT.LOGFLUX          BOOL  FALSE
+    OUTPUT.REPLICATE        BOOL  TRUE
+    STACK.TYPE              STR   DEEP_STACK  ## needed?
+    PSF.INPUT.CLIP.SIMPLE   BOOL  True
+    PSF.INPUT.MAX           F32   7.0   # center/edge can vary 1-2 pix, prefer <6 pix but needs to be <7 pix for edges
+    PSF.INPUT.CLIP.NSIGMA   F32   1.0   # sample typically on rising side of distribution (set even smaller?)
+    PSF.INPUT.THRESH        F32   NAN
+    PSF.INPUT.ASYMMETRY     F32   NAN
+    MATCH.REJ               F32   4.0   # need ot tune?
+    SAFE                    BOOL  FALSE
+    PSF.TARGET.AS.MAX       BOOL  TRUE      # Set the target PSF FWHM as the maximum of accepted input FWHM values.
+    PSF.TARGET.AS.MAX.EPSILON F32 0.1       # Amount to set the target PSF FWHM larger than the maximum input. Target = eps + max(input)
+    THRESHOLD.MASK  F32     0.1             # Threshold for mask deconvolution (0..1)
+    COMBINE.ITER    F32     0.5             # Number of rejection iterations per input
+    COMBINE.REJ     F32     3.0             # 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
+    IMAGE.REJ       F32     0.1             # Rejected pixel fraction threshold for rejecting entire image
+    NMINPIX         S32     4               # Minimum input per pixel
+    MASK.VAL        STR     SUSPECT,MASK.VALUE,CONV.BAD,GHOST # Mask value of input bad pixels
+    MASK.BLANKBORDER S32    20              # Mask blank border in final stack output
+    BSCALEOFFSET    BOOL    TRUE            # HACK for removing bscale offset from input warps because of compression (0.5*BSCALE)
 END
 
@@ -167,10 +220,14 @@
     PSF.TARGET.AS.MAX  BOOL  TRUE
     PSF.TARGET.AS.MAX.EPSILON F32 0.1
-    THRESHOLD.MASK  F32     0.01             # Threshold for mask deconvolution (0..1)
-    COMBINE.ITER    F32     0.5             # Number of rejection iterations per input
-    COMBINE.REJ     F32     2.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
-    IMAGE.REJ       F32     0.1             # Rejected pixel fraction threshold for rejecting entire image
+    THRESHOLD.MASK  F32     0.1             # Threshold for mask deconvolution (0..1)
+    COMBINE.ITER    F32     0.5             # Number of rejection iterations per input
+    COMBINE.REJ     F32     3.0             # 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
+    IMAGE.REJ       F32     0.1             # Rejected pixel fraction threshold for rejecting entire image
+    NMINPIX         S32     30              # Minimum input per pixel 
+    MASK.VAL        STR     SUSPECT,MASK.VALUE,CONV.BAD,GHOST # Mask value of input bad pixels
+    MASK.BLANKBORDER S32    20              # Mask blank border in final stack output
+    BSCALEOFFSET    BOOL    TRUE            # HACK for removing bscale offset from input warps because of compression (0.5*BSCALE)
 END
 
Index: branches/eam_branches/ps2-tc3-20130727/ippconfig/gpc1/psastro.config
===================================================================
--- branches/eam_branches/ps2-tc3-20130727/ippconfig/gpc1/psastro.config	(revision 37397)
+++ branches/eam_branches/ps2-tc3-20130727/ippconfig/gpc1/psastro.config	(revision 37403)
@@ -13,9 +13,9 @@
 # max grid offset in FP units (microns)
 # use plate-scale to make this in pixels?
-PSASTRO.GRID.OFFSET    F32    1000.
+PSASTRO.GRID.OFFSET    F32    1000. # we use stars in a region (4800+2000 pix)^2, a factor of 2 in area
 PSASTRO.GRID.SCALE     F32      50
 PSASTRO.GRID.NSTAR.MAX S32     800 # deprecated 
-PSASTRO.GRID.NREF.MAX  S32     800 # max stars accepted for grid search from ref catalog
-PSASTRO.GRID.NRAW.MAX  S32    1200 # max stars accepted for grid search from raw image
+PSASTRO.GRID.NREF.MAX  S32    1600 # max stars accepted for grid search from ref catalog (2x as many as the RAW stars, to match area)
+PSASTRO.GRID.NRAW.MAX  S32     800 # max stars accepted for grid search from raw image
 
 PSASTRO.MAX.NRAW      S32      1000   # max stars accepted for fitting (0 for all)
@@ -31,7 +31,7 @@
 PSASTRO.GRID.MAX.INST.MAG.RAW  F32      -8.0   # max instrumental magnitude for stars accepted for grid search
 
-PSASTRO.GRID.MIN.ANGLE F32 -1.0 # start angle (degrees)
-PSASTRO.GRID.MAX.ANGLE F32 +0.5
-PSASTRO.GRID.DEL.ANGLE F32  0.5
+PSASTRO.GRID.MIN.ANGLE F32 -1.00 # start angle (degrees)
+PSASTRO.GRID.MAX.ANGLE F32 +1.01 # sequence is MIN, MIN + DEL, < MAX, we get -1.0, -0.5, 0.0, 0.5, 1.0
+PSASTRO.GRID.DEL.ANGLE F32  0.50
 
 #
@@ -66,4 +66,8 @@
 PSASTRO.USE.MODEL             BOOL     TRUE
 
+# apply Koppenhoefer Correction to this camera?
+KH.CORRECT.APPLY	      BOOL     TRUE
+KH.CORRECT.ENDDATE	      STR      2011/05/11,00:00:00
+
 # PSASTRO.FIX.CHIPS             BOOL     TRUE
 PSASTRO.PIXEL.TOLERANCE       F32      3.0
@@ -83,5 +87,5 @@
 PSASTRO.MOSAIC.MAX.ERROR.N3 F32    0.00 # max allow error for valid solution (arcsec)
 PSASTRO.MOSAIC.MAX.ERROR.N4 F32    0.00 # max allow error for valid solution (arcsec)
-PSASTRO.MOSAIC.MAX.ERROR.N5 F32    5.00 # max allow error for valid solution (arcsec)
+PSASTRO.MOSAIC.MAX.ERROR.N5 F32    0.30 # max allow error for valid solution (arcsec)
 
 # mosaic radius match in pixels (do these make sense?)
@@ -118,9 +122,10 @@
 # PSASTRO.CATDIR              STR      SYNTH.GRIZY 
 # PSASTRO.CATDIR		STR	PS1.REF.20120503
-PSASTRO.CATDIR               STR     PS1.REF.20120524
-
+# PSASTRO.CATDIR               STR     PS1.REF.20120524
+# PSASTRO.CATDIR               STR     PS1.REF.20140605
+PSASTRO.CATDIR               STR     PS1.REF.20140713
 
 DVO.GETSTAR.PHOTCODE        STR      i
-DVO.GETSTAR.MAX.RHO         F32      3000.0
+DVO.GETSTAR.MAX.RHO         F32      10000.0
 DVO.GETSTAR.MIN.MAG         F32      12.0
 DVO.GETSTAR.MIN.MAG.INST    F32     -25.0
@@ -358,6 +363,7 @@
 
 DEFAULT_RECIPE METADATA
-#   PSASTRO.CATDIR               STR     PS1.REF.20120503
-   PSASTRO.CATDIR		STR	PS1.REF.20120524
+#  PSASTRO.CATDIR               STR     PS1.REF.20120503
+#  PSASTRO.CATDIR		STR	PS1.REF.20120524
+   PSASTRO.CATDIR               STR     PS1.REF.20140605
    ZERO.POINT.USE.MEAN		BOOL	TRUE  
 END
@@ -370,7 +376,9 @@
 LAP_ASTRO METADATA
 #  PSASTRO.CATDIR                STR      3PI.20110505.REFCAT
-#   PSASTRO.CATDIR		 STR	  SYNTH.GRIZY
-#   PSASTRO.CATDIR		 STR     PS1.REF.20120503
-   PSASTRO.CATDIR               STR     PS1.REF.20120524
+#  PSASTRO.CATDIR		 STR	  SYNTH.GRIZY
+#  PSASTRO.CATDIR		 STR     PS1.REF.20120503
+#  PSASTRO.CATDIR               STR     PS1.REF.20120524
+#   PSASTRO.CATDIR               STR     PS1.REF.20140605
+   PSASTRO.CATDIR		 STR	 PS1.REF.20140713
    ZERO.POINT.USE.MEAN		BOOL	TRUE  
 END
@@ -381,5 +389,5 @@
 
 POLE_REFCAT METADATA
-   PSASTRO.CATDIR		STR  SYNTH.GRIZY
+   PSASTRO.CATDIR		STR  PS1.REF.20140713
    ZERO.POINT.USE.MEAN		     BOOL TRUE  
    PSASTRO.GRID.MIN.ANGLE       F32  -20
@@ -401,5 +409,6 @@
    DVO.GETSTAR.FIXED.ZEROPT    F32   25.0
 
-   PSASTRO.CATDIR               	STR     PS1.REF.20120524
+   PSASTRO.CATDIR               STR     PS1.REF.20140605
+#  PSASTRO.CATDIR               	STR     PS1.REF.20120524
    ZERO.POINT.USE.MEAN          	BOOL    TRUE
    PSASTRO.MAX.NRAW 			S32	0 
@@ -420,5 +429,6 @@
     DVO.GETSTAR.FIXED.ZEROPT    F32   25.0
     DVO.GETSTAR.MIN.MAG.INST	F32   -15.0
-    PSASTRO.CATDIR                       STR     PS1.REF.20120524
+#   PSASTRO.CATDIR                       STR     PS1.REF.20120524
+    PSASTRO.CATDIR               STR     PS1.REF.20140605
     ZERO.POINT.USE.MEAN                  BOOL    TRUE
 
@@ -439,5 +449,7 @@
 # - similar to DEEPCAL except for MIN.NSTAR 5 to attemp more edge skycells if poorer
 STATICSKY_NIGHTCAL   METADATA
-   PSASTRO.CATDIR                  STR   PS1.REF.20120524  # reset here to ensure same catalog is used when reprocessing set uniformly
+#   PSASTRO.CATDIR                  STR   PS1.REF.20120524  # reset here to ensure same catalog is used when reprocessing set uniformly
+#   PSASTRO.CATDIR                  STR   PS1.REF.20140605 (BAD catalog)
+   PSASTRO.CATDIR                  STR   PS1.REF.20140713
    REFSTAR_MASK                    BOOL  FALSE
    PSASTRO.SAVE.REFMATCH           BOOL  FALSE
@@ -475,5 +487,7 @@
 # revised setup for DEEP/MDS stacks with range of inputs, should work for N~2(edges)--500 inputs with large MIN/MAX.INST.MAG.RAW
 STATICSKY_DEEPCAL   METADATA
-   PSASTRO.CATDIR                  STR   PS1.REF.20120524  # reset here to ensure same catalog is used when reprocessing set uniformly
+   #PSASTRO.CATDIR                  STR   PS1.REF.20120524  # reset here to ensure same catalog is used when reprocessing set uniformly
+   #PSASTRO.CATDIR                  STR   PS1.REF.20140605  # ensure same catalog is used when reprocessing MD set uniformly (BAD catalog)
+   PSASTRO.CATDIR                  STR   PS1.REF.20140713 
    REFSTAR_MASK                    BOOL  FALSE
    PSASTRO.SAVE.REFMATCH           BOOL  FALSE
@@ -483,6 +497,6 @@
    ZERO.POINT.USE.MEAN             BOOL  TRUE
    PSASTRO.FIELD.PADDING           F32   0.01   # skycells are well defined, don't need large padding. 1% of 6400 is 64 pixels
-   PSASTRO.MAX.NRAW                S32   1000   # include more than MAX.NREF to account for extras like false-positives
-   PSASTRO.MAX.NREF            	   S32    500   # if edge skycell ~10% then try ~50 to match 
+   PSASTRO.MAX.NRAW                S32   1500   # include more than MAX.NREF to account for extras like false-positives
+   PSASTRO.MAX.NREF            	   S32   1000   # if edge skycell ~10% then try ~50 to match. increase to help odd bulk offsets
    PSASTRO.MIN.INST.MAG.RAW        F32   -25.0  # 
    PSASTRO.MAX.INST.MAG.RAW        F32   -5.0
@@ -494,6 +508,6 @@
    DVO.GETSTAR.MAX.RHO		   F32	 6000.0  # N/sqdeg, slightly larger than MAX.NREF 
    DVO.GETSTAR.MIN.MAG.INST        F32   -25.0   # set absurd range to cover large range of exptime, then clamp...
-   DVO.GETSTAR.MIN.MAG		   F32	 15.0    # only used if keyword problem so also using CLAMP_MAG_MIN
-   REFSTAR_CLAMP_MAG_MIN 	   F32	 15.0    # saturation in MD ~14 even in y-band, so toss out brighter in the list
+   DVO.GETSTAR.MIN.MAG		   F32	 16.5    # only used if keyword problem so also using CLAMP_MAG_MIN
+   REFSTAR_CLAMP_MAG_MIN 	   F32	 16.5    # saturation in MD ~14 even in y-band, so toss out brighter in the list. seeing offset in brighter stars
    DVO.GETSTAR.FIXED.ZEROPT        F32   0.0     # not really needed, exptime overly dominates
   
@@ -506,4 +520,41 @@
    PSASTRO.MAX.ERROR       	   F32   0.2  # in arcsec units, still liberal limit for well known astrometry for skycells
    PSASTRO.MIN.NSTAR       	   S32   10   # edges may not have many and require special treatment 
-END
-
+
+   KH.CORRECT.APPLY              BOOL     FALSE
+END
+
+## if defined for MD, needs to have MD name in group so shouldn't be modified except for MD work
+## -- ad hoc limit for NREF due to issues fainter than 19 mag in all filters and brighter than 17.0 mag (except y ~16.5) in MD
+## -- better solution and other issues need to really be dealt with for PV3
+STATICSKY_MD_DEEPCAL   METADATA
+   PSASTRO.CATDIR                  STR   PS1.REF.20140713
+   REFSTAR_MASK                    BOOL  FALSE
+   PSASTRO.SAVE.REFMATCH           BOOL  FALSE
+   PSASTRO.FIX.CHIPS               BOOL  FALSE
+   PSASTRO.USE.MODEL               BOOL  FALSE
+   PSASTRO.MOSAIC.MODE             BOOL  FALSE
+   ZERO.POINT.USE.MEAN             BOOL  TRUE
+   PSASTRO.FIELD.PADDING           F32   0.01   # skycells are well defined, don't need large padding. 1% of 6400 is 64 pixels
+   PSASTRO.MAX.NRAW                S32   1500   # include more than MAX.NREF to account for extras like false-positives
+   PSASTRO.MAX.NREF                S32   150    # if edge skycell ~10% then try ~50 to match. increase to help odd bulk offsets
+   PSASTRO.MIN.INST.MAG.RAW        F32   -25.0  # 
+   PSASTRO.MAX.INST.MAG.RAW        F32   -5.0
+   PSASTRO.GRID.SEARCH             BOOL  FALSE  # skycell/stack and astrom well known, when used could cause problems and not help
+
+   DVO.GETSTAR.MAX.RHO             F32   6000.0  # N/sqdeg, slightly larger than MAX.NREF 
+   DVO.GETSTAR.MIN.MAG.INST        F32   -25.0   # set absurd range to cover large range of exptime, then clamp...
+   DVO.GETSTAR.MIN.MAG             F32   17.0    # only used if keyword problem so also using CLAMP_MAG_MIN
+   REFSTAR_CLAMP_MAG_MIN           F32   17.0    # saturation in MD ~14 even in y-band, so toss out brighter in the list. seeing offset in brighter stars
+   DVO.GETSTAR.FIXED.ZEROPT        F32   0.0     # not really needed, exptime overly dominates
+
+   ## for skycell/stack astrom well known, radius shouldn't need to be as large as 90 pixel default. in deeper stacks can be problems
+   PSASTRO.MATCH.RADIUS.N0         F32   5
+   PSASTRO.MATCH.RADIUS.N1         F32   3
+   PSASTRO.MATCH.RADIUS.N2         F32   1
+   PSASTRO.MATCH.RADIUS.N3         F32   0.5
+   PSASTRO.MATCH.FIT.NITER         S32   4
+   PSASTRO.MAX.ERROR               F32   0.2  # in arcsec units, still liberal limit for well known astrometry for skycells
+   PSASTRO.MIN.NSTAR               S32   10   # edges may not have many and require special treatment 
+
+   KH.CORRECT.APPLY              BOOL     FALSE
+END
Index: branches/eam_branches/ps2-tc3-20130727/ippconfig/recipes/filerules-mef.mdc
===================================================================
--- branches/eam_branches/ps2-tc3-20130727/ippconfig/recipes/filerules-mef.mdc	(revision 37397)
+++ branches/eam_branches/ps2-tc3-20130727/ippconfig/recipes/filerules-mef.mdc	(revision 37403)
@@ -111,4 +111,5 @@
 PSASTRO.WCS             INPUT    @FILES        CHIP       CMF
 PSASTRO.MODEL           INPUT    @DETDB        FPA        ASTROM
+PSASTRO.KH.CORRECT      INPUT    @DETDB        FPA        KH.CORRECT
 
 PSASTRO.EXTRACT.ASTROM  INPUT    @FILES        CHIP       CMF
@@ -182,4 +183,5 @@
 PPBACKGROUND.PATTERN	  INPUT    @FILES        CHIP       PATTERN
 PPBACKGROUND.BACKGROUND	  INPUT    @FILES        CHIP       IMAGE
+PPBACKGROUND.STACK        INPUT    @FILES        FPA        IMAGE
 
 ### output file definitions
@@ -392,4 +394,7 @@
 TRACE.EXP.UPDATE        OUTPUT {OUTPUT}.trace.update             TEXT      NONE       FPA        TRUE      NONE
 
+DBINFO.IMFILE                OUTPUT {OUTPUT}.{CHIP.NAME}.dbinfo       TEXT            NONE       CHIP       TRUE      NONE
+DBINFO.EXP                   OUTPUT {OUTPUT}.dbinfo                   TEXT            NONE       CHIP       TRUE      NONE
+
 PPNOISEMAP.OUTPUT       OUTPUT {OUTPUT}.{CHIP.NAME}.fits         IMAGE     NONE       CHIP       TRUE      NONE
 
@@ -411,2 +416,6 @@
 PPBACKGROUND.CONFIG          OUTPUT {OUTPUT}.{CHIP.NAME}.ppBackground.mdc TEXT        NONE       CHIP       TRUE      NONE
 PPBACKGROUND.STATS           OUTPUT {OUTPUT}.{CHIP.NAME}.stats        STATS           NONE       CHIP       TRUE      NONE
+
+PPBACKGROUND.STACK.OUTPUT    OUTPUT {OUTPUT}.bkgrest.fits        IMAGE     COMP_IMG   FPA        TRUE      NONE
+PPBACKGROUND.STACK.MODEL     OUTPUT {OUTPUT}.bkgmdl.fits        IMAGE     COMP_IMG   FPA        TRUE      NONE
+PPBACKGROUND.OTA.SOLUTION    OUTPUT {OUTPUT}.{CHIP.NAME}.OTAS.fits IMAGE  COMP_IMG   CHIP       TRUE      NONE
Index: branches/eam_branches/ps2-tc3-20130727/ippconfig/recipes/filerules-simple.mdc
===================================================================
--- branches/eam_branches/ps2-tc3-20130727/ippconfig/recipes/filerules-simple.mdc	(revision 37397)
+++ branches/eam_branches/ps2-tc3-20130727/ippconfig/recipes/filerules-simple.mdc	(revision 37403)
@@ -81,4 +81,5 @@
 PSASTRO.WCS               INPUT    @FILES        CHIP       CMF
 PSASTRO.MODEL             INPUT    @DETDB        FPA        ASTROM
+PSASTRO.KH.CORRECT        INPUT    @DETDB        FPA        KH.CORRECT
 
 PSASTRO.EXTRACT.ASTROM    INPUT    @FILES        CHIP       CMF
@@ -154,4 +155,5 @@
 PPBACKGROUND.PATTERN	  INPUT    @FILES        CHIP       PATTERN
 PPBACKGROUND.BACKGROUND	  INPUT    @FILES        CHIP       IMAGE
+PPBACKGROUND.STACK        INPUT    @FILES        FPA        IMAGE
 
 ### output file definitions
@@ -349,4 +351,7 @@
 TRACE.EXP.UPDATE             OUTPUT {OUTPUT}.exp.trace.update     TEXT            NONE       FPA        TRUE      NONE
 
+DBINFO.IMFILE                OUTPUT {OUTPUT}.{CHIP.NAME}.dbinfo       TEXT            NONE       CHIP       TRUE      NONE
+DBINFO.EXP                   OUTPUT {OUTPUT}.dbinfo                   TEXT            NONE       CHIP       TRUE      NONE
+
 PPNOISEMAP.OUTPUT            OUTPUT {OUTPUT}.{CHIP.NAME}.fits     IMAGE           NONE       CHIP       TRUE      NONE
 
@@ -368,2 +373,6 @@
 PPBACKGROUND.CONFIG          OUTPUT {OUTPUT}.{CHIP.NAME}.ppBackground.mdc TEXT        NONE       CHIP       TRUE      NONE
 PPBACKGROUND.STATS           OUTPUT {OUTPUT}.{CHIP.NAME}.stats        STATS           NONE       CHIP       TRUE      NONE
+
+PPBACKGROUND.STACK.OUTPUT    OUTPUT {OUTPUT}.bkgrest.fits        IMAGE     COMP_IMG   FPA        TRUE      NONE
+PPBACKGROUND.STACK.MODEL     OUTPUT {OUTPUT}.bkgmdl.fits        IMAGE     COMP_IMG   FPA        TRUE      NONE
+PPBACKGROUND.OTA.SOLUTION    OUTPUT {OUTPUT}.{CHIP.NAME}.OTAS.fits IMAGE  COMP_IMG   CHIP       TRUE      NONE
Index: branches/eam_branches/ps2-tc3-20130727/ippconfig/recipes/filerules-split.mdc
===================================================================
--- branches/eam_branches/ps2-tc3-20130727/ippconfig/recipes/filerules-split.mdc	(revision 37397)
+++ branches/eam_branches/ps2-tc3-20130727/ippconfig/recipes/filerules-split.mdc	(revision 37403)
@@ -101,4 +101,5 @@
 PSASTRO.WCS               INPUT    @FILES        CHIP       WCS
 PSASTRO.MODEL             INPUT    @DETDB        FPA        ASTROM
+PSASTRO.KH.CORRECT        INPUT    @DETDB        FPA        KH.CORRECT
                           
 PSASTRO.EXTRACT.ASTROM    INPUT    @FILES        CHIP       CMF
@@ -177,4 +178,5 @@
 PPBACKGROUND.PATTERN	  INPUT    @FILES        CHIP       PATTERN
 PPBACKGROUND.BACKGROUND	  INPUT    @FILES        CHIP       IMAGE
+PPBACKGROUND.STACK        INPUT    @FILES        FPA        IMAGE
 
 ### output file definitions
@@ -304,6 +306,6 @@
                                                                                                               
 PPSUB.OUTPUT                 OUTPUT {OUTPUT}.fits                     IMAGE           NONE       FPA        TRUE      NONE
-PPSUB.OUTPUT.MASK            OUTPUT {OUTPUT}.mask.fits                MASK            COMP_MASK  FPA        TRUE      NONE
-PPSUB.OUTPUT.VARIANCE        OUTPUT {OUTPUT}.wt.fits                  VARIANCE        COMP_WT    FPA        TRUE      NONE
+PPSUB.OUTPUT.MASK            OUTPUT {OUTPUT}.mask.fits                MASK            NONE       FPA        TRUE      NONE
+PPSUB.OUTPUT.VARIANCE        OUTPUT {OUTPUT}.wt.fits                  VARIANCE        NONE       FPA        TRUE      NONE
 PPSUB.OUTPUT.SOURCES         OUTPUT {OUTPUT}.cmf                      CMF             NONE       FPA        TRUE      NONE
 PPSUB.OUTPUT.KERNELS         OUTPUT {OUTPUT}.subkernel                SUBKERNEL       NONE       FPA        TRUE      NONE
@@ -312,6 +314,6 @@
 PPSUB.OUTPUT.RESID.JPEG      OUTPUT {OUTPUT}.res.jpg                  JPEG            NONE       FPA        TRUE      NONE
 PPSUB.INVERSE                OUTPUT {OUTPUT}.inv.fits                 IMAGE           NONE       FPA        TRUE      NONE
-PPSUB.INVERSE.MASK           OUTPUT {OUTPUT}.inv.mask.fits            MASK            COMP_MASK  FPA        TRUE      NONE
-PPSUB.INVERSE.VARIANCE       OUTPUT {OUTPUT}.inv.wt.fits              VARIANCE        COMP_WT    FPA        TRUE      NONE
+PPSUB.INVERSE.MASK           OUTPUT {OUTPUT}.inv.mask.fits            MASK            NONE       FPA        TRUE      NONE
+PPSUB.INVERSE.VARIANCE       OUTPUT {OUTPUT}.inv.wt.fits              VARIANCE        NONE       FPA        TRUE      NONE
 PPSUB.INVERSE.SOURCES        OUTPUT {OUTPUT}.inv.cmf                  CMF             NONE       FPA        TRUE      NONE
 PPSUB.CONFIG                 OUTPUT {OUTPUT}.ppSub.mdc                TEXT            NONE       FPA        TRUE      NONE
@@ -399,4 +401,7 @@
 TRACE.EXP.UPDATE             OUTPUT {OUTPUT}.trace.update             TEXT            NONE       FPA        TRUE      NONE
 
+DBINFO.IMFILE                OUTPUT {OUTPUT}.{CHIP.NAME}.dbinfo       TEXT            NONE       CHIP       TRUE      NONE
+DBINFO.EXP                   OUTPUT {OUTPUT}.dbinfo                   TEXT            NONE       CHIP       TRUE      NONE
+
 PPNOISEMAP.OUTPUT            OUTPUT {OUTPUT}.{CHIP.NAME}.fits         IMAGE           NONE       CHIP       TRUE      NONE
 
@@ -430,4 +435,8 @@
 PPBACKGROUND.CONFIG          OUTPUT {OUTPUT}.{CHIP.NAME}.ppBackground.mdc TEXT        NONE       CHIP       TRUE      NONE
 PPBACKGROUND.STATS           OUTPUT {OUTPUT}.{CHIP.NAME}.stats        STATS           NONE       CHIP       TRUE      NONE
+
+PPBACKGROUND.STACK.OUTPUT    OUTPUT {OUTPUT}.bkgrest.fits        IMAGE     COMP_IMG   FPA        TRUE      NONE
+PPBACKGROUND.STACK.MODEL     OUTPUT {OUTPUT}.bkgmdl.fits        IMAGE     COMP_IMG   FPA        TRUE      NONE
+PPBACKGROUND.OTA.SOLUTION    OUTPUT {OUTPUT}.{CHIP.NAME}.OTAS.fits IMAGE  COMP_IMG   CHIP       TRUE      NONE
 
 
Index: branches/eam_branches/ps2-tc3-20130727/ippconfig/recipes/nightly_science.config
===================================================================
--- branches/eam_branches/ps2-tc3-20130727/ippconfig/recipes/nightly_science.config	(revision 37397)
+++ branches/eam_branches/ps2-tc3-20130727/ippconfig/recipes/nightly_science.config	(revision 37403)
@@ -3,5 +3,5 @@
   MODE           STR CHIP
   COMMAND        STR chiptool -dbname @DBNAME@ -updaterun -set_state goto_cleaned -state full -set_label goto_cleaned -label @LABEL@ -data_group @DATA_GROUP@
-  RETENTION_TIME U16 5 
+  RETENTION_TIME U16 2
 END
 CLEAN_MODES METADATA
@@ -9,10 +9,10 @@
   COMMAND        STR warptool -dbname @DBNAME@ -updaterun -set_state goto_cleaned -state full -set_label goto_cleaned -label @LABEL@ -data_group @DATA_GROUP@
 #  COMMAND        STR true
-  RETENTION_TIME U16 5
+  RETENTION_TIME U16 2
 END
 CLEAN_MODES METADATA
   MODE           STR DIFF
   COMMAND        STR difftool -dbname @DBNAME@ -updaterun -set_state goto_cleaned -state full -set_label goto_cleaned -label @LABEL@ -data_group @DATA_GROUP@
-  RETENTION_TIME S16 5
+  RETENTION_TIME S16 2
 END
 CLEAN_MODES METADATA
Index: branches/eam_branches/ps2-tc3-20130727/ippconfig/recipes/ppStack.config
===================================================================
--- branches/eam_branches/ps2-tc3-20130727/ippconfig/recipes/ppStack.config	(revision 37397)
+++ branches/eam_branches/ps2-tc3-20130727/ippconfig/recipes/ppStack.config	(revision 37403)
@@ -13,4 +13,5 @@
 MASK.BAD	STR	BLANK		# Mask value to give bad pixels
 MASK.POOR	STR	CONV.POOR	# Mask value to give poor pixels
+MASK.BLANKBORDER S32    0               # Mask blank border in final stack output (may want to set KERNEL.SIZE)
 
 # we are in some danger of inconsistency in the definition of a 'bad' vs a 'suspect' pixel
@@ -32,4 +33,6 @@
 TARGET.FRAC	F32	0.1		# Minimum flux fraction for target PSF
 TARGET.MINMAG	F32	3.0		# Minimum magnitude difference to tolerate in stamp
+NMINPIX		S32	1 		# Minimum input per pixel 
+BSCALEOFFSET    BOOL    FALSE           # HACK for removing offset from input warps because of compression (0.5*BSCALE)
 
 BACKGROUND.MODEL    BOOL   FALSE        # Construct a stacked version of the warp stage background
@@ -166,4 +169,6 @@
 STACK_THREEPI_ALT  METADATA
 END
+STACK_CNP  METADATA
+END
 
 STACK_MD_REF    METADATA
@@ -174,4 +179,7 @@
 
 STACK_ALLDEEP   METADATA
+END
+
+STACK_MD_IQ_1DG    METADATA
 END
 
Index: branches/eam_branches/ps2-tc3-20130727/ippconfig/recipes/ppStats.config
===================================================================
--- branches/eam_branches/ps2-tc3-20130727/ippconfig/recipes/ppStats.config	(revision 37397)
+++ branches/eam_branches/ps2-tc3-20130727/ippconfig/recipes/ppStats.config	(revision 37403)
@@ -116,4 +116,5 @@
   HEADER        STR     DT_ASTR  # elapsed time in astrometry processing
   HEADER        STR     NASTRO
+  HEADER        STR     ASTROM_CHIPS
 
   HEADER        STR     ZPT_OBS
Index: branches/eam_branches/ps2-tc3-20130727/ippconfig/recipes/ppStatsFromMetadata.config
===================================================================
--- branches/eam_branches/ps2-tc3-20130727/ippconfig/recipes/ppStatsFromMetadata.config	(revision 37397)
+++ branches/eam_branches/ps2-tc3-20130727/ippconfig/recipes/ppStatsFromMetadata.config	(revision 37403)
@@ -274,4 +274,5 @@
   ENTRY  VAL  DT_ASTR             F32  SUM              -dtime_astrom      
   ENTRY  VAL  NASTRO              S32  SUM              -n_astrom          
+  ENTRY  VAL  ASTROM_CHIPS        U64  BITWISEOR        -astrom_chips
 
   ENTRY  VAL  ZPT_OBS             F32  SAMPLE_MEAN      -zpt_obs
Index: branches/eam_branches/ps2-tc3-20130727/ippconfig/recipes/psastro.config
===================================================================
--- branches/eam_branches/ps2-tc3-20130727/ippconfig/recipes/psastro.config	(revision 37397)
+++ branches/eam_branches/ps2-tc3-20130727/ippconfig/recipes/psastro.config	(revision 37403)
@@ -230,4 +230,8 @@
 PSASTRO.USE.MODEL             BOOL     FALSE
 
+# apply Koppenhoefer Correction to this camera?
+KH.CORRECT.APPLY	      BOOL     FALSE
+KH.CORRECT.ENDDATE	      STR      NONE
+
 PSASTRO.PIXEL.TOLERANCE       F32      3.0
 PSASTRO.ANGLE.TOLERANCE       F32      1.0
@@ -292,2 +296,5 @@
 END
 
+STATICSKY_MD_DEEPCAL   METADATA
+END
+
Index: branches/eam_branches/ps2-tc3-20130727/ippconfig/recipes/psphot.config
===================================================================
--- branches/eam_branches/ps2-tc3-20130727/ippconfig/recipes/psphot.config	(revision 37397)
+++ branches/eam_branches/ps2-tc3-20130727/ippconfig/recipes/psphot.config	(revision 37403)
@@ -15,5 +15,5 @@
 
 # format for output CMF files
-OUTPUT.FORMAT                       STR   PS1_V3
+OUTPUT.FORMAT                       STR   PS1_V5
 
 # the zero point is used to set a basic scale for DVO
@@ -196,5 +196,20 @@
 EXT.NSIGMA.LIMIT.USE                BOOL  TRUE
 
-EXT_MODEL_TYPE_FOR_CFF              STR   BEST
+# Extended Model to use for forced photometry in full force
+# In addtion to PS_MODEL_SERSIC, PS_MODEL_DEV, and PS_MODEL_EXP  the values BEST and ALL may be selected
+# This specifies what gets saved in cff file output by psastro
+EXT_MODEL_TYPE_FOR_CFF              STR   ALL
+# this model is forced
+EXT_MODEL_TYPE_FORCE                STR   PS_MODEL_SERSIC
+
+# if the sersic model is selected, the dev model will also be forced for sources with sersic index above this limit
+# (Note: this is not used if BEST was selected)
+EXT_MODEL_FORCE_DEV_SERSIC_MIN      F32   3.0
+
+# to avoid forcing extended models for likely stars
+# only force sources with kron mag - psf mag less than this value ...
+EXT_MODEL_FORCE_MAGDIFF_MAX         F32   0.0
+# ... unless SN is less than this value
+EXT_MODEL_FORCE_CUT_SN_MIN          F32   10.0
 
 # Limits on extended source fits by galactic coordinates 
@@ -223,4 +238,6 @@
 
 EXTENDED_SOURCE_MODELS_SELECTION    STR   ALL
+
+LENSING_PARAMETERS                  BOOL  FALSE
 
 # extended source models applied to sources
@@ -442,17 +459,20 @@
 GALAXY_SHAPES_STYLE                 STR   R_MAJ_R_MIN
 
+# new recipe values which set paramter spacing based on signal to noise
+# DELTA = Q / SN
+# F_MIN = 1 - NSIGMA * DELTA
+# F_MAX = 1 + NSIGMA * DELTA
+GALAXY_SHAPES_Q                     F32   1.5       # these values result in
+GALAXY_SHAPES_NSIGMA                F32   2.0       # a 5 x 5 grid
+GALAXY_SHAPES_CLAMP_SN              F32   50.       # with minimum delta .03 pixels
+
+# These recipe values are no longer used
 GALAXY_SHAPES_FR_MAJOR_MIN          F32   0.8
 GALAXY_SHAPES_FR_MAJOR_MAX          F32   1.60
-GALAXY_SHAPES_FR_MAJOR_DEL          F32   0.05
+GALAXY_SHAPES_FR_MAJOR_DEL          F32   0.2
 GALAXY_SHAPES_FR_MINOR_MIN          F32   0.8
 GALAXY_SHAPES_FR_MINOR_MAX          F32   1.60
-GALAXY_SHAPES_FR_MINOR_DEL          F32   0.05
-
-#GALAXY_SHAPES_FR_MAJOR_MIN          F32   0.85
-#GALAXY_SHAPES_FR_MAJOR_MAX          F32   1.15
-#GALAXY_SHAPES_FR_MAJOR_DEL          F32   0.05
-#GALAXY_SHAPES_FR_MINOR_MIN          F32   0.85
-#GALAXY_SHAPES_FR_MINOR_MAX          F32   1.15
-#GALAXY_SHAPES_FR_MINOR_DEL          F32   0.05
+GALAXY_SHAPES_FR_MINOR_DEL          F32   0.2
+
 
 # Extended source fit parameters
@@ -474,5 +494,5 @@
   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_SV2
+  OUTPUT.FORMAT                       STR   PS1_SV3
 
   # subtract radial profiles for extremely bright stars?
@@ -491,7 +511,5 @@
   PEAKS_NMAX_TOTAL                    S32   0 # set this to limit the allowed number of peaks - Yields fault instead of avoid memory explosion
 
-#  EXT_MODEL_TYPE_FOR_CFF              STR   PS_MODEL_DEV
-
-  SAVE.RESID                          BOOL  TRUE
+  SAVE.RESID                          BOOL  FALSE
 END
 
@@ -508,5 +526,5 @@
   RADIAL_APERTURES                    BOOL  F    # 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
+  OUTPUT.FORMAT                       STR   PS1_SV3
 
   EXT_FIT_MAX_RADIUS                  F32   50.0
@@ -712,7 +730,8 @@
     EXTENDED_SOURCE_PETROSIAN BOOL  TRUE    # To measure petrosian magnitudes
     EXTENDED_SOURCE_ANNULI  BOOL    TRUE
+    LENSING_PARAMETERS      BOOL    TRUE
     SAVE.PSF                BOOL    FALSE
     SAVE.BACKMDL            BOOL    FALSE
-    SAVE.RESID              BOOL    TRUE
-    OUTPUT.FORMAT           STR     PS1_SV2
-END
+    SAVE.RESID              BOOL    FALSE
+    OUTPUT.FORMAT           STR     PS1_V5
+END
Index: branches/eam_branches/ps2-tc3-20130727/ippconfig/recipes/reductionClasses.mdc
===================================================================
--- branches/eam_branches/ps2-tc3-20130727/ippconfig/recipes/reductionClasses.mdc	(revision 37397)
+++ branches/eam_branches/ps2-tc3-20130727/ippconfig/recipes/reductionClasses.mdc	(revision 37403)
@@ -244,4 +244,26 @@
 	ADDSTAR		  STR	  ADDSTAR
 	PSASTRO		  STR	  LAP_ASTRO
+	STACKPHOT_PSPHOT  STR     STACKPHOT
+	STACKPHOT_PPSUB   STR     STACKPHOT
+	STACKPHOT_PPSTACK STR     STACKPHOT
+	STACKPHOT_SINGLE_PSPHOT  STR     STACKPHOT_SINGLE
+	BACKGROUND_PPBACKGROUND	STR	BACKGROUND
+	BACKGROUND_PSWARP	STR	BACKGROUND
+        FULLFORCE_PSPHOT  STR   FULLFORCE_WARP
+END
+LAP_POLE		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	  POLE_REFCAT
 	STACKPHOT_PSPHOT  STR     STACKPHOT
 	STACKPHOT_PPSUB   STR     STACKPHOT
@@ -619,8 +641,27 @@
 END
 
+CNP_STACK_1DG         METADATA
+      STACK_PPSTACK   STR      STACK_CNP
+      STACK_PPSUB     STR      STACK_1DG
+      STACK_PSPHOT    STR      STACK
+END
+
 THREEPI_STACK_ALT     METADATA
       STACK_PPSTACK   STR      STACK_THREEPI_ALT
       STACK_PPSUB     STR      STACK
       STACK_PSPHOT    STR      STACK
+END
+
+
+## MD IQ stack -- PV2 version (bscale correction and other changes)
+MD_IQ_STACK_1DG            METADATA
+      STACK_PPSTACK           STR     STACK_MD_IQ_1DG
+      STACK_PPSUB             STR     STACK_1DG
+      STACK_PSPHOT            STR     STACK
+      STACKPHOT_PSPHOT        STR     STACKPHOT
+      STACKPHOT_PPSUB         STR     STACKPHOT_1DG 
+      STACKPHOT_PPSTACK       STR     STACKPHOT 
+      STACKPHOT_SINGLE_PSPHOT STR     STACKPHOT_SINGLE
+      STATICSKY_CALIBRATION   STR     STATICSKY_MD_DEEPCAL 
 END
 
@@ -631,5 +672,5 @@
       STACK_PSPHOT            STR     STACK
       STACKPHOT_PSPHOT        STR     STACKPHOT
-      STATICSKY_CALIBRATION   STR     STATICSKY_DEEPCAL 
+      STATICSKY_CALIBRATION   STR     STATICSKY_MD_DEEPCAL 
 END
 
@@ -642,5 +683,5 @@
       STACKPHOT_PPSTACK       STR     STACKPHOT 
       STACKPHOT_SINGLE_PSPHOT STR     STACKPHOT_SINGLE
-      STATICSKY_CALIBRATION   STR     STATICSKY_DEEPCAL 
+      STATICSKY_CALIBRATION   STR     STATICSKY_MD_DEEPCAL 
 END
 
@@ -651,5 +692,5 @@
       STACK_PSPHOT            STR     STACK
       STACKPHOT_PSPHOT        STR     STACKPHOT
-      STATICSKY_CALIBRATION   STR     STATICSKY_DEEPCAL 
+      STATICSKY_CALIBRATION   STR     STATICSKY_MD_DEEPCAL 
 END
 
@@ -662,5 +703,5 @@
       STACKPHOT_PPSTACK       STR     STACKPHOT 
       STACKPHOT_SINGLE_PSPHOT STR     STACKPHOT_SINGLE
-      STATICSKY_CALIBRATION   STR     STATICSKY_DEEPCAL 
+      STATICSKY_CALIBRATION   STR     STATICSKY_MD_DEEPCAL 
 END
 
@@ -673,5 +714,5 @@
       STACKPHOT_PPSTACK       STR     STACKPHOT
       STACKPHOT_SINGLE_PSPHOT STR     STACKPHOT_SINGLE
-      STATICSKY_CALIBRATION   STR     STATICSKY_DEEPCAL
+      STATICSKY_CALIBRATION   STR     STATICSKY_MD_DEEPCAL
 END
 
@@ -1182,4 +1223,5 @@
 
 STS_DATASET_NOCOMPRESS METADATA
+	# XXX: don't use this recipe
    CHIP_PPIMAGE STR CHIP_NOCOMPRESS
    CHIP_PSPHOT STR CHIP
