Index: /trunk/tools/gpc1_find_images.pl
===================================================================
--- /trunk/tools/gpc1_find_images.pl	(revision 26708)
+++ /trunk/tools/gpc1_find_images.pl	(revision 26709)
@@ -194,19 +194,20 @@
 
     %mapping = ();
-    if ((exists($opt{C})&&(exists($opt{S})))||
-	(exists($opt{W})&&(exists($opt{O})))||
-	exists($opt{I})) {
-
-	$sth_mapping = "SELECT skycell_id,class_id from warpSkyCellMap WHERE warp_id = $warp_id";
-	$mr = $db->selectall_arrayref( $sth_mapping );
-	foreach $mrr (@{ $mr }) {
-	    my ($skycell,$class) = @{ $mrr };
-	    my $raw_class = $class;
-	    $raw_class =~ s/xy/ota/i;
-	    push @{ $mapping{$skycell} }, $class;
-	    push @{ $mapping{$skycell} }, $raw_class;
-	    push @{ $mapping{$class} }, $skycell;
-	    push @{ $mapping{$raw_class} }, $skycell;
+    unless (exists($opt{Y})) {
+	if ((exists($opt{C})&&(exists($opt{S})))||
+	    (exists($opt{W})&&(exists($opt{O})))||
+	    exists($opt{I})) {
+	    $sth_mapping = "SELECT skycell_id,class_id from warpSkyCellMap WHERE warp_id = $warp_id";
+	    $mr = $db->selectall_arrayref( $sth_mapping );
+	    foreach $mrr (@{ $mr }) {
+		my ($skycell,$class) = @{ $mrr };
+		my $raw_class = $class;
+		$raw_class =~ s/xy/ota/i;
+		push @{ $mapping{$skycell} }, $class;
+		push @{ $mapping{$skycell} }, $raw_class;
+		push @{ $mapping{$class} }, $skycell;
+		push @{ $mapping{$raw_class} }, $skycell;
 #	    print STDERR "$raw_class $class $skycell\n";
+	    }
 	}
     }
@@ -444,4 +445,14 @@
 	    return(1);
 	}
+	elsif ($opt{M} && ($key =~ /mk.fits/)) {
+	    if (($opt{O} ne '')&&($key !~ /$opt{O}/)) {
+		return(0); # Not the requested OTA
+	    }
+	    if (($opt{S} ne '')&& !(is_mapped($key,$opt{S}))) {
+		return(0); # Not the remapped skycell requested
+	    }
+	    return(1);
+	}	    
+
     }
     return(0);
