# Recipe configuration for ppMerge
 
ROWS            S32     512		# Number of rows to read at once
ELECTRONS       F32     100.0           # Minimum number of electrons for useful signal
SAMPLE          S32     100             # Sampling factor for measuring the background
REJ		F32	3.0		# Rejection threshold (sigma)
ITER		S32	1		# 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
WEIGHTS		BOOL	FALSE		# Use image weights 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
SHUTTER.SIZE	S32	128		# Size for shutter measurement regions
SHUTTER.ITER	S32	1		# Number of iterations for shutter measurement
SHUTTER.REJECT	F32	2		# Rejection limit for shutter measurement
MASK.SUSPECT	F32	5.0		# Threshold for suspect pixels (sigma)
MASK.BAD	F32	-4.0		# Threshold for bad pixels (sigma)
MASKVAL		STR	SAT,BAD		# Mask value for input 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


# 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
	WEIGHTS		BOOL	FALSE		# Use image weights?
	COMBINE		STR	CLIPPED		# Statistic to use for combination: 
END


# Dark combination --- don't want min/max rejection
# More aggressive clipping than bias, so as to remove CRs
PPMERGE_DARK	METADATA
	REJ		F32	2.0		# Rejection threshold (sigma)
	ITER		S32	4		# 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
	WEIGHTS		BOOL	FALSE		# Use image weights?
	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
	WEIGHTS		BOOL	TRUE		# Use image weights?
	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
	WEIGHTS		BOOL	TRUE		# Use image weights?
END

# Mask generation --- already included in default, above
PPMERGE_MASK	METADATA
END

# Shutter generation --- already included in default, above
PPMERGE_SHUTTER	METADATA
END
