Index: branches/pap/ppImage/src/ppImageOptions.c
===================================================================
--- branches/pap/ppImage/src/ppImageOptions.c	(revision 23948)
+++ branches/pap/ppImage/src/ppImageOptions.c	(revision 25027)
@@ -25,4 +25,5 @@
     options->doNonLin        = false;   // Non-linearity correction
     options->doOverscan      = false;   // Overscan subtraction
+    options->doNoiseMap      = false;   // Apply Read Noise Map
     options->doBias          = false;   // Bias subtraction
     options->doDark          = false;   // Dark subtraction
@@ -30,4 +31,5 @@
     options->doShutter       = false;   // Shutter correction
     options->doFlat          = false;   // Flat-field normalisation
+    options->doPattern       = false;   // Pattern noise subtraction
     options->doFringe        = false;   // Fringe subtraction
     options->doPhotom        = false;   // Source identification and photometry
@@ -36,4 +38,5 @@
     options->doStats         = false;   // Measure and save image statistics
     options->checkCTE        = false;   // Measure pixel-based variance
+    options->applyParity     = false;   // Apply Cell parities
 
     // output files requested
@@ -58,4 +61,5 @@
     options->lowMask         = 0x00;    // out-of-bounds (low) pixels (supplied to pmReadoutGenerateMask)
     options->flatMask        = 0x00;    // Bad flat pixels (supplied to pmFlatField)
+    options->darkMask        = 0x00;    // Bad dark pixels (supplied to pmDarkApply)
     options->blankMask       = 0x00;    // Blank (no data, cell gap) pixels (supplied to pmChipMosaic, pmFPAMosaic)
     options->markValue       = 0x00;    // A safe bit for internal marking
@@ -83,4 +87,13 @@
     options->fringeIter      = 0;       // Fringe iterations
     options->fringeKeep      = 1.0;     // Fringe keep fraction
+
+    // Pattern noise values
+
+    options->patternOrder    = 0;       // Polynomial order
+    options->patternIter     = 0;       // Clipping iterations
+    options->patternRej      = NAN;     // Clipping rejection threshold
+    options->patternThresh   = NAN;     // Threshold for ignoring pixels
+    options->patternMean     = PS_STAT_NONE; // Statistic for mean
+    options->patternStdev    = PS_STAT_NONE; // Statistic for standard deviation
 
     // Remnance values
@@ -215,4 +228,5 @@
     options->doCrosstalkCorrect = psMetadataLookupBool(NULL, recipe, "CROSSTALK.CORRECT");
 
+    options->doNoiseMap = psMetadataLookupBool(NULL, recipe, "NOISEMAP");
     options->doBias = psMetadataLookupBool(NULL, recipe, "BIAS");
     options->doDark = psMetadataLookupBool(NULL, recipe, "DARK");
@@ -221,4 +235,5 @@
     options->doFringe = psMetadataLookupBool(NULL, recipe, "FRINGE");
     options->doShutter = psMetadataLookupBool(NULL, recipe, "SHUTTER");
+    options->doPattern = psMetadataLookupBool(NULL, recipe, "PATTERN");
 
     options->doStats = false;
@@ -228,4 +243,6 @@
     }
 
+    options->applyParity = psMetadataLookupBool(NULL, recipe, "APPLY.CELL.PARITY");
+
     // binned image options
     options->xBin1 = psMetadataLookupS32(&status, recipe, "BIN1.XBIN");
@@ -274,5 +291,5 @@
 
     // even if not requested explicitly, if any of these are set, build an internal mask and variance:
-    if (options->doBias || options->doOverscan || options->doDark || options->doShutter || options->doFlat ||
+    if (options->doNoiseMap || options->doBias || options->doOverscan || options->doDark || options->doShutter || options->doFlat ||
         options->doPhotom) {
         options->doMaskBuild = true;
@@ -292,4 +309,12 @@
     options->fringeKeep = psMetadataLookupF32(NULL, recipe, "FRINGE.KEEP");
 
+    // Pattern noise
+    options->patternOrder = psMetadataLookupS32(NULL, recipe, "PATTERN.ORDER");
+    options->patternIter = psMetadataLookupS32(NULL, recipe, "PATTERN.ITER");
+    options->patternRej = psMetadataLookupF32(NULL, recipe, "PATTERN.REJ");
+    options->patternThresh = psMetadataLookupF32(NULL, recipe, "PATTERN.THRESH");
+    options->patternMean = psStatsOptionFromString(psMetadataLookupStr(NULL, recipe, "PATTERN.MEAN"));
+    options->patternStdev = psStatsOptionFromString(psMetadataLookupStr(NULL, recipe, "PATTERN.STDEV"));
+
     // Remnance options
     options->remnanceSize = psMetadataLookupF32(NULL, recipe, "REMNANCE.SIZE");
