Index: trunk/tools/chip_outputs.pl
===================================================================
--- trunk/tools/chip_outputs.pl	(revision 27689)
+++ trunk/tools/chip_outputs.pl	(revision 27690)
@@ -12,4 +12,9 @@
 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
@@ -24,4 +29,5 @@
 my ($input);                    # Input list
 my ($products);                 # Products of interest
+my ($muggle);                   # Retrieve un-magicked data?
 
 GetOptions(
@@ -33,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;
@@ -60,5 +67,5 @@
 my @products;                   # Array of products
 if (defined $products) {
-    @products = split /,/, $products;
+    @products = split(/,/, $products);
 } else {
     @products = keys %{EXTENSIONS()};
@@ -71,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} );
     }
 }
