Index: branches/eam_branches/ipp-20120905/pstamp/scripts/psmkreq
===================================================================
--- branches/eam_branches/ipp-20120905/pstamp/scripts/psmkreq	(revision 34575)
+++ branches/eam_branches/ipp-20120905/pstamp/scripts/psmkreq	(revision 34735)
@@ -52,11 +52,4 @@
 my $comment;
 
-my $survey_name = 'null';
-my $release = 'null';
-my $stack_type = 'null';
-my $bgrestore;
-my $jpeg;
-my $nocompress;
-
 my $missing_tools;
 my $pstamp_request_file  = can_run('pstamp_request_file')  or (warn "Can't find required program pstamp_request_file"  and $missing_tools = 1);
@@ -75,6 +68,5 @@
     'width=i'           => \$width,
     'height=i'          => \$height,
-# pixcenter is deprecated
-#    'pixcenter'         => \$pixcenter,
+    'pixcenter'         => \$pixcenter,
     'arcseconds'        => \$arcseconds,
     'coord_mask=i'      => \$coord_mask,
@@ -95,14 +87,9 @@
     'comment=s'         => \$comment,
 
-    # new columns for version 2
-    'survey=s'          => \$survey_name,
-    'release=s'         => \$release,
-    'stack_type'        => \$stack_type,
-
     'option_mask=i'     => \$option_mask,
     'image'             => \$image,
     'mask'              => \$mask,
     'variance'          => \$variance,
-    'sources'           => \$cmf,
+    'cmf'               => \$cmf,
     'psf'               => \$psf,
     'backmdl'           => \$backmdl,
@@ -112,8 +99,4 @@
     'do_not_wait'       => \$no_wait,
 
-    # new options for version 2
-    'no_compress'       => \$nocompress,
-    'bgrestore'         => \$bgrestore,
-
     'verbose'           => \$verbose,
     'save-temps'        => \$save_temps,
@@ -127,7 +110,7 @@
 
 pod2usage( -msg => "Invalid job_type: $job_type", -exitval =>1 )
-        unless ($job_type eq 'stamp' or $job_type eq 'get_image' or $job_type eq 'listtargets');
-
-if (($job_type eq 'stamp') or ($job_type eq 'listtargets')) {
+        unless ($job_type eq 'stamp' or $job_type eq 'get_image');
+
+if ($job_type eq 'stamp') {
     if (defined $list) {
         pod2usage( -msg => "--ra --dec --x --y are not used with --list", -exitval =>1 )
@@ -169,7 +152,6 @@
 $id = 0 if !$id;
 
-
-unless (($job_type eq 'listtargets' and $stage eq 'exposure') or $stage eq 'raw' or $stage eq 'chip' or $stage eq 'warp' or $stage eq 'diff' or $stage eq 'stack') {
-    die "$stage is not a valid stage for $job_type jobs\n";
+unless ($stage eq 'raw' or $stage eq 'chip' or $stage eq 'warp' or $stage eq 'diff' or $stage eq 'stack') {
+    die "$stage is not a valid value for stage\n";
 }
 
@@ -225,16 +207,16 @@
 } else {
     $rows = [];
-    push @$rows, buildRow("", $comment, $x, $y, $filter, $mjd_min, $mjd_max, $survey_name, $release, $stack_type);
+    push @$rows, buildRow("", $comment, $x, $y, $filter, $mjd_min, $mjd_max);
 }
 
 my ($tdf, $table_def_name) = tempfile ("/tmp/tabledef.XXXX", UNLINK => !$save_temps);
-print $tdf "$req_name 2\n";
+print $tdf "$req_name 1\n";
 my $rownum = 0;
 foreach my $row (@$rows) {
     $rownum++;
     my $line = "$rownum $row->{ra}\t$row->{dec}\t$width $height"
-        . " $coord_mask $job_type $option_mask $project $row->{survey_name} $row->{release} $req_type"
+        . " $coord_mask $job_type $option_mask $project $req_type"
         . " $stage $id $tess_id $component $data_group"
-        . " $row->{filter} $row->{mjd_min} $row->{mjd_max} $row->{stack_type}";
+        . " $row->{filter} $row->{mjd_min} $row->{mjd_max}";
 
     if ($row->{comment} and $row->{comment} ne '') {
@@ -248,7 +230,4 @@
 }
 close $tdf;
-
-system "cat $table_def_name";
-#exit 0;
 
 {
@@ -298,9 +277,6 @@
     $row->{dec}     = checkDEC($vals[1], $linenumber);
     $row->{filter}  = checkFilter($vals[2], $filter, $linenumber);
-    $row->{mjd_min} = checkMJD($vals[3], $mjd_min, $linenumber);
-    $row->{mjd_max} = checkMJD($vals[4], $mjd_max, $linenumber);
-    $row->{survey_name}  = $vals[5];
-    $row->{release} = $vals[6];
-    $row->{stack_type} = $vals[7];
+    $row->{mjd_min} = checkMJD($vals[3], $mjd_min, $linenumber);;
+    $row->{mjd_max} = checkMJD($vals[4], $mjd_max, $linenumber);;
     $row->{comment} = $comment;
 
Index: branches/eam_branches/ipp-20120905/pstamp/scripts/pstamp_checkdependent.pl
===================================================================
--- branches/eam_branches/ipp-20120905/pstamp/scripts/pstamp_checkdependent.pl	(revision 34575)
+++ branches/eam_branches/ipp-20120905/pstamp/scripts/pstamp_checkdependent.pl	(revision 34735)
@@ -262,7 +262,9 @@
         } elsif ($chip->{state} eq 'goto_cleaned') {
 
-            if ($chip->{data_state} eq 'full') {
-                # cleanup has been queued, but has not yet finished. (cleanup pantasks is probably stopped)
-                # Since this chip is in full go ahead and set the run to state update and change the label.
+            # we don't need to check for full data_state
+            # if ($chip->{data_state} eq 'full') {
+            {
+                # cleanup must not be running. Set state to update. If this chip is not 'full' it will be
+                # set to be updated the next time this script is invoked
                 # XXX: In the very rare case that this chip run is actually in the running cleanup pantasks
                 # queue things may get confused but we can live with that
@@ -341,4 +343,10 @@
     }
 }
+
+    my $tess_id = $metadata->{tess_id};
+    if ($tess_id eq 'RINGS.V0') {
+        # we have stopped updating data from RINGS.V0
+        return $PSTAMP_GONE
+    }
     if (($state =~ /error/) or ($state =~ /purged/) or ($state =~ /scrubbed/) or ($state eq 'drop') or
          ($data_state =~ /error/) or ($data_state =~ /purged/) or ($data_state =~ /scrubbed/) or ($data_state eq 'drop')) {
@@ -365,7 +373,9 @@
     my $skycell = $metadata;
 
-    if ($skycell->{state} eq 'goto_cleaned' and $skycell->{data_state} eq 'full') {
-        # cleanup has been queued, but hasn't been done. it's "safe" to set the state back to full
-        # XXX: seem comments in check_states_chip
+    # if ($skycell->{state} eq 'goto_cleaned' and $skycell->{data_state} eq 'full') {
+    if ($skycell->{state} eq 'goto_cleaned') {
+        # cleanup has been queued, but hasn't finished, probably due to an error or cleanup is not running.
+        # It's "safe" to set the state to update. If the skycell is not full it will be set to update
+        # the next time this task runs
         my $command = "$warptool -updaterun -set_state update -warp_id $warp_id";
         $command .= " -set_label $rlabel" if $rlabel;
@@ -468,5 +478,8 @@
     my $skycell_id = $skycell->{skycell_id};
 
-    if ($metadata->{state} eq 'goto_cleaned' and $metadata->{data_state} eq 'full') {
+    # if ($metadata->{state} eq 'goto_cleaned' and $metadata->{data_state} eq 'full') {
+    if ($metadata->{state} eq 'goto_cleaned') {
+        # cleanup must not be running. Set state to update. If the skycell is not 'full' it will be
+        # set to be updated the next time this script is invoked
         print "changing state of diffRun $diff_id from goto_cleaned to update. skycell $skycell_id is full\n";
         my $command = "$difftool -updaterun -set_state update -diff_id $diff_id";
