Index: /tags/ipp-ps2-20210802/ippScripts/scripts/nightly_science.pl
===================================================================
--- /tags/ipp-ps2-20210802/ippScripts/scripts/nightly_science.pl	(revision 41995)
+++ /tags/ipp-ps2-20210802/ippScripts/scripts/nightly_science.pl	(revision 41996)
@@ -1517,6 +1517,7 @@
 	    my $this_exp_id  = ${ $this_warp }[0];
 	    my $this_quality = ${ $this_warp }[5];
-	    if ($this_quality != 0) {
-		print STDERR "diff_queue: excluding $this_exp_id for $this_object due to non-zero cam.quality $this_quality\n";
+	    my $this_state   = ${ $this_warp }[4];
+	    if (($this_quality != 0) || ($this_state eq 'drop') ) {
+		print STDERR "diff_queue: excluding $this_exp_id for $this_object due to non-zero cam.quality $this_quality or state $this_state\n";
 	    }
 	    else {
@@ -1706,6 +1707,7 @@
     	        my $this_exp_id  = ${ $this_warp }[0];
 	        my $this_quality = ${ $this_warp }[5];
-	        if ($this_quality != 0) {
-		    print STDERR "desp_diff_singles: excluding $this_exp_id for $this_object due to non-zero cam.quality $this_quality\n";
+	        my $this_state   = ${ $this_warp }[4];
+	        if (($this_quality != 0) || ($this_state eq 'drop') ) {
+		    print STDERR "desp_diff_singles: excluding $this_exp_id for $this_object due to non-zero cam.quality $this_quality or state $this_state\n";
 	        }
 	        else {
@@ -1922,6 +1924,7 @@
 	        my $this_exp_id  = ${ $this_warp }[0];
 	        my $this_quality = ${ $this_warp }[5];
-	        if ($this_quality != 0) { 
-		    print STDERR "desp_diff_queue: excluding $this_exp_id for $this_object due to non-zero cam.quality $this_quality\n";
+	        my $this_state   = ${ $this_warp }[4];
+	        if (($this_quality != 0) || ($this_state eq 'drop') ) {
+		    print STDERR "desp_diff_queue: excluding $this_exp_id for $this_object due to non-zero cam.quality $this_quality or state $this_state\n";
 	        }
 	        else {
Index: /tags/ipp-ps2-20210802/ippScripts/scripts/warp_overlap.pl
===================================================================
--- /tags/ipp-ps2-20210802/ippScripts/scripts/warp_overlap.pl	(revision 41995)
+++ /tags/ipp-ps2-20210802/ippScripts/scripts/warp_overlap.pl	(revision 41996)
@@ -150,8 +150,25 @@
 }
 
-# If no overlaps are found, we
-# keep running this step over and over (a successful warptool -addoverlap prevents
-# successive warptime -imfile from running.
-&my_die("Unable to find any overlaps", $warp_id, $PS_EXIT_PROG_ERROR) if scalar @overlaps == 0;
+# If no overlaps are found, the astrometry calibration was poor, but
+# not bad enough for the camera-stage quality to be marked as bad.
+# we set the warpRun state to 'fail' since no warpSkyCellMap can be generated.
+if (scalar @overlaps == 0) {
+    warn("no overlaps found (bad astrometry); setting warpRun state to 'drop'\n");
+
+    # Add the processed file to the database
+    unless ($no_update) {
+	my $command = "$warptool -updaterun -set_state drop"; # Command to run warptool
+	$command .= " -dbname $dbname" if defined $dbname;
+	
+	my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+	    run(command => $command, verbose => $verbose);
+	unless ($success) {
+	    $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+	    warn("Unable to perform warptool -updaterun -set_state fail: $error_code\n");
+	    exit($error_code);
+	}
+    }
+    exit(0);
+}
 
 # Generate a MDC file with the overlaps
