Index: trunk/ippScripts/scripts/ipp_cleanup.pl
===================================================================
--- trunk/ippScripts/scripts/ipp_cleanup.pl	(revision 25442)
+++ trunk/ippScripts/scripts/ipp_cleanup.pl	(revision 25473)
@@ -345,25 +345,27 @@
 	    }
 	}
-        if ($status) {
-	    my @files = ();
-            # delete the temporary image datafiles
-            addFilename(\@files, "PSWARP.OUTPUT", $path_base, $skycell_id );
-            addFilename(\@files, "PSWARP.OUTPUT.MASK", $path_base, $skycell_id);
-            addFilename(\@files, "PSWARP.OUTPUT.VARIANCE", $path_base, $skycell_id);
+	if ($status) {
+	    if ($skyfile->{quality} != 8007) {
+		my @files = ();
+		
+		# delete the temporary image datafiles
+		addFilename(\@files, "PSWARP.OUTPUT", $path_base, $skycell_id );
+		addFilename(\@files, "PSWARP.OUTPUT.MASK", $path_base, $skycell_id);
+		addFilename(\@files, "PSWARP.OUTPUT.VARIANCE", $path_base, $skycell_id);
 #            addFilename(\@files, "PSWARP.OUTPUT.SOURCES", $path_base, $skycell_id);
-
-            if ($mode eq "goto_purged") {
-                # additional files to remove for 'purge' mode
-                addFilename(\@files, "PSWARP.BIN1", $path_base, $skycell_id );
-                addFilename(\@files, "PSWARP.BIN2", $path_base, $skycell_id );
-                addFilename(\@files, "SKYCELL.STATS", $path_base, $skycell_id );
-                # addFilename(\@files, "PSPHOT.PSF.SKY.SAVE", $path_base);
-
-                # XXX: do we want to delete these?
-                # addFilename(\@files, "TRACE.EXP", $path_base, $skycell_id);
-                # addFilename(\@files, "PSWARP.CONFIG", $path_base, $skycell_id);
-            }
+		if ($mode eq "goto_purged") {
+		    # additional files to remove for 'purge' mode
+		    addFilename(\@files, "PSWARP.BIN1", $path_base, $skycell_id );
+		    addFilename(\@files, "PSWARP.BIN2", $path_base, $skycell_id );
+		    addFilename(\@files, "SKYCELL.STATS", $path_base, $skycell_id );
+		    # addFilename(\@files, "PSPHOT.PSF.SKY.SAVE", $path_base);
+		    
+		    # XXX: do we want to delete these?
+		    # addFilename(\@files, "TRACE.EXP", $path_base, $skycell_id);
+		    # addFilename(\@files, "PSWARP.CONFIG", $path_base, $skycell_id);
+		}
             # actual command to delete the files
-            $status = &delete_files (\@files);
+		$status = &delete_files (\@files);
+	    }
         }
 
