Index: trunk/ppMerge/src/ppMergeOptions.c
===================================================================
--- trunk/ppMerge/src/ppMergeOptions.c	(revision 9832)
+++ trunk/ppMerge/src/ppMergeOptions.c	(revision 9996)
@@ -37,4 +37,5 @@
     options->fringe = false;
     options->shutter = false;
+    options->mask = false;
     options->sample = 1;
     options->mean = PS_STAT_SAMPLE_MEDIAN;
@@ -47,4 +48,6 @@
     options->shutterIter = 2;
     options->shutterRej = 3.0;
+    options->maskSuspect = 5.0;
+    options->maskBad = 10.0;
     options->onOff = 0;
     options->combine = pmCombineParamsAlloc(PS_STAT_SAMPLE_MEAN);
@@ -143,4 +146,6 @@
     OPTION_PARSE(options->shutterIter,       recipe, "SHUTTER.ITER",   S32);
     OPTION_PARSE(options->shutterRej,        recipe, "SHUTTER.REJECT", F32);
+    OPTION_PARSE(options->maskSuspect,       recipe, "MASK.SUSPECT",   F32);
+    OPTION_PARSE(options->maskBad,           recipe, "MASK.BAD",       F32);
 
     options->combine->combine = parseStat(recipe, "COMBINE");
@@ -159,4 +164,5 @@
             options->fringe = false;
             options->shutter = false;
+            options->mask = false;
         } else if (strcasecmp(type, "DARK") == 0) {
             options->zero = false;
@@ -165,4 +171,5 @@
             options->fringe = false;
             options->shutter = false;
+            options->mask = false;
         } else if (strcasecmp(type, "FLAT") == 0) {
             options->zero = false;
@@ -171,4 +178,5 @@
             options->fringe = false;
             options->shutter = false;
+            options->mask = false;
         } else if (strcasecmp(type, "FRINGE") == 0) {
             options->zero = true;
@@ -177,4 +185,5 @@
             options->fringe = true;
             options->shutter = false;
+            options->mask = false;
         } else if (strcasecmp(type, "SHUTTER") == 0) {
             options->zero = false;
@@ -183,4 +192,13 @@
             options->fringe = false;
             options->shutter = true;
+            options->mask = false;
+            options->rows = 0;          // Read the whole image at once
+        } else if (strcasecmp(type, "MASK") == 0) {
+            options->zero = false;
+            options->scale = false;
+            options->darktime = false;
+            options->fringe = false;
+            options->shutter = false;
+            options->mask = true;
         } else {
             psLogMsg(__func__, PS_LOG_WARN, "Unrecognised image type: %s --- assuming BIAS.\n", type);
@@ -190,4 +208,5 @@
             options->fringe = false;
             options->shutter = false;
+            options->mask = false;
         }
     } else {
@@ -198,4 +217,5 @@
         options->fringe = false;
         options->shutter = false;
+        options->mask = false;
     }
 
