Index: trunk/tools/warp_outputs.pl
===================================================================
--- trunk/tools/warp_outputs.pl	(revision 20657)
+++ trunk/tools/warp_outputs.pl	(revision 20721)
@@ -22,4 +22,5 @@
 my ($skycell_id);               # Skycell of interest
 my ($input);                    # Input list
+my ($products);                 # Products of interest
 
 GetOptions(
@@ -30,4 +31,5 @@
            'warp_id=s' => \$warp_id, # Warp identifier
            'skycell_id=s' => \$skycell_id, # Skycell identifier
+           'products=s' => \$products, # Products of interest
            ) or die "Unable to parse arguments.\n";
 die "Unknown option: @ARGV\n" if @ARGV;
@@ -47,5 +49,5 @@
 
 # Query to run
-my $sql = "SELECT path_base FROM warpSkyfile WHERE warp_id = $warp_id";
+my $sql = "SELECT path_base FROM warpSkyfile WHERE warp_id = $warp_id AND ignored = 0";
 $sql .= " AND skycell_id = $skycell_id" if defined $skycell_id;
 
@@ -55,6 +57,15 @@
                                      ) or die "Unable to execute SQL: $DBI::errstr";
 
+my @products;                   # Array of products
+if (defined $products) {
+    @products = split /,/, $products;
+} else {
+    @products = keys %{EXTENSIONS()};
+}
+
 foreach my $warp ( @$warps ) {
-    copy_extensions( $warp, EXTENSIONS() );
+    foreach my $product ( @products ) {
+        copy_extension( $warp, ${EXTENSIONS()}{$product} );
+    }
 }
 
@@ -62,16 +73,13 @@
 
 
-sub copy_extensions
+sub copy_extension
 {
     my $path = shift;           # Path to copy
-    my $extensions = shift;     # Extensions structure
+    my $ext = shift;            # Extension to copy
 
-    foreach my $type ( keys %$extensions ) {
-        my $ext = $$extensions{$type}; # Extension
-        my $file = "$path$ext"; # File
-        my $source = `ipp_datapath.pl $file` or die "Unable to locate $file\n"; # Actual file
-        chomp $source;
-        my ($target) = $source =~ m|^.*[:/](.*)|; # Target name
-        !system "cp $source $target" or die "Unable to copy $source\n";
-    }
+    my $file = "$path$ext"; # File
+    my $source = `ipp_datapath.pl $file` or die "Unable to locate $file\n"; # Actual file
+    chomp $source;
+    my ($target) = $source =~ m|^.*[:/](.*)|; # Target name
+    !system "cp $source $target" or die "Unable to copy $source\n";
 }
