Index: branches/pap/ippconfig/recipes/ppMerge.config
===================================================================
--- branches/pap/ippconfig/recipes/ppMerge.config	(revision 23948)
+++ branches/pap/ippconfig/recipes/ppMerge.config	(revision 25027)
@@ -1,50 +1,61 @@
 # Recipe configuration for ppMerge
 
-ROWS            S32     128		# Number of rows to read at once
-ELECTRONS       F32     100.0           # Minimum number of electrons for useful signal
-SAMPLE          S32     100000          # Sampling factor for measuring the background
-REJ		F32	3.0		# Rejection threshold (sigma)
-ITER		S32	2		# Number of rejection iterations
-FRACHIGH	F32	0.0		# Fraction of high pixels to reject immediately
-FRACLOW		F32	0.0		# Fraction of low pixels to reject immediately
-NKEEP		S32	5		# Minimum number of pixels in stack to keep
-VARIANCES	BOOL	FALSE		# Use image variances in combination?
-FRINGE.NUM	S32	10000		# Number of fringe regions
-FRINGE.SIZE	S32	5		# Half-size of fringe regions
-FRINGE.XSMOOTH	S32	5		# Number of smoothing regions in x
-FRINGE.YSMOOTH	S32	11		# Number of smoothing regions in y
-CTE.MIN         F32	0.2		# regions lower than this in the CTE image are masked
-SHUTTER.SIZE	S32	128		# Size for shutter measurement regions
-MASK.SUSPECT	F32	5.0		# Threshold for suspect pixels (sigma)
-MASK.BAD	F32	0.2		# Threshold for bad pixels
-MASK.MODE	STR	FRACTION	# Mode for identifying bad pixels in the suspect map
-MASK.CHIPSTATS	BOOL	TRUE		# Measure stats for masking by chip (otherwise by readout)?
-MASK.GROW	S32	0		# Grow bad pixels by this radius
-MASK.SET.VALUE	STR	FLAT		# set this bit in the output mask
+ROWS                S32     128             # Number of rows to read at once
+ELECTRONS           F32     100.0           # Minimum number of electrons for useful signal
+SAMPLE              S32     100000          # Sampling factor for measuring the background
+REJ                 F32     3.0             # Rejection threshold (sigma)
+ITER                S32     2               # Number of rejection iterations
+FRACHIGH            F32     0.0             # Fraction of high pixels to reject immediately
+FRACLOW             F32     0.0             # Fraction of low pixels to reject immediately
+NKEEP               S32     5               # Minimum number of pixels in stack to keep
+VARIANCES           BOOL    FALSE           # Use image variances in combination?
 
-COMBINE		STR	CLIPPED		# Statistic to use for combination
-MEAN		STR	ROBUST_MEDIAN	# Statistic to use to measure the mean
-STDEV		STR	ROBUST_STDEV	# Statistic to use to measure the stdev
+FRINGE.NUM          S32     10000           # Number of fringe regions
+FRINGE.SIZE         S32     5               # Half-size of fringe regions
+FRINGE.XSMOOTH      S32     5               # Number of smoothing regions in x
+FRINGE.YSMOOTH      S32     11              # Number of smoothing regions in y
+FRINGE.SMOOTH       BOOL    FALSE           # Smooth the output image?
+FRINGE.SMOOTH.SIGMA F32     2.0             # Sigma of smoothing Gaussian
 
-MASK.SMOOTH.SUSPECT BOOL TRUE           # smooth the suspect-pixel image before making mask
-MASK.SMOOTH.SCALE   F32  3.0            # sigma (pixels) of smoothing kernel
+CTE.MIN             F32     0.5             # regions lower than this in the CTE image are masked
+SHUTTER.SIZE        S32     128             # Size for shutter measurement regions
 
-STATS.BY.CHIP   BOOL    TRUE            # measure stats for masking by chip (or by readout)
-MASK.GROW.NPIX  S32     3               # measure stats for masking by chip (or by readout)
+INPUT.MASKS.USE	BOOL	TRUE		# respect the input mask data?
+
+COMBINE             STR     CLIPPED         # Statistic to use for combination
+MEAN                STR     ROBUST_MEDIAN   # Statistic to use to measure the mean
+STDEV               STR     ROBUST_STDEV    # Statistic to use to measure the stdev
+
+MASK.SUSPECT.MODE   STR     SIGMA           # how to identify suspect pixels: SIGMA, VALUE
+MASK.SUSPECT.MIN    F32    -100.0           # for MASK.SUSPECT.MODE == VALUE, below this is suspect
+MASK.SUSPECT.MAX    F32    +100.0           # for MASK.SUSPECT.MODE == VALUE, above this is suspect
+MASK.SUSPECT.SIGMA  F32     5.0             # Threshold for suspect pixels (sigma)
+
+MASK.SMOOTH.SUSPECT BOOL    TRUE            # smooth the suspect-pixel image before making mask
+MASK.SMOOTH.SCALE   F32     3.0             # sigma (pixels) of smoothing kernel
+
+MASK.BAD            F32     0.2             # Threshold for bad pixels
+MASK.MODE           STR     FRACTION        # Mode for identifying bad pixels in the suspect map
+MASK.CHIPSTATS      BOOL    TRUE            # Measure stats for masking by chip (otherwise by readout)?
+MASK.GROW           S32     0               # Grow bad pixels by this radius
+MASK.SET.VALUE      STR     FLAT            # set this bit in the output mask
+
+STATS.BY.CHIP       BOOL    TRUE            # measure stats for masking by chip (or by readout)
+MASK.GROW.NPIX      S32     3               # measure stats for masking by chip (or by readout)
 
 # Ordinates for fitting dark current
-DARK.ORDINATES	METADATA
-	CELL.DARKTIME	S32	1	# Traditional dark current term
+DARK.ORDINATES  METADATA
+        CELL.DARKTIME   S32     1       # Traditional dark current term
 END
-DARK.NORM	STR	NONE		# Dark normalisation concept
+DARK.NORM       STR     NONE            # Dark normalisation concept
 
 # Bias combination --- don't want min/max rejection
-PPMERGE_BIAS	METADATA
-	REJ		F32	3.0		# Rejection threshold (sigma)
-	ITER		S32	2		# Number of rejection iterations
-	FRACHIGH	F32	0.0		# Fraction of high pixels to reject immediately
-	FRACLOW		F32	0.0		# Fraction of low pixels to reject immediately
-	VARIANCES	BOOL	FALSE		# Use image variances?
-	COMBINE		STR	CLIPPED		# Statistic to use for combination: 
+PPMERGE_BIAS    METADATA
+        REJ             F32     3.0             # Rejection threshold (sigma)
+        ITER            S32     2               # Number of rejection iterations
+        FRACHIGH        F32     0.0             # Fraction of high pixels to reject immediately
+        FRACLOW         F32     0.0             # Fraction of low pixels to reject immediately
+        VARIANCES       BOOL    FALSE           # Use image variances?
+        COMBINE         STR     CLIPPED         # Statistic to use for combination: 
 END
 
@@ -52,45 +63,45 @@
 # Dark combination --- don't want min/max rejection
 # More aggressive clipping than bias, so as to remove CRs
-PPMERGE_DARK	METADATA
-	REJ		F32	3.0		# Rejection threshold (sigma)
-	ITER		S32	2		# Number of rejection iterations
-	FRACHIGH	F32	0.0		# Fraction of high pixels to reject immediately
-	FRACLOW		F32	0.0		# Fraction of low pixels to reject immediately
-	VARIANCES	BOOL	TRUE		# Use image variances?
-	COMBINE		STR	CLIPPED		# Statistic to use for combination: 
+PPMERGE_DARK    METADATA
+        REJ             F32     3.0             # Rejection threshold (sigma)
+        ITER            S32     2               # Number of rejection iterations
+        FRACHIGH        F32     0.0             # Fraction of high pixels to reject immediately
+        FRACLOW         F32     0.0             # Fraction of low pixels to reject immediately
+        VARIANCES       BOOL    TRUE            # Use image variances?
+        COMBINE         STR     CLIPPED         # Statistic to use for combination: 
 END
 
 # Flat combination --- use min/max rejection
-PPMERGE_FLAT	METADATA
-	REJ		F32	3.0		# Rejection threshold (sigma)
-	ITER		S32	1		# Number of rejection iterations
-	FRACHIGH	F32	0.3		# Fraction of high pixels to reject immediately
-	FRACLOW		F32	0.1		# Fraction of low pixels to reject immediately
-	NKEEP		S32	5		# Minimum number of pixels in stack to keep
-	VARIANCES	BOOL	TRUE		# Use image variances?
-	COMBINE		STR	MEAN		# Statistic to use for combination: 
+PPMERGE_FLAT    METADATA
+        REJ             F32     3.0             # Rejection threshold (sigma)
+        ITER            S32     1               # Number of rejection iterations
+        FRACHIGH        F32     0.3             # Fraction of high pixels to reject immediately
+        FRACLOW         F32     0.1             # Fraction of low pixels to reject immediately
+        NKEEP           S32     5               # Minimum number of pixels in stack to keep
+        VARIANCES       BOOL    TRUE            # Use image variances?
+        COMBINE         STR     MEAN            # Statistic to use for combination: 
 END
 
 
 # Fringe combination --- already included in default, above
-PPMERGE_FRINGE	METADATA
-	FRACHIGH	F32	0.1		# Fraction of high pixels to reject immediately
-	VARIANCES	BOOL	TRUE		# Use image variances?
+PPMERGE_FRINGE  METADATA
+        FRACHIGH        F32     0.1             # Fraction of high pixels to reject immediately
+        VARIANCES       BOOL    TRUE            # Use image variances?
 END
 
 # Mask generation --- already included in default, above
 PPMERGE_DARKMASK METADATA
-	ITER		S32	2		# Number of iterations
-	MASK.BAD	F32	0.2		# Threshold for bad pixels (sigma)
-	MASK.MODE	STR	FRACTION	# Mode for identifying bad pixels in the suspect map
-        MASK.SET.VALUE	STR	DARK		# set this bit in the output mask
+        ITER            S32     2               # Number of iterations
+        MASK.BAD        F32     0.2             # Threshold for bad pixels (sigma)
+        MASK.MODE       STR     FRACTION        # Mode for identifying bad pixels in the suspect map
+        MASK.SET.VALUE  STR     DARK            # set this bit in the output mask
 END
 
 # Mask generation --- already included in default, above
 PPMERGE_FLATMASK METADATA
-	ITER		S32	2		# Number of iterations
-	MASK.BAD	F32	0.2		# Threshold for bad pixels (sigma)
-	MASK.MODE	STR	FRACTION	# Mode for identifying bad pixels in the suspect map
-        MASK.SET.VALUE	STR	FLAT		# set this bit in the output mask
+        ITER            S32     2               # Number of iterations
+        MASK.BAD        F32     0.2             # Threshold for bad pixels (sigma)
+        MASK.MODE       STR     FRACTION        # Mode for identifying bad pixels in the suspect map
+        MASK.SET.VALUE  STR     FLAT            # set this bit in the output mask
 END
 
@@ -98,17 +109,18 @@
 # but it then sets a mask based on the resulting data values (using CTE.MIN)
 PPMERGE_CTEMASK METADATA
-	REJ		F32	3.0		# Rejection threshold (sigma)
-	ITER		S32	2		# Number of rejection iterations
-	FRACHIGH	F32	0.0		# Fraction of high pixels to reject immediately
-	FRACLOW		F32	0.0		# Fraction of low pixels to reject immediately
-	VARIANCES	BOOL	FALSE		# Use image variances?
-	COMBINE		STR	CLIPPED		# Statistic to use for combination: 
-        CTE.MIN         F32	0.2		# regions lower than this in the CTE image are masked
-        MASK.SET.VALUE	STR	CTE		# set this bit in the output mask
+        REJ             F32     3.0             # Rejection threshold (sigma)
+        ITER            S32     2               # Number of rejection iterations
+        FRACHIGH        F32     0.0             # Fraction of high pixels to reject immediately
+        FRACLOW         F32     0.0             # Fraction of low pixels to reject immediately
+        VARIANCES       BOOL    FALSE           # Use image variances?
+        COMBINE         STR     CLIPPED         # Statistic to use for combination: 
+        CTE.MIN         F32     0.5             # regions lower than this in the CTE image are masked
+        MASK.SET.VALUE  STR     CTE             # set this bit in the output mask
+	INPUT.MASKS.USE	BOOL	FALSE		# respect the input mask data?
 END
 
 # Shutter generation --- already included in default, above
-PPMERGE_SHUTTER	METADATA
-	REJ		F32	2.0		# Rejection threshold (sigma)
-	ITER		S32	1		# Number of rejection iterations
+PPMERGE_SHUTTER METADATA
+        REJ             F32     2.0             # Rejection threshold (sigma)
+        ITER            S32     1               # Number of rejection iterations
 END
