Index: /trunk/ippScripts/scripts/magic_destreak_cleanup.pl
===================================================================
--- /trunk/ippScripts/scripts/magic_destreak_cleanup.pl	(revision 27784)
+++ /trunk/ippScripts/scripts/magic_destreak_cleanup.pl	(revision 27785)
@@ -63,13 +63,4 @@
 $ipprc->redirect_output($logfile) or my_die( "Unable to redirect output", $magic_ds_id, $PS_EXIT_SYS_ERROR ) if $logfile;
 
-if (0) {
-my $nebulousServer = metadataLookupStr( $ipprc->{_siteConfig}, 'NEB_SERVER' );
-&my_die("cannot find NEB_SERVER in site configuration", $magic_ds_id, $PS_EXIT_CONFIG_ERROR) if !$nebulousServer;
-
-my $nebulous = eval { Nebulous::Client->new( proxy => $nebulousServer ); };
-if ($@ or not defined $nebulous) {
-    &my_die ("Unable to create a Nebulous::Client object with proxy $nebulousServer", $magic_ds_id, $PS_EXIT_CONFIG_ERROR);
-}
-}
 
 $dbname = metadataLookupStr( $ipprc->{_siteConfig}, 'DBNAME' ) if !$dbname;
@@ -108,4 +99,7 @@
 
 
+&my_die("cleanup not supported for camera stage", $magic_ds_id, $PS_EXIT_PROG_ERROR) if $stage eq "camera";
+
+
 &my_die("unexpected run state found: $state", $magic_ds_id, $PS_EXIT_CONFIG_ERROR) if $state ne "goto_cleaned";
 &my_die("clean not allowed for raw stage, use goto_restore", $magic_ds_id, $PS_EXIT_CONFIG_ERROR) if $stage eq "raw";
@@ -130,4 +124,8 @@
 $dbh->disconnect() or warn $dbh->errstr;
 
+# We no longer clean up the camera stage mask files, but the code was left in place in case
+# we change our minds.
+my $cleanup_cam_mask = 0;
+
 my $dynamicMasks;               # Use dynamic masks?
 foreach my $comp (@components) {
@@ -140,5 +138,5 @@
         if ($stage eq "chip") {
             # Check to see if we're using dynamic masks
-            if (!defined $dynamicMasks) {
+            if ($cleanup_cam_mask && !defined $dynamicMasks) {
                 # Get the PSASTRO recipe
                 my $command = "$ppConfigDump -camera $camera -recipe PSASTRO $recipe_psastro -dump-recipe PSASTRO -";
