Index: trunk/ppImage/src/ppImage.h
===================================================================
--- trunk/ppImage/src/ppImage.h	(revision 14211)
+++ trunk/ppImage/src/ppImage.h	(revision 14223)
@@ -22,4 +22,6 @@
 typedef struct {
     // actions which ppImage should perform
+    bool doMaskBuild;                   // Build internal mask
+    bool doWeightBuild;                   // Build internal mask
     bool doMask;                        // Mask bad pixels
     bool doNonLin;                      // Non-linearity correction
Index: trunk/ppImage/src/ppImageDetrendReadout.c
===================================================================
--- trunk/ppImage/src/ppImageDetrendReadout.c	(revision 14211)
+++ trunk/ppImage/src/ppImageDetrendReadout.c	(revision 14223)
@@ -16,5 +16,5 @@
 
     // Masking on the basis of pixel value needs to be done before anything else, so the values are pristine.
-    if (options->doMask || options->doShutter || options->doFlat || options->doPhotom) {
+    if (options->doMaskBuild) {
         pmReadoutGenerateMask(input, options->satMask, options->badMask);
     }
@@ -51,5 +51,5 @@
 
     // Weight on the basis of pixel value needs to be done after the overscan has been subtracted
-    if (options->doMask || options->doShutter || options->doFlat || options->doPhotom) {
+    if (options->doWeightBuild) {
         // create the target mask and weight images
         pmReadoutGenerateWeight(input, true);
Index: trunk/ppImage/src/ppImageOptions.c
===================================================================
--- trunk/ppImage/src/ppImageOptions.c	(revision 14211)
+++ trunk/ppImage/src/ppImageOptions.c	(revision 14223)
@@ -18,4 +18,6 @@
 
     // actions which ppImage should perform
+    options->doMaskBuild     = false;	// Build internal mask
+    options->doWeightBuild   = false;	// Build internal weight
     options->doMask          = false;	// Mask bad pixels
     options->doNonLin        = false;	// Non-linearity correction
@@ -180,4 +182,8 @@
     }
 
+    // for these images, even if not required otherwise
+    options->doMaskBuild = psMetadataLookupBool(NULL, recipe, "MASK.BUILD");
+    options->doWeightBuild = psMetadataLookupBool(NULL, recipe, "WEIGHT.BUILD");
+
     // Mask recipe options
     options->doMask = psMetadataLookupBool(NULL, recipe, "MASK");
@@ -190,4 +196,5 @@
     options->flatMask = pmConfigMask("FLAT", config);
     options->blankMask = pmConfigMask("BLANK", config);
+    // XXX should it be an error for these to not exist?
 
     options->doBias = psMetadataLookupBool(NULL, recipe, "BIAS");
@@ -225,4 +232,10 @@
     }
 
+    // even if not requested explicitly, if any of these are set, build an internal mask and weight:
+    if (options->doMask || options->doShutter || options->doFlat || options->doPhotom) {
+	options->doMaskBuild = true;
+	options->doWeightBuild = true;
+    }
+
     options->BaseFITS       = psMetadataLookupBool(NULL, recipe, "BASE.FITS");
     options->BaseMaskFITS   = psMetadataLookupBool(NULL, recipe, "BASE.MASK.FITS");
Index: trunk/ppImage/src/ppImageParseCamera.c
===================================================================
--- trunk/ppImage/src/ppImageParseCamera.c	(revision 14211)
+++ trunk/ppImage/src/ppImageParseCamera.c	(revision 14223)
@@ -385,18 +385,17 @@
 
     // Turn off mask and weight output if we're not doing anything interesting
-    bool noMask = (!options->doMask && !options->doShutter && !options->doFlat && !options->doPhotom);
-    if (noMask && outMask->save) {
+    if (!options->doMaskBuild && outMask->save) {
         psWarning("output mask image (BASE.MASK.FITS) requested, but not generated: skipping.\n");
         outMask->save = false;
     }
-    if (noMask && outWeight->save) {
+    if (!options->doWeightBuild && outWeight->save) {
         psWarning("output weight image (BASE.WEIGHT.FITS) requested, but not generated: skipping.\n");
         outWeight->save = false;
     }
-    if (noMask && chipMask->save) {
+    if (!options->doMaskBuild && chipMask->save) {
         psWarning("output mask image (CHIP.MASK.FITS) requested, but not generated: skipping.\n");
         chipMask->save = false;
     }
-    if (noMask && chipWeight->save) {
+    if (!options->doWeightBuild && chipWeight->save) {
         psWarning("output weight image (CHIP.WEIGHT.FITS) requested, but not generated: skipping.\n");
         chipWeight->save = false;
