Index: branches/tap_branches/tools/chip_outputs.pl
===================================================================
--- branches/tap_branches/tools/chip_outputs.pl	(revision 25900)
+++ branches/tap_branches/tools/chip_outputs.pl	(revision 27838)
@@ -12,8 +12,15 @@
 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
 
+use constant MUGGLE => { 'IMAGE' => 1,
+                         'MASK' => 1,
+                         'VARIANCE' => 1,
+};
+
 use constant EXTENSIONS => { 'IMAGE' => '.ch.fits', # Image
                              'MASK' => '.ch.mk.fits', # Mask
                              'VARIANCE' => '.ch.wt.fits', # Variance
                              'SOURCES' => '.cmf', # Sources
+                             'PSF' => '.psf',     # Point-spread function
+                             'LOG' => '.log',     # Processing log
                          };
 
@@ -22,4 +29,5 @@
 my ($input);                    # Input list
 my ($products);                 # Products of interest
+my ($muggle);                   # Retrieve un-magicked data?
 
 GetOptions(
@@ -31,4 +39,5 @@
            'class_id=s' => \$class_id, # Class identifier
            'products=s' => \$products, # Products of interest
+           'muggle' => \$muggle, # Retrieve un-magicked data?
            ) or die "Unable to parse arguments.\n";
 die "Unknown option: @ARGV\n" if @ARGV;
@@ -58,5 +67,5 @@
 my @products;                   # Array of products
 if (defined $products) {
-    @products = split /,/, $products;
+    @products = split(/,/, $products);
 } else {
     @products = keys %{EXTENSIONS()};
@@ -69,5 +78,12 @@
     my $name = "$path.$class_id"; # Full name
     foreach my $product ( @products ) {
-        copy_extension( $name, ${EXTENSIONS()}{$product} );
+        my $base = $name;
+        if ($muggle and defined ${MUGGLE()}{$product}) {
+            my @file = split /\//, $base;
+            my $last = pop @file;
+            push @file, "SR_$last";
+            $base = join '/', @file;
+        }
+        copy_extension( $base, ${EXTENSIONS()}{$product} );
     }
 }
@@ -83,7 +99,7 @@
     my $neb = "$path$ext"; # Nebulous file
     my $source = `neb-locate --path $neb`;
-    if (!$source) { 
-	print "Unable to locate $neb\n"; # Actual file
-	return;
+    if (!$source) {
+        print "Unable to locate $neb\n"; # Actual file
+        return;
     }
     chomp $source;
@@ -91,6 +107,6 @@
     my $status = system "cp $source $target";
     if ($status) {
-	print "Unable to copy $source\n";
-	return;
+        print "Unable to copy $source\n";
+        return;
     }
 }
