Index: /trunk/ppImage/src/ppImageParseCamera.c
===================================================================
--- /trunk/ppImage/src/ppImageParseCamera.c	(revision 14210)
+++ /trunk/ppImage/src/ppImageParseCamera.c	(revision 14211)
@@ -143,11 +143,11 @@
 
     // the following files are output targets
-    pmFPAfile *output = pmFPAfileDefineOutput(config, input->fpa, "PPIMAGE.OUTPUT");
-    if (!output) {
+    pmFPAfile *outImage = pmFPAfileDefineOutput(config, input->fpa, "PPIMAGE.OUTPUT");
+    if (!outImage) {
         psError(PS_ERR_IO, false, _("Unable to generate output file from PPIMAGE.OUTPUT"));
         psFree(options);
         return NULL;
     }
-    if (output->type != PM_FPA_FILE_IMAGE) {
+    if (outImage->type != PM_FPA_FILE_IMAGE) {
         psError(PS_ERR_IO, true, "PPIMAGE.OUTPUT is not of type IMAGE");
         psFree(options);
@@ -177,5 +177,5 @@
     }
 
-    // XXX should these be bound explicitly to the output->fpa rather than the input->fpa?
+    // XXX should these be bound explicitly to the outImage->fpa rather than the input->fpa?
     pmFPAfile *chipImage = pmFPAfileDefineChipMosaic(config, input->fpa, "PPIMAGE.CHIP");
     if (!chipImage) {
@@ -238,10 +238,9 @@
     // we create a copy of the mosaicked image for psphot so we can write out a clean image
     if (options->doPhotom) {
+
+        // this file is just used as a carrier; output files (eg, PSPHOT.RESID) are defined by
+        // psphotDefineFiles
         pmFPAfile *psphotInput = pmFPAfileDefineFromFPA (config, chipImage->fpa, 1, 1, "PSPHOT.INPUT");
         PS_ASSERT (psphotInput, false);
-
-        // this file is just used as a carrier;
-        // actual output files (eg, PSPHOT.RESID) are defined below
-        psphotInput->save = false;
 
         // define associated psphot input/output files
@@ -274,19 +273,25 @@
 
     // save any of these files?
-    output->save = outMask->save = outWeight->save = options->BaseFITS;
-    chipImage->save = chipMask->save = chipWeight->save = options->ChipFITS;
-    byFPA1->save = options->FPA1FITS;
-    byFPA2->save = options->FPA2FITS;
-
-    // output is used as a carrier: input to chipImage -> require the data to remain at the CHIP level
-    output->freeLevel = PS_MIN (output->freeLevel, PM_FPA_LEVEL_CHIP);
-    output->dataLevel = output->freeLevel;
-    output->fileLevel = PS_MIN (output->fileLevel, output->dataLevel);
-
-    // outMask and outWeight must be freed at the same level as output (all freed by pmFPAFreeData)
-    outMask->freeLevel   = output->freeLevel;
-    outWeight->freeLevel = output->freeLevel;
-    outMask->dataLevel   = output->dataLevel;
-    outWeight->dataLevel = output->dataLevel;
+    outImage->save   = options->BaseFITS;
+    outMask->save    = options->BaseMaskFITS;
+    outWeight->save  = options->BaseWeightFITS;
+
+    chipImage->save  = options->ChipFITS;
+    chipMask->save   = options->ChipMaskFITS;
+    chipWeight->save = options->ChipWeightFITS;
+
+    byFPA1->save     = options->FPA1FITS;
+    byFPA2->save     = options->FPA2FITS;
+
+    // outImage is used as a carrier: input to chipImage -> require the data to remain at the CHIP level
+    outImage->freeLevel = PS_MIN (outImage->freeLevel, PM_FPA_LEVEL_CHIP);
+    outImage->dataLevel = outImage->freeLevel;
+    outImage->fileLevel = PS_MIN (outImage->fileLevel, outImage->dataLevel);
+
+    // outMask and outWeight must be freed at the same level as outImage (all freed by pmFPAFreeData)
+    outMask->freeLevel   = outImage->freeLevel;
+    outWeight->freeLevel = outImage->freeLevel;
+    outMask->dataLevel   = outImage->dataLevel;
+    outWeight->dataLevel = outImage->dataLevel;
 
     // Ditto for the chip-mosaicked version
@@ -296,6 +301,6 @@
     chipWeight->dataLevel = chipImage->dataLevel;
 
-    // the input data is the same as the output data : force the free levels to match
-    input->freeLevel = PS_MIN (output->freeLevel, input->freeLevel);
+    // the input data is the same as the outImage data : force the free levels to match
+    input->freeLevel = PS_MIN (outImage->freeLevel, input->freeLevel);
 
     // define the binned target files (which may just be carriers for some camera configurations)
@@ -376,12 +381,23 @@
         // It's a fringe file, so change the file type
         input->type = PM_FPA_FILE_FRINGE;
-        output->type = PM_FPA_FILE_FRINGE;
+        outImage->type = PM_FPA_FILE_FRINGE;
     }
 
     // Turn off mask and weight output if we're not doing anything interesting
-    if (!options->doMask && !options->doShutter && !options->doFlat && !options->doPhotom) {
+    bool noMask = (!options->doMask && !options->doShutter && !options->doFlat && !options->doPhotom);
+    if (noMask && outMask->save) {
+        psWarning("output mask image (BASE.MASK.FITS) requested, but not generated: skipping.\n");
         outMask->save = false;
+    }
+    if (noMask && outWeight->save) {
+        psWarning("output weight image (BASE.WEIGHT.FITS) requested, but not generated: skipping.\n");
         outWeight->save = false;
+    }
+    if (noMask && chipMask->save) {
+        psWarning("output mask image (CHIP.MASK.FITS) requested, but not generated: skipping.\n");
         chipMask->save = false;
+    }
+    if (noMask && chipWeight->save) {
+        psWarning("output weight image (CHIP.WEIGHT.FITS) requested, but not generated: skipping.\n");
         chipWeight->save = false;
     }
