Index: trunk/magic/remove/src/streaksremove.c
===================================================================
--- trunk/magic/remove/src/streaksremove.c	(revision 23911)
+++ trunk/magic/remove/src/streaksremove.c	(revision 23936)
@@ -23,22 +23,6 @@
     }
 
-    psMetadata *masks = psMetadataLookupMetadata(&status, config->recipes, "MASKS");
-    if (!status) {
-        psError(PM_ERR_CONFIG, false, "failed to lookup MASKS in recipes\n");
-        streaksExit("", PS_EXIT_CONFIG_ERROR);
-    }
-    double maskStreak = (double) psMetadataLookupU16(&status, masks, "STREAK");
-    if (!status) {
-        psError(PM_ERR_CONFIG, false, "failed to lookup mask value for STREAK in recipes\n");
-        streaksExit("", PS_EXIT_CONFIG_ERROR);
-    }
-
-    // optionally setting pixels with any mask bits execpt POOR.WARP to NAN
-    psU16 poorWarp = (double) psMetadataLookupU16(&status, masks, "CONV.POOR");
-    if (!status) {
-        psError(PM_ERR_CONFIG, false, "failed to lookup mask value for POOR.WARP in recipes\n");
-        streaksExit("", PS_EXIT_CONFIG_ERROR);
-    }
-    psU16 maskMask = ~poorWarp;
+    psU32 maskStreak = 0;
+    psU32 maskMask = 0;
 
     psString streaksFileName = psMetadataLookupStr(NULL, config->arguments, "STREAKS");
@@ -114,4 +98,9 @@
         }
 
+        // now that we've read the input files, lookup the mask values
+        if (maskStreak == 0) {
+            strkGetMaskValues(sfiles, &maskStreak, &maskMask);
+        }
+
         totalPixels += sfiles->inImage->numRows * sfiles->inImage->numCols;
 
@@ -131,4 +120,6 @@
                     psTimerStart("EXCISE_NON_WARPED");
 
+                    // set non-warped pixels and variance to NAN, mask to maskStreak (since the pixel
+                    // is excised as part of the destreaking process)
                     exciseNonWarpedPixels(sfiles, maskStreak);
 
@@ -648,4 +639,5 @@
             }
         }
+        // XXX: check this
         // Assumption: there are no mask and weight images for video cells
         return;
