Index: trunk/ippconfig/gpc1/ppStack.config
===================================================================
--- trunk/ippconfig/gpc1/ppStack.config	(revision 37245)
+++ trunk/ippconfig/gpc1/ppStack.config	(revision 37274)
@@ -154,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
@@ -160,6 +160,6 @@
     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.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   100.0  # any change to inputs can greatly impact edge filling factor..
     PSF.INPUT.THRESH        F32   NAN
     PSF.INPUT.ASYMMETRY     F32   NAN
@@ -180,4 +180,30 @@
 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
+
 STACK_MD_DEEP_1DG     METADATA   ## revised config for MD deepstack above after ppStack mods 5/03/13
     OUTPUT.NOCOMP           BOOL  TRUE
Index: trunk/ippconfig/gpc1/psastro.config
===================================================================
--- trunk/ippconfig/gpc1/psastro.config	(revision 37245)
+++ trunk/ippconfig/gpc1/psastro.config	(revision 37274)
@@ -450,5 +450,6 @@
 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.20140605
+#   PSASTRO.CATDIR                  STR   PS1.REF.20140605 (BAD catalog)
+   PSASTRO.CATDIR                  STR   PS1.REF.20140713
    REFSTAR_MASK                    BOOL  FALSE
    PSASTRO.SAVE.REFMATCH           BOOL  FALSE
@@ -487,5 +488,6 @@
 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.20140605  # ensure same catalog is used when reprocessing MD 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
@@ -520,2 +522,39 @@
 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 
+
+END
+
+
+
Index: trunk/ippconfig/recipes/ppStack.config
===================================================================
--- trunk/ippconfig/recipes/ppStack.config	(revision 37245)
+++ trunk/ippconfig/recipes/ppStack.config	(revision 37274)
@@ -181,4 +181,7 @@
 END
 
+STACK_MD_IQ_1DG    METADATA
+END
+
 STACK_MD_REF_1DG    METADATA
 END
Index: trunk/ippconfig/recipes/psastro.config
===================================================================
--- trunk/ippconfig/recipes/psastro.config	(revision 37245)
+++ trunk/ippconfig/recipes/psastro.config	(revision 37274)
@@ -296,2 +296,5 @@
 END
 
+STATICSKY_MD_DEEPCAL   METADATA
+END
+
Index: trunk/ippconfig/recipes/reductionClasses.mdc
===================================================================
--- trunk/ippconfig/recipes/reductionClasses.mdc	(revision 37245)
+++ trunk/ippconfig/recipes/reductionClasses.mdc	(revision 37274)
@@ -653,4 +653,17 @@
 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
+
 ## MD refstack
 MD_REF_STACK            METADATA
@@ -659,5 +672,5 @@
       STACK_PSPHOT            STR     STACK
       STACKPHOT_PSPHOT        STR     STACKPHOT
-      STATICSKY_CALIBRATION   STR     STATICSKY_DEEPCAL 
+      STATICSKY_CALIBRATION   STR     STATICSKY_MD_DEEPCAL 
 END
 
@@ -670,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
 
@@ -679,5 +692,5 @@
       STACK_PSPHOT            STR     STACK
       STACKPHOT_PSPHOT        STR     STACKPHOT
-      STATICSKY_CALIBRATION   STR     STATICSKY_DEEPCAL 
+      STATICSKY_CALIBRATION   STR     STATICSKY_MD_DEEPCAL 
 END
 
@@ -690,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
 
@@ -701,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
 
