Index: trunk/pstamp/scripts/pstampparse.pl
===================================================================
--- trunk/pstamp/scripts/pstampparse.pl	(revision 25077)
+++ trunk/pstamp/scripts/pstampparse.pl	(revision 25110)
@@ -14,4 +14,5 @@
 use PS::IPP::PStamp::Job qw( :standard );
 use File::Temp qw(tempfile);
+use Carp;
 
 my $verbose;
@@ -96,10 +97,12 @@
 my_die("wrong EXTVER $extver found in $request_file_name", $PS_EXIT_PROG_ERROR) if ($extver ne "1");
 
-{
+# check for duplicate request name
+if (!$no_update) {
     my $command = "$pstamptool -listreq  -name $req_name";
     $command .= " -dbname $dbname" if $dbname;
     $command .= " -dbserver $dbserver" if $dbserver;
+    # no verbose so that error message about request not found doesn't appear in parse_error.txt
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
-        run(command => $command, verbose => $verbose);
+        run(command => $command, verbose => 0);
     my $exitStatus = $error_code >> 8;
     if ($success) {
@@ -183,4 +186,6 @@
 
     my $option_mask= $row->{OPTION_MASK};
+    my $inverse = ($option_mask & $PSTAMP_SELECT_INVERSE) ? 1 : 0;
+    $row->{inverse} = $inverse;
 
     my $skycenter = $row->{skycenter} = ! ($row->{COORD_MASK} & $PSTAMP_CENTER_IN_PIXELS);
@@ -247,9 +252,11 @@
         next;
     } else {
-        # Call PS::IPP::PStamp::Job's locate_images subroutine to get the parameters for this
+        # Call PS::IPP::PStamp::Job locate_images subroutine to get the images for this
         # request specification. An array reference is returned.
         my ($x, $y);
+
         $imageList = locate_images($ipprc, $image_db, $req_type, $stage, $id, $search_component,
-                $skycenter, $x, $y, $mjd_min, $mjd_max, $filter, $verbose);
+                $inverse, $skycenter, $x, $y, $mjd_min, $mjd_max, $filter, $verbose);
+
         if (!$imageList or !@$imageList) {
             print STDERR "no matching images found for row $rownum\n" if $verbose;
@@ -616,4 +623,5 @@
     return 0 if ($r1->{IMG_TYPE} ne $r2->{IMG_TYPE});
     return 0 if ($r1->{ID} ne $r2->{ID});
+    return 0 if ($r1->{inverse} ne $r2->{inverse});
 
     if (defined($r1->{COMPONENT})) {
