Index: branches/simmosaic_branches/ppImage/src/ppImage.h
===================================================================
--- branches/simmosaic_branches/ppImage/src/ppImage.h	(revision 24860)
+++ branches/simmosaic_branches/ppImage/src/ppImage.h	(revision 27839)
@@ -26,4 +26,5 @@
     bool doMaskBuild;                   // Build internal mask
     bool doVarianceBuild;               // Build internal variance map
+    bool doMaskBurntool;                // mask potential burntool trails
     bool doMaskSat;                     // mask saturated pixels
     bool doMaskLow;                     // mask low pixels
@@ -37,4 +38,6 @@
     bool doShutter;                     // Shutter correction
     bool doFlat;                        // Flat-field normalisation
+    bool doPatternRow;                  // Row pattern correction
+    bool doPatternCell;                 // Cell pattern correction
     bool doFringe;                      // Fringe subtraction
     bool doPhotom;                      // Source identification and photometry
@@ -44,5 +47,5 @@
     bool doStats;                       // call ppStats on the image
     bool checkCTE;                      // measure pixel-based variance
-    bool applyParity;			// Apply Cell parities
+    bool applyParity;                   // Apply Cell parities
 
     bool doCrosstalkMeasure;            // measure crosstalk signal
@@ -73,5 +76,5 @@
     psImageMaskType darkMask;           // Mask value to give bad dark pixels
     psImageMaskType blankMask;          // Mask value to give blank pixels
-
+    psImageMaskType burntoolMask;       // Suspect pixels that fall where a burntool trail is expected.
     // non-linear correction parameters
     psDataType nonLinearType;
@@ -81,5 +84,5 @@
     // options for the analysis
     pmOverscanOptions *overscan;        // Overscan options
-
+    int burntoolTrails;
     // binning parameters
     int xBin1;                          // x-binning, scale 1
@@ -92,4 +95,14 @@
     int fringeIter;                     // Fringe iterations
     float fringeKeep;                   // Fringe keep fraction
+
+    // Pattern correction
+    int patternRowOrder;                   // Polynomial order
+    int patternRowIter;                    // Clipping iterations
+    float patternRowRej;                   // Clipping threshold
+    float patternRowThresh;                // Ignore threshold
+    psStatsOptions patternRowMean;         // Statistic for mean
+    psStatsOptions patternRowStdev;        // Statistic for stdev
+    psStatsOptions patternCellBG;          // statistic for background
+    psStatsOptions patternCellMean;        // Statistic for mean
 
     int remnanceSize;                   // Size for remnance detection
@@ -121,5 +134,5 @@
 
 // apply the cell flips to the input data before analysis
-bool ppImageParityFlip (pmConfig *config, const ppImageOptions *options, const pmFPAview *view);
+bool ppImageParityFlip (pmConfig *config, const ppImageOptions *options, const pmFPAview *view, bool native);
 
 // Loop over the input
@@ -146,4 +159,8 @@
 
 bool ppImageCheckCTE(pmConfig *config, ppImageOptions *options, pmFPAview *view);
+
+bool ppImageBurntoolMask(pmConfig *config, ppImageOptions *options, pmFPAview *view, pmReadout *mask);
+
+bool ppImageDetrendPatternApply(pmConfig *config, pmChip *chip, const pmFPAview *inputView, const ppImageOptions *options);
 
 // Record which detrend file was used for the detrending
