Index: /trunk/tools/stack_inputs.pl
===================================================================
--- /trunk/tools/stack_inputs.pl	(revision 20433)
+++ /trunk/tools/stack_inputs.pl	(revision 20434)
@@ -12,10 +12,10 @@
 
 # Extensions of the path_base to grab
-use constant EXTENSIONS => [ '.fits', # Image
-                             '.mask.fits', # Mask
-                             '.wt.fits', # Weight
-                             '.cmf', # Sources
-                             '.psf', # PSF
-                             ];
+use constant EXTENSIONS => { 'IMAGE' => '.fits', # Image
+                             'MASK' => '.mask.fits', # Mask
+                             'WEIGHT' => '.wt.fits', # Weight
+                             'SOURCES' => '.cmf', # Sources
+                             'PSF' => '.psf', # PSF
+                         };
 
 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
@@ -23,4 +23,5 @@
 my ($db_host, $db_name, $db_user, $db_pw); # Database details
 my ($stack_id);                 # Stack of interest
+my ($input);                    # Input list
 
 GetOptions(
@@ -30,4 +31,5 @@
            'dbpass=s' => \$db_pw, # Database p/w
            'stack_id=s' => \$stack_id, # Stack identifier
+           'input=s'  => \$input, # Input list to generate
            ) or die "Unable to parse arguments.\n";
 die "Unknown option: @ARGV\n" if @ARGV;
@@ -59,6 +61,14 @@
 $db->disconnect;
 
+my $list;                       # List of inputs
+if (defined $input) {
+    open $list, "> $input";
+    print $list "INPUT MULTI\n\n";
+}
+
 foreach my $warp_path ( @$warps ) {
-    foreach my $ext ( @{EXTENSIONS()} ) {
+    print $list "INPUT METADATA\n" if defined $input;
+    foreach my $type ( keys @{EXTENSIONS()} ) {
+        my $ext = ${EXTENSIONS()}{$type}; # Extension
         my $neb = "$warp_path$ext"; # Nebulous file
         my $source = `neb-locate --path $neb` or die "Unable to locate $neb\n"; # Actual file
@@ -66,4 +76,7 @@
         my ($target) = $source =~ m|^.*:(.*)|; # Target name
         !system "cp $source $target" or die "Unable to copy $source\n";
+        print $list "\t$type\tSTR\t$target\n" if defined $input;
     }
+    print $list "END\n\n" if defined $input;
 }
+
