Index: trunk/ppMerge/src/ppMergeOptions.c
===================================================================
--- trunk/ppMerge/src/ppMergeOptions.c	(revision 13246)
+++ trunk/ppMerge/src/ppMergeOptions.c	(revision 13593)
@@ -59,4 +59,6 @@
     options->combine->maskVal = 0xff;
     options->combine->weights = false;
+    options->satMask = 0x00;
+    options->badMask = 0x00;
 
     return options;
@@ -141,5 +143,4 @@
     OPTION_PARSE(options->combine->fracLow,  recipe, "FRACLOW",        F32);
     OPTION_PARSE(options->combine->nKeep,    recipe, "NKEEP",          S32);
-    OPTION_PARSE(options->combine->maskVal,  recipe, "MASKVAL",        S32);
     OPTION_PARSE(options->combine->weights,  recipe, "WEIGHTS",        Bool);
     OPTION_PARSE(options->fringeNum,         recipe, "FRINGE.NUM",     S32);
@@ -153,4 +154,7 @@
     OPTION_PARSE(options->maskBad,           recipe, "MASK.BAD",       F32);
 
+    const char *masks = psMetadataLookupStr(NULL, recipe, "MASKVAL");
+    options->combine->maskVal = pmConfigMask(masks, config);
+
     options->combine->combine = parseStat(recipe, "COMBINE");
     options->mean             = parseStat(recipe, "MEAN");
@@ -238,5 +242,4 @@
     }
 
-
 #if 0
     // Or you can set them individually
@@ -249,4 +252,8 @@
     OPTION_PARSE(options->onOff, config->arguments, "-onoff", S32);
 
+    // Masking options
+    options->satMask = pmConfigMask("SAT", config);
+    options->badMask = pmConfigMask("BAD", config);
+
     return options;
 }
