Index: /branches/2dbias/ippconfig/gpc1/format_20100723.config
===================================================================
--- /branches/2dbias/ippconfig/gpc1/format_20100723.config	(revision 42665)
+++ /branches/2dbias/ippconfig/gpc1/format_20100723.config	(revision 42666)
@@ -161,6 +161,14 @@
                 CELL.TRIMSEC.SOURCE     STR     HEADER
                 CELL.TRIMSEC            STR     DATASEC
-                CELL.BIASSEC.SOURCE     STR     HEADER
-                CELL.BIASSEC            STR     BIASSEC
+#                CELL.BIASSEC.SOURCE     STR     HEADER
+#                CELL.BIASSEC            STR     BIASSEC
+# two regions are needed for 2D bias subtraction. the first is the read-dir (y), the second is the cross-dir (x)
+# 2D bias subtraction requires ppImage.config OVERSCAN.2D to be TRUE
+               CELL.BIASSEC.SOURCE     STR     VALUE
+               CELL.BIASSEC            STR     [591:624,1:598],[1:590,598:608]
+#
+# a single region will be used for constant and 1D bias subtraction
+#               CELL.BIASSEC.SOURCE     STR     VALUE
+#               CELL.BIASSEC            STR     [591:624,1:608]
         END
 END
Index: /branches/2dbias/ippconfig/recipes/jpeg.mdc
===================================================================
--- /branches/2dbias/ippconfig/recipes/jpeg.mdc	(revision 42665)
+++ /branches/2dbias/ippconfig/recipes/jpeg.mdc	(revision 42666)
@@ -1,2 +1,16 @@
+# This recipe file is used in a slightly different fashion from the others
+# The different programs define an output JPEG file (or files) for the binned
+# images with names based on the program and the binning level.
+
+# ppImage : PPIMAGE.JPEG1 & PPIMAGE.JPEG2
+# ppSub   : PPSUB.OUTPUT.JPEG1 & PPSUB.OUTPUT.JPEG2 & PPSUB.OUTPUT.RESID.JPEG
+# ppStack : PPSTACK.OUTPUT.JPEG1 & PPSTACK.OUTPUT.JPEG2
+# ppstamp : PPSTAMP.OUTPUT.JPEG
+
+# these names are the used to select the recipe metadata blocks below
+
+# alternate recipes can be defined by nesting those metadata blocks inside
+# additional named blocks, like the BIAS example below
+
 # JPEG options for files
 # Each METADATA entry should contain:
@@ -7,4 +21,14 @@
 # * OPTIONS: comma-separated list : -SB,+SB,+X,+Y,-X,-Y
 
+# to define the grayscale values, the image robust MEAN and STDEV are calculated
+# (if those cannot be calculated, a simple MEAN and STDEV are used)
+
+# the different SCALE.MODE values define the min and max colorscale values as:
+# RANGE    : MEAN - 2*STDEV*SCALE.MIN to MEAN + 2*STDEV*SCALE.MAX
+# FRACTION : MEAN*SCALE.MIN           to MEAN*SCALE.MAX
+# VALUE    : SCALE.MIN                to SCALE.MAX
+
+# COLORMAP values can be: greyscale, grayscale, -greyscale, -grayscale, heat, rainbow, 
+
 PPIMAGE.JPEG1  	        METADATA
 	COLORMAP	STR	-greyscale
@@ -15,18 +39,36 @@
 END
 
+PPIMAGE.JPEG2	METADATA
+	COLORMAP	STR	-greyscale
+	SCALE.MODE	STR	RANGE
+	SCALE.MIN	F32	 -5.0
+	SCALE.MAX	F32	+10.0
+	OPTIONS		STR	-SB,-X,+Y
+END
+
+ALTCOLORS		METADATA
+    PPIMAGE.JPEG1           METADATA
+            COLORMAP        STR     rainbow
+            SCALE.MODE      STR     RANGE
+            SCALE.MIN       F32      -5.0
+            SCALE.MAX       F32     +10.0
+            OPTIONS         STR     +SB,-X,+Y
+    END
+    
+    PPIMAGE.JPEG2   METADATA
+            COLORMAP        STR     rainbow
+            SCALE.MODE      STR     RANGE
+            SCALE.MIN       F32      -5.0
+            SCALE.MAX       F32     +10.0
+            OPTIONS         STR     -SB,-X,+Y
+    END
+END
+
 PPIMAGE.JPEG1.HEAT	METADATA
-	COLORMAP	STR	heat
+	COLORMAP	STR	-greyscale
 	SCALE.MODE	STR	FRACTION
-	SCALE.MIN	F32	0.95
-	SCALE.MAX	F32	1.05
-	OPTIONS		STR	+SB,-X,+Y
-END
-
-PPIMAGE.JPEG2	METADATA
-	COLORMAP	STR	-greyscale
-	SCALE.MODE	STR	RANGE
-	SCALE.MIN	F32	 -5.0
-	SCALE.MAX	F32	+10.0
-	OPTIONS		STR	-SB,-X,+Y
+	SCALE.MIN	F32	0.5
+	SCALE.MAX	F32	1.5
+	OPTIONS		STR	+SB,+X,+Y
 END
 
Index: /branches/2dbias/ippconfig/recipes/ppImage.config
===================================================================
--- /branches/2dbias/ippconfig/recipes/ppImage.config	(revision 42665)
+++ /branches/2dbias/ippconfig/recipes/ppImage.config	(revision 42666)
@@ -97,4 +97,10 @@
 # Overscan subtraction
 OVERSCAN.SINGLE         BOOL    TRUE            # Reduce overscan to a single value?
+OVERSCAN.CONSTANT	BOOL	FALSE		# Apply a known, fixed value?
+OVERSCAN.VALUE	        F32	0.0		# value to apply, if requested
+OVERSCAN.MIN.VALID      F32	0.0		# minimum valid overscan value 
+OVERSCAN.MAX.VALID      F32	65536.0		# maximum valid overscan value 
+
+# statistics to use to convert overscan region to a vector
 OVERSCAN.FIT            STR     NONE            # NONE | POLYNOMIAL | SPLINE
 OVERSCAN.ORDER          S32     5               # Order of polynomial fit
@@ -102,8 +108,13 @@
 OVERSCAN.BOXCAR		S32	0		# Boxcar smoothing radius
 OVERSCAN.GAUSS		F32	0.0		# Gaussian smoothing sigma
-OVERSCAN.CONSTANT	BOOL	FALSE		# Apply a known, fixed value?
-OVERSCAN.VALUE	        F32	0.0		# value to apply, if requested
-OVERSCAN.MIN.VALID      F32	0.0		# minimum valid overscan value 
-OVERSCAN.MAX.VALID      F32	65536.0		# maximum valid overscan value 
+
+OVERSCAN.2D             BOOL    FALSE           # use a 2D model for the overscan subtraction?
+
+# statistics to use to convert 2D top-overscan region to a vector
+OVERSCAN.2D.FIT         STR     NONE            # NONE | POLYNOMIAL | SPLINE
+OVERSCAN.2D.ORDER       S32     5               # Order of polynomial fit
+OVERSCAN.2D.STAT        STR     MEAN            # MEAN | MEDIAN
+OVERSCAN.2D.BOXCAR	S32	0		# Boxcar smoothing radius
+OVERSCAN.2D.GAUSS	F32	0.0		# Gaussian smoothing sigma
 
 # Pattern Row subtraction options
@@ -2626,5 +2637,5 @@
   FLAT               BOOL    TRUE            # Flat-field normalisation
   MASK               BOOL    TRUE            # Mask bad pixels
-  MASK.BUILD	     BOOL    TRUE	     # Build internal mask?
+  MASK.BUILD	     BOOL    TRUE 	     # Build internal mask?
   MASK.BURNTOOL      BOOL    FALSE           # Mask potential burntool trails
   PATTERN.ROW        BOOL    FALSE           # Row pattern correction
@@ -2633,4 +2644,6 @@
   BIN1.FITS          BOOL    TRUE            # Save 1st binned chip image?
   BIN2.FITS          BOOL    TRUE            # Save 2nd binned chip image?
+  BIN1.JPEG          BOOL    TRUE            # Save 1st binned jpeg?
+  BIN2.JPEG          BOOL    TRUE            # Save 2nd binned jpeg?
   PHOTOM             BOOL    FALSE           # Source identification and photometry
   ASTROM.CHIP        BOOL    FALSE           # Astrometry per chip?
@@ -2639,6 +2652,6 @@
   CROSSTALK.MEASURE  BOOL    FALSE           # Subtract model background?
 
-  BACKGROUND         BOOL    TRUE            # Subtract background?
-  PATTERN.DEAD.CELLS BOOL    TRUE            # continuity corrections (see options below)
+  BACKGROUND         BOOL    FALSE           # Subtract background?
+  PATTERN.DEAD.CELLS BOOL    FALSE           # continuity corrections (see options below)
   OVERSCAN.MIN.VALID F32     100.0           # Overscan subtraction
   OVERSCAN.MAX.VALID F32   64000.0           # Overscan subtraction
Index: /branches/2dbias/ippconfig/recipes/reductionClasses.mdc
===================================================================
--- /branches/2dbias/ippconfig/recipes/reductionClasses.mdc	(revision 42665)
+++ /branches/2dbias/ippconfig/recipes/reductionClasses.mdc	(revision 42666)
@@ -1,3 +1,14 @@
 # These reduction classes define recipes that go together as a group
+
+# the detrend reduction classes are used by the detrend ippScripts to select
+# the desired recipes for the different types of detrend products:
+
+## detrend_process_imfile.pl loads recipes (det_type)_PROCESS & (det_type)_JPEG_IMAGE
+## detrend_resid_imfile.pl loads either (det_type)_RESID OR (det_type)_VERIFY AND (det_type)_JPEG_RESID
+## detrend_stack.pl loads (det_type)_STACK
+
+# (det_type)_PROCESS & (det_type)_RESID are used to select PPIMAGE recipes
+# (det_type)_JPEG_IMAGE, (det_type)_JPEG_RESID are used to select JPEG recipes
+# (det_type)_STACK is used to select the PPMERGE recipe (NOTE: not ppStack)
 
 DETREND         METADATA
