Index: branches/2dbias/psModules/src/detrend/pmOverscan.h
===================================================================
--- branches/2dbias/psModules/src/detrend/pmOverscan.h	(revision 42650)
+++ branches/2dbias/psModules/src/detrend/pmOverscan.h	(revision 42664)
@@ -35,7 +35,4 @@
 {
     // Inputs
-    bool single;                        ///< Reduce all overscan regions to a single value?
-    bool constant;			///< use a supplied constant value (do not measure region)
-    float value;			///< supplied value if needed (per above)
     pmFit fitType;                      ///< Type of fit to overscan
     unsigned int order;                 ///< Order of polynomial, or number of spline pieces
@@ -43,30 +40,44 @@
     int boxcar;                         ///< Boxcar smoothing radius
     float gauss;                        ///< Gaussian smoothing sigma
+
+    // These are used to carry the fitted functions, but are only used to generate
+    // an updated reduced vector 
+    psPolynomial1D *poly;               ///< Result of polynomial fit
+    psSpline1D *spline;                 ///< Result of spline fit
+} pmOverscanStatOptions;
+
+/// Options for overscan subtraction
+///
+/// The overscan subtraction may be performed by reducing all overscan regions to a single value (e.g., if
+/// there is no structure); or the overscan may be fit perpendicular to the read direction (usually the
+/// columns) with a particular functional form; or a single value may be subtracted for each read/scan without
+/// fitting (if the structure defies characterisation).  In any case, statistics are required to reduce
+/// multiple values to a single value (either for the scan, or for the entire overscan regions).
+typedef struct
+{
+    // Inputs
+    bool single;                        ///< Reduce all overscan regions to a single value?
+    bool constant;			///< use a supplied constant value (do not measure region)
+    bool TwoD;  		      ///< use a supplied constant value (do not measure region)
+    float value;			///< supplied value if needed (per above)
     float minValid;			///< if overscan is too low, readout is dead : mask
     float maxValid;			///< if overscan is too high, readout is dead : mask
     psImageMaskType maskVal;            ///< Mask value to give dead readouts
 
-    // Outputs
-    psPolynomial1D *poly;               ///< Result of polynomial fit
-    psSpline1D *spline;                 ///< Result of spline fit
-}
-pmOverscanOptions;
+    pmOverscanStatOptions *primary;
+    pmOverscanStatOptions *secondary;
+} pmOverscanOptions;
 
 /// Allocator for overscan options
-pmOverscanOptions *pmOverscanOptionsAlloc(bool single, ///< Reduce all overscan regions to a single value?
-                                          pmFit fitType, ///< Type of fit to overscan
-                                          unsigned int order, ///< Order of polynomial, or number of splines
-                                          psStats *stat, ///< Statistic to use
-                                          int boxcar, ///< Boxcar smoothing radius
-                                          float gauss ///< Gaussian smoothing sigma
-                                         );
+pmOverscanOptions *pmOverscanOptionsAlloc(void);
+
+pmOverscanStatOptions *pmOverscanStatOptionsAlloc(void);
 
 psVector *pmOverscanVector(float *chi2, // chi^2 from fit
-			   pmOverscanOptions *overscanOpts, // Overscan options
-			   const psArray *pixels, // Array of vectors containing the pixel values
-			   psStats *myStats // Statistic to use in reducing the overscan
+			   pmOverscanStatOptions *overscanOpts, // Overscan options
+			   const psArray *pixels // Array of vectors containing the pixel values
     );
 
-bool pmOverscanUpdateHeader (pmHDU *hdu, pmOverscanOptions *overscanOpts, float chi2);
+// bool pmOverscanUpdateHeader (pmHDU *hdu, pmOverscanOptions *overscanOpts, float chi2);
 
 bool pmOverscanSubtract (pmReadout *input, pmOverscanOptions *overscanOpts);
