Index: /trunk/tools/diff_outputs.pl
===================================================================
--- /trunk/tools/diff_outputs.pl	(revision 24074)
+++ /trunk/tools/diff_outputs.pl	(revision 24075)
@@ -12,4 +12,19 @@
 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
 
+# List of products
+use constant PRODUCTS => { 'REGULAR' => [ 'IMAGE', 'MASK', 'VARIANCE',
+                                          'SOURCES', 'JPEG1', 'JPEG2',
+                                          'KERNEL' ],
+                           'ALL' => [ 'IMAGE', 'MASK', 'VARIANCE',
+                                      'SOURCES', 'JPEG1', 'JPEG2',
+                                      'KERNEL', 'INVERSE.IMAGE',
+                                      'INVERSE.MASK', 'INVERSE.VARIANCE',
+                                      'INVERSE.SOURCES' ],
+                           'INVERSE' => [ 'INVERSE.IMAGE', 'INVERSE.MASK',
+                                          'INVERSE.VARIANCE',
+                                          'INVERSE.SOURCES' ],
+                       };
+
+# Extensions to add to path_base
 use constant EXTENSIONS => { 'IMAGE' => '.fits', # Image
                              'MASK' => '.mask.fits', # Mask
@@ -19,4 +34,8 @@
                              'JPEG2' => '.b2.jpg', # Binned JPEG
                              'KERNEL' => '.subkernel', # Convolution kernel
+                             'INVERSE.IMAGE' => '.inv.fits', # Image
+                             'INVERSE.MASK' => '.inv.mask.fits', # Mask
+                             'INVERSE.VARIANCE' => '.inv.wt.fits', # Variance
+                             'INVERSE.SOURCES' => '.inv.cmf', # Sources
                          };
 
@@ -25,4 +44,5 @@
 my ($input);                    # Input list
 my ($products);                 # Products of interest
+my ($inverse);                  # Get inverse products too?
 
 GetOptions(
@@ -34,4 +54,5 @@
            'skycell_id=s' => \$skycell_id, # Skycell identifier
            'products=s' => \$products, # Products of interest
+           'inverse' => \$inverse, # Get inverse products?
            ) or die "Unable to parse arguments.\n";
 die "Unknown option: @ARGV\n" if @ARGV;
@@ -50,4 +71,5 @@
                        ) or die "Unable to connect to database: $DBI::errstr";
 
+
 # Query to run
 my $sql = "SELECT path_base FROM diffSkyfile WHERE diff_id = $diff_id";
@@ -61,11 +83,20 @@
 my @products;                   # Array of products
 if (defined $products) {
-    @products = split /,/, $products;
+  PRODUCT_SEARCH: foreach my $product ( split /,/, $products ) {
+      foreach my $key ( keys %${EXTENSIONS()} ) {
+          if ($product eq $key) {
+              push @products, ${PRODUCTS()}->{$key};
+              next PRODUCT_SEARCH;
+          }
+      }
+      push @products, $product;
+  }
 } else {
-    @products = keys %{EXTENSIONS()};
+    @products = @{${PRODUCTS()}{'REGULAR'}};
 }
 
 foreach my $diff ( @$diffs ) {
     foreach my $product ( @products ) {
+        print "$product ==> ";
         copy_extension( $diff, ${EXTENSIONS()}{$product} );
     }
