IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 8, 2009, 4:50:46 PM (17 years ago)
Author:
eugene
Message:

merging changes from branches/eam_branches/eam_branch_20090303 (detrend normalization resequence, cleanup error state changes; SVN_VERSION from psbuild)

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/ippScripts/scripts/ipp_cleanup.pl

    r23186 r23229  
    4545my $ipprc = PS::IPP::Config->new( $camera ) or my_die("Unable to set up", $stage_id, $PS_EXIT_CONFIG_ERROR); # this is used for PATH, NEB filename conversions
    4646
    47 # $mode must be one of "goto_cleaned", "goto_scrubbed", or "goto_purged"
    48 # goto_cleaned and goto_scrubbed both result in 'cleaned': scrubbed allows chips without config files to
    49 # be cleaned (they cannot be recovered, but the small data is left behind)
     47# $mode must be one of "goto_cleaned", "goto_scrubbed", or
     48# "goto_purged" goto_cleaned and goto_scrubbed both result in
     49# 'cleaned' on success ('scrubbed' allows chips without config files
     50# to be cleaned; they cannot be recovered, but the small data is left
     51# behind). XXX make 'scrubbed' a data_state?
    5052unless (($mode eq "goto_cleaned") || ($mode eq "goto_scrubbed") || ($mode eq "goto_purged")) {
    5153    die "invalid cleanup mode $mode\n";
    5254}
     55
     56my $error_state;
     57if ($mode eq "goto_cleaned")  { $error_state = "error_cleaned";  }
     58if ($mode eq "goto_scrubbed") { $error_state = "error_scrubbed"; }
     59if ($mode eq "goto_purged")   { $error_state = "error_purged";   }
     60
    5361
    5462my %stages = ( chip => 1, camera => 1, fake => 1, warp => 1, stack => 1, diff  => 1);
     
    148156            }
    149157        } else {
    150             # if an error happens for one chip, the chipRun will stay in goto_*, but the chips will stop be run
    151             my $command = "$chiptool -updateprocessedimfile -chip_id $stage_id -class_id $class_id -code 1";
    152             $command .= " -dbname $dbname" if defined $dbname;
     158
     159            # if an error happens for one chip, the chipRun will stay in goto_*, but the chips will go to error_* (matching the goto_*)
     160            my $command = "$chiptool -updateprocessedimfile -chip_id $stage_id -class_id $class_id -set_state $error_state";
     161            $command .= " -dbname $dbname" if defined $dbname;
    153162
    154163            my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     
    216225
    217226    if ($status)  {
    218         my $command = "$camtool -cam_id $stage_id -updaterun";
     227        my $command;
    219228        if ($mode eq "goto_cleaned") {
    220             $command .= " -state cleaned";
    221         } else {
    222             $command .= " -state purged";
     229            $command = "$camtool -updaterun -cam_id $stage_id -set_state cleaned";
     230        }
     231        if ($mode eq "goto_scrubbed") {
     232            $command = "$camtool -updaterun -cam_id $stage_id -set_state cleaned";
     233        }
     234        if ($mode eq "goto_purged") {
     235            $command = "$camtool -updaterun -cam_id $stage_id -set_state purged";
    223236        }
    224237        $command .= " -dbname $dbname" if defined $dbname;
     
    230243        }
    231244    } else {
    232         my $command = "$camtool -updateprocessedexp -cam_id $stage_id -code 1";
     245        # since 'camera' has only a single imfile, we can just update the run
     246        my $command = "$camtool -updaterun -cam_id $stage_id -set_state $error_state";
    233247        $command .= " -dbname $dbname" if defined $dbname;
    234248
     
    319333            }
    320334         } else {
    321             # XXX: -updateskyfile mode does not exist, need to add it
    322             my $command = "$warptool -updateskyfile -warp_id $stage_id -skycell_id $skycell_id -code 1";
    323             $command .= " -dbname $dbname" if defined $dbname;
     335            my $command = "$warptool -updateskyfile -warp_id $stage_id -skycell_id $skycell_id -set_state $error_state";
     336            $command .= " -dbname $dbname" if defined $dbname;
    324337
    325338            my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     
    337350# left TODO
    338351# fake : faketool : -pendingcleanupimfile (loop over imfiles)
    339 # stack: stacktool : -pendingcleanupskyfile (loop over skyfiles)
    340 # diff:  difftool : -pendingcleanupskyfile
     352# stack: stacktool : -pendingcleanupskyfile
     353# diff:  difftool : -pendingcleanupskyfile (loop over skyfiles)
    341354
    342355die "ipp_cleanup.pl -stage $stage not yet implemented\n";
     
    367380}
    368381
     382# XXX we currently do not set the error state in the db on my_die
    369383sub my_die
    370384{
Note: See TracChangeset for help on using the changeset viewer.