Index: branches/pap/ppImage/src/ppImageParseCamera.c
===================================================================
--- branches/pap/ppImage/src/ppImageParseCamera.c	(revision 23948)
+++ branches/pap/ppImage/src/ppImageParseCamera.c	(revision 25027)
@@ -25,4 +25,12 @@
     // otherwise they revert to the config information
     // not all input or output images are used in a given recipe
+    if (options->doNoiseMap) {
+        if (!ppImageDefineFile(config, input->fpa, "PPIMAGE.NOISEMAP", "NOISEMAP",
+                               PM_FPA_FILE_IMAGE, PM_DETREND_TYPE_NOISEMAP)) {
+            psError(PS_ERR_IO, false, "Can't find a noise map image source");
+            psFree(options);
+            return NULL;
+        }
+    }
     if (options->doBias) {
         if (!ppImageDefineFile(config, input->fpa, "PPIMAGE.BIAS", "BIAS",
@@ -48,30 +56,4 @@
             return NULL;
         }
-
-#if 0
-        // I think this is now done automatically in the pmFPAfileDefine and pmFPAfileIOChecks -- PAP.
-
-        // XXX have ppImageDefineFile return the pmFPAfile?
-        pmFPAfile *mask = psMetadataLookupPtr(&status, config->files, "PPIMAGE.MASK");
-        psAssert(mask, "Just defined the mask!");
-
-        // Need to read the names of bit masks from the mask header and set them in the
-        // recipe.  If we are loading this from the detrend db, this action will happen
-        // when the file is resolved.
-        if (!mask->detrend) {
-            // XXX need to load the mask bit names from one of the headers
-            // this grabs the first available hdu : no guarantee that it will be valid, though
-            pmHDU *hdu = pmHDUGetFirst(mask->fpa);
-            if (!hdu) {
-                psError(PS_ERR_IO, true, "no valid HDU for PPIMAGE.INPUT.MASK");
-                return NULL;
-            }
-            // XXX is this consistent with the pmConfigMaskReadHeader call above?
-            if (!pmConfigMaskReadHeader(config, hdu->header)) {
-                psError(PS_ERR_IO, false, "error in mask bits");
-                return NULL;
-            }
-        }
-#endif
     }
     if (options->doShutter) {
