Index: trunk/tools/gpc1_find_images.pl
===================================================================
--- trunk/tools/gpc1_find_images.pl	(revision 26528)
+++ trunk/tools/gpc1_find_images.pl	(revision 26548)
@@ -3,5 +3,5 @@
 use DBI;
 use Getopt::Std;
-getopts('hFARCPp:BLMDWIYvx:n:c:w:s:O:S:N:',\%opt);
+getopts('hFARCPp:BLMDWIYTvx:n:c:w:s:O:S:N:',\%opt);
 #getopt('xncwOS:hARCW',\%opt);
 unless (exists($opt{O})) {
@@ -46,4 +46,6 @@
     print "          -M              Include masks in results.\n";
     print "          -D              Return only pre-destreaked images.\n";
+    print "          -Y              Yes, I want the raw, even if it's not been processed.\n";
+    print "          -T              Get the sTacks for a given input.\n";
     print "          -v              Be verbose on output.\n";
     print " \n";
@@ -94,10 +96,15 @@
     push @sth_adds, "warpRun.warp_id = $opt{w}";
 }
-if (exists($opt{s})) {
-    if ($opt{s} != 0) {
+if (exists($opt{s})||exists($opt{T})) {
+#    print "$opt{s}!\n";
+    if (exists($opt{s})&&($opt{s} != 0)) {
 	push @sth_adds, "stackRun.stack_id = $opt{s}";
     }
-    $sth_base =~ s/0,"nostack"/stack_id,stackSumSkyfile.uri/;
+    $sth_base =~ s/0,'nostack'/stack_id,stackSumSkyfile.uri/;
+    if (exists($opt{T})) {
+	$sth_base .= ' RIGHT OUTER ';
+    }
     $sth_base .= ' JOIN stackInputSkyfile USING (warp_id) JOIN stackSumSkyfile USING (stack_id) JOIN stackRun USING (stack_id)';
+#    print "$sth_base\n";
 }
 if ($#sth_adds != -1) {
@@ -121,5 +128,5 @@
 	$stack_sumfile_uri = '';
     }
-#    print (join "\t", @{ $rr }) . "\n";
+#    print (join "\t", @{ $rr }) . "\n" . "\n";
 #    $exp_pontime = 0; # To stop warnings, but I want this around.
     if (exists($opt{I})) {
@@ -234,7 +241,9 @@
 	}
     }
-    if (exists($opt{s})) {
-	push @scan, $stack_sumfile_uri;
-	$found++;
+    if (exists($opt{s})||exists($opt{T})) {
+	if (defined($stack_sumfile_uri)) {
+	    push @scan, $stack_sumfile_uri;
+	    $found++;
+	}
     }
 
