Index: trunk/ippconfig/recipes/fitstypes.mdc
===================================================================
--- trunk/ippconfig/recipes/fitstypes.mdc	(revision 41902)
+++ trunk/ippconfig/recipes/fitstypes.mdc	(revision 42100)
@@ -130,4 +130,6 @@
 
 # Compressed exposure image
+# NOTE: only allows exposure times up to 6553.6 seconds
+# (too small for UNIONS and other deep stacks)
 EXP	METADATA
 	BITPIX		S32	16
@@ -146,4 +148,51 @@
 END
 
+# Deep Compressed log flux image for stacks.
+# allows real images values up to 10^8 DN
+STK_UNIONS_RAW     METADATA
+	BITPIX		S32	-32
+	SCALING		STR	MANUAL
+	BSCALE		F32	1.0
+	BZERO		F32	0.0
+	COMPRESSION	STR	NONE
+	TILE.X		S32	0
+	TILE.Y		S32	1
+	TILE.Z		S32	1
+	NOISE		S32	8
+END
+
+STK_UNIONS_COMP     METADATA
+        BITPIX          S32     16
+        SCALING         STR     ASINH_MANUAL
+	BSCALE		F32	0.00061	# 2^15 ~ 100M DN
+	BZERO		F32	0.0	# symmetric about 0.0 DN
+	BOFFSET		F32	0.0	# symmetric about 0.0 DN
+	BSOFTEN		F32	1.0	# bend the curve at 1 DN
+	COMPRESSION     STR     RICE
+	TILE.X		S32	0
+	TILE.Y		S32	1
+	TILE.Z		S32	1
+	NOISE		S32	8
+END
+
+# Deep compressed exposure image
+# NOTE: only allows exposure times up to 65536 seconds
+# (OK for UNIONS but not MD deep stacks)
+EXP_UNIONS METADATA
+	BITPIX		S32	16
+	SCALING		STR	MANUAL
+	FUZZ		BOOL	FALSE
+	# Note: TRUE = BZERO + BSCALE * DISK
+	BSCALE		F32	1	# Disk is stored as 1/10th sec
+	BZERO		F32	32768	# Store unsigned zero as zero
+	# switch to NONE to work around ticket 1411
+	#COMPRESSION	STR	NONE
+	COMPRESSION	STR	GZIP
+	TILE.X		S32	0
+	TILE.Y		S32	1
+	TILE.Z		S32	1
+	NOISE		S32	8
+END
+
 # Compressed number image
 EXPNUM	METADATA
Index: trunk/ippconfig/recipes/ppStack.config
===================================================================
--- trunk/ippconfig/recipes/ppStack.config	(revision 41902)
+++ trunk/ippconfig/recipes/ppStack.config	(revision 42100)
@@ -9,7 +9,7 @@
 COMBINE.DISCARD	F32	0.2		# Discard fraction for Olympic weighted mean
 
-COMBINE.PERCENT   BOOL  FALSE           # Use a single percentile clipping?
-COMBINE.MIN.RANGE F32   0.16            # Minimum fraction for percentile clipping
-COMBINE.MAX.RANGE F32   0.84            # Maximum fraction for percentile clipping
+COMBINE.PERCENT         BOOL  FALSE     # Use a single percentile clipping?
+COMBINE.REJECT.FRACTION F32   0.32      # fraction of outliers to reject in percentile clipping
+                                        # Note this is the total both above and below the median
 
 MASK.VAL	STR	MASK.VALUE,CONV.BAD,GHOST # Mask value of input bad pixels
@@ -18,4 +18,6 @@
 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)
+
+SKIP.MISSING.INPUTS BOOL FALSE          # If some input warp images are missing, make the stack anyway
 
 # we are in some danger of inconsistency in the definition of a 'bad' vs a 'suspect' pixel
@@ -113,4 +115,5 @@
 OUTPUT.NOCOMP   BOOL    FALSE           # use filerules that make conconpressed outputs
 OUTPUT.LOGFLUX  BOOL    FALSE           # choose a log-scaling for output images
+OUTPUT.DEEPEXP  BOOL    FALSE           # allow exptime maps with dynamic range up to 2^16 (64k) seconds
 
 OUTPUT.REPLICATE BOOL   TRUE
@@ -227,7 +230,12 @@
 END
 
-
-
-
+STACK_UNIONS_DR3 METADATA
+  COMBINE.PERCENT     BOOL TRUE  # Use a single percentile clipping?
+  SKIP.MISSING.INPUTS BOOL TRUE  # If some input warp images are missing, make the stack anyway
+  CONVOLVE	      BOOL FALSE # Convolve images when stacking?
+  OUTPUT.NOCOMP       BOOL FALSE # use filerules that make compressed outputs
+  OUTPUT.LOGFLUX      BOOL TRUE  # choose a log-scaling for output images
+  OUTPUT.DEEPEXP      BOOL TRUE  # allow exptime maps with dynamic range up to 2^16 (64k) seconds
+END
 
 TEST1 METADATA
Index: trunk/ippconfig/recipes/ppStatsFromMetadata.config
===================================================================
--- trunk/ippconfig/recipes/ppStatsFromMetadata.config	(revision 41902)
+++ trunk/ippconfig/recipes/ppStatsFromMetadata.config	(revision 42100)
@@ -271,5 +271,5 @@
   TYPE   VAL  KEYWORD             TYPE STATISTIC         FLAG 
   ENTRY  VAL  CERROR              F32  RMS              -sigma_ra          
-  ENTRY  VAL  CERROR              F32  RMS              -sigma_dec         
+  ENTRY  VAL  CERROR              F32  SAMPLE_MEDIAN    -sigma_dec         
   ENTRY  VAL  DT_ASTR             F32  SUM              -dtime_astrom      
   ENTRY  VAL  NASTRO              S32  SUM              -n_astrom          
Index: trunk/ippconfig/recipes/psphot.config
===================================================================
--- trunk/ippconfig/recipes/psphot.config	(revision 41902)
+++ trunk/ippconfig/recipes/psphot.config	(revision 42100)
@@ -58,4 +58,5 @@
 				    	  		  # input pixels contribute less than this fraction of the flux
 PEAKS_NMAX_TOTAL                    S32   0               # maximum allowed number of peaks 0 == unlimited
+PEAKS_USE_SIGNAL_IMAGE              BOOL  FALSE           # on first pass, use signal image not signficance image to find peaks
 
 # parameters which adjust the footprint analysis
@@ -111,4 +112,5 @@
 LMM_FIT_CHISQ_CONVERGENCE           BOOL  TRUE            # use the (old) chisq convergence or the new parameter one 
 LMM_FIT_GAIN_FACTOR_MODE            S32   0               # there are 3 options to determine the gain factor (0,1,2)
+LMM_FIT_USE_REWEIGHTING             BOOL  FALSE           # use IRLS-style reweighting (TRUE) or ordinary LMM
 
 PSF_FIT_ITER                        S32   50              # Maximum number of fitting iterations for PSF
@@ -1042,2 +1044,5 @@
 M31_DEEP METADATA 
 END
+
+UNIONS_DR3 METADATA
+END
Index: trunk/ippconfig/recipes/pswarp.config
===================================================================
--- trunk/ippconfig/recipes/pswarp.config	(revision 41902)
+++ trunk/ippconfig/recipes/pswarp.config	(revision 42100)
@@ -29,5 +29,5 @@
 BKG.YGRID              S32    4
 
-ADDITIONAL_WCS_ORDERS S32     3                # By default, use a bilevel astrometric model with 4 additional orders.
+ADDITIONAL_WCS_ORDERS S32     3                # By default, use a bilevel astrometric model with 3 additional orders.
 
 # Default recipe for warping
Index: trunk/ippconfig/recipes/reductionClasses.mdc
===================================================================
--- trunk/ippconfig/recipes/reductionClasses.mdc	(revision 41902)
+++ trunk/ippconfig/recipes/reductionClasses.mdc	(revision 42100)
@@ -2062,2 +2062,26 @@
         PSVIDEOPHOT                 STR     PSVIDEOPHOT
 END
+
+# UNIONS DR3 reduction class
+UNIONS_DR3  METADATA
+    CHIP_PPIMAGE                STR     CHIP
+    CHIP_PSPHOT                 STR     CHIP
+    WARP_PSWARP                 STR     WARP
+    STACK_PPSTACK               STR     STACK_UNIONS_DR3
+    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     UNIONS_DR3
+    STACKPHOT_PPSUB             STR     STACKPHOT
+    STACKPHOT_PPSTACK           STR     STACKPHOT
+    STACKPHOT_SINGLE_PSPHOT     STR     STACKPHOT_SINGLE
+    BACKGROUND_PPBACKGROUND     STR     BACKGROUND
+    BACKGROUND_PSWARP           STR     BACKGROUND
+    PSVIDEOPHOT                 STR     PSVIDEOPHOT
+END
