IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25801


Ignore:
Timestamp:
Oct 7, 2009, 4:26:32 PM (17 years ago)
Author:
watersc1
Message:
  • Update to cleanup script to work with real data.
  • Change of FRINGE type in detrend processing to use uncompressed images.
Location:
trunk/ippScripts/scripts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/detrend_process_imfile.pl

    r24764 r25801  
    9494                  'DOMEFLAT'         => 'PPIMAGE.OUTPUT.DETREND',
    9595                  'SKYFLAT'          => 'PPIMAGE.OUTPUT.DETREND',
    96                   'FRINGE'           => undef,
     96                  'FRINGE'           => 'PPIMAGE.OUTPUT.DETREND',
    9797              };
    9898
  • trunk/ippScripts/scripts/ipp_cleanup.pl

    r25781 r25801  
    187187                &my_die("Unable to perform chiptool: $error_code", "chip", $stage_id, $error_code);
    188188            }
     189
     190            # Tell magicdstool that we've cleaned up this data, so it needs to do the same if it needs to do the same.
     191            my $magicdstool = can_run('magicdstool') or die "Can't find magicdstool";
     192            $command = "$magicdstool -dbname gpc1  -stage $stage -stage_id $stage_id -updaterun -set_state goto_purged";
     193            ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     194                run(command => $command, verbose => $verbose);
     195            unless ($success) {
     196                $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     197                &my_die("Unable to perform magicdstool: $error_code", "$stage", $stage_id, $error_code);
     198            }
     199
    189200        } else {
    190201
     
    209220                $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    210221                &my_die("Unable to perform chiptool: $error_code", "chip", $stage_id, $error_code);
    211 
    212             }
     222            }
     223
    213224        }
    214225    }
     
    295306            &my_die("Unable to perform camtool: $error_code", "camera", $stage_id, $error_code);
    296307        }
     308
     309        # Tell magicdstool that we've cleaned up this data, so it needs to do the same if it needs to do the same.
     310        my $magicdstool = can_run('magicdstool') or die "Can't find magicdstool";
     311        $command = "$magicdstool -dbname gpc1 -stage $stage -stage_id $stage_id -updaterun -set_state goto_purged";
     312        ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     313            run(command => $command, verbose => $verbose);
     314        unless ($success) {
     315            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     316            &my_die("Unable to perform magicdstool: $error_code", "$stage", $stage_id, $error_code);
     317        }
     318
    297319    } else {
    298320        # since 'camera' has only a single imfile, we can just update the run
     
    308330        exit $PS_EXIT_UNKNOWN_ERROR;
    309331    }
     332
     333
    310334    exit 0;
    311335}
     
    418442            }
    419443
     444            # Tell magicdstool that we've cleaned up this data, so it needs to do the same if it needs to do the same.
     445            my $magicdstool = can_run('magicdstool') or die "Can't find magicdstool";
     446            $command = "$magicdstool -dbname gpc1 -stage $stage -stage_id $stage_id -updaterun -set_state goto_purged";
     447            ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     448                run(command => $command, verbose => $verbose);
     449            unless ($success) {
     450                $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     451                &my_die("Unable to perform magicdstool: $error_code", "$stage", $stage_id, $error_code);
     452            }
    420453
    421454         } else {
     
    438471### added for cleanup, based on warp stage entry
    439472if ($stage eq 'stack') {
    440    
    441473    die "--stage_id required for stage stack\n" if !$stage_id;
    442 
    443474    # this stage uses 'stacktool'
    444475    my $stacktool = can_run('stacktool') or die "Can't find stacktool";
     
    457488        # No skycells were found for some reason.
    458489        # Not technically an "error," but a "you told me to do X, and I can't. Please fix this yourself."
    459         my $command = "$stacktool -updaterun -stack_id $stage_id -set_state $error_state";
     490        my $command = "$stacktool -updaterun -stack_id $stage_id -state $error_state";
    460491        $command .= " -dbname $dbname" if defined $dbname;
    461492       
     
    464495        unless ($success) {
    465496            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    466             &my_die("Unable to perform warptool: $error_code", "warp", $stage_id, $error_code);
     497            &my_die("Unable to perform stacktool: $error_code", "stack", $stage_id, $error_code);
    467498        }
    468499       
     
    482513
    483514        my $status = 1;
    484         if ($mode eq "goto_cleaned") {
    485             my $config_file = $ipprc->filename("PPSTACK.CONFIG", $path_base, $skycell_id);
    486 
    487             unless ($ipprc->file_exists($config_file)) {
    488                 print STDERR "skipping cleanup for stackRun $stage_id $skycell_id" .
    489                     " because config file is missing\n";
    490                 $status = 0;
    491             }
    492         }
    493         elsif ($mode eq "goto_scrubbed") {
    494             my $config_file = $ipprc->filename("PPSTACK.CONFIG", $path_base, $skycell_id);
    495 
    496             if ($ipprc->file_exists($config_file)) {
    497                 print STDERR "skipping scrubbed for stackRun $stage_id $skycell_id" .
    498                     " because config file is present\n";
    499                 $status = 0;
    500             }
    501         }
     515        if ((!exists($skyfile->{path_base}))||
     516            (!defined($path_base))) {
     517            $status = 0;
     518        }
     519        if ($status) {
     520            if ($mode eq "goto_cleaned") {
     521                my $config_file = $ipprc->filename("PPSTACK.CONFIG", $path_base, $skycell_id);
     522               
     523                unless ($ipprc->file_exists($config_file)) {
     524                    print STDERR "skipping cleanup for stackRun $stage_id $skycell_id" .
     525                        " because config file is missing\n";
     526                    $status = 0;
     527                }
     528            }
     529            elsif ($mode eq "goto_scrubbed") {
     530                my $config_file = $ipprc->filename("PPSTACK.CONFIG", $path_base, $skycell_id);
     531               
     532                if ($ipprc->file_exists($config_file)) {
     533                    print STDERR "skipping scrubbed for stackRun $stage_id $skycell_id" .
     534                        " because config file is present\n";
     535                    $status = 0;
     536                }
     537            }
     538        }
     539
    502540        if ($status) {
    503541            my @files = ();
     
    539577                &my_die("Unable to perform stacktool: $error_code", "stack", $stage_id, $error_code);
    540578            }
     579
     580            # Tell magicdstool that we've cleaned up this data, so it needs to do the same if it needs to do the same.
     581            my $magicdstool = can_run('magicdstool') or die "Can't find magicdstool";
     582            $command = "$magicdstool -dbname gpc1  -stage $stage -stage_id $stage_id -updaterun -set_state goto_purged";
     583            ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     584                run(command => $command, verbose => $verbose);
     585            unless ($success) {
     586                $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     587                &my_die("Unable to perform magicdstool: $error_code", "$stage", $stage_id, $error_code);
     588            }
     589
    541590        } else {
    542591            my $command = "$stacktool -updaterun  -stack_id $stage_id -state $error_state";
     
    549598                &my_die("Unable to perform stacktool: $error_code", "stack", $stage_id, $error_code);
    550599            }
    551             exit $PS_EXIT_UNKNOWN_ERROR;
     600#           exit $PS_EXIT_UNKNOWN_ERROR;
    552601        }
    553602    }
     
    575624        # No skycells were found for some reason.
    576625        # Not technically an "error," but a "you told me to do X, and I can't. Please fix this yourself."
    577         my $command = "$difftool -updaterun -diff_id $stage_id -set_state $error_state";
     626        my $command = "$difftool -updaterun -diff_id $stage_id -state $error_state";
    578627        $command .= " -dbname $dbname" if defined $dbname;
    579628       
     
    582631        unless ($success) {
    583632            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    584             &my_die("Unable to perform warptool: $error_code", "warp", $stage_id, $error_code);
     633            &my_die("Unable to perform difftool: $error_code", "diff", $stage_id, $error_code);
    585634        }
    586635       
     
    600649
    601650        my $status = 1;
    602         if ($mode eq "goto_cleaned") {
    603             my $config_file = $ipprc->filename("PPSUB.CONFIG", $path_base, $skycell_id);
    604 
    605             unless ($ipprc->file_exists($config_file)) {
    606                 print STDERR "skipping cleanup for diffRun $stage_id $skycell_id" .
    607                     " because config file ($config_file) is missing\n";
    608                 $status = 0;
    609             }
    610         }
    611         elsif ($mode eq "goto_scrubbed") {
    612             my $config_file = $ipprc->filename("PPSUB.CONFIG", $path_base, $skycell_id);
    613 
    614             if ($ipprc->file_exists($config_file)) {
    615                 print STDERR "skipping scrubbed for diffRun $stage_id $skycell_id" .
    616                     " because config file ($config_file) is present\n";
    617                 $status = 0;
     651        if ((!exists($skyfile->{path_base}))||
     652            (!defined($path_base))) {
     653            $status = 0;
     654        }
     655        if ($status) {
     656           
     657            if ($mode eq "goto_cleaned") {
     658                my $config_file = $ipprc->filename("PPSUB.CONFIG", $path_base, $skycell_id);
     659               
     660                unless ($ipprc->file_exists($config_file)) {
     661                    print STDERR "skipping cleanup for diffRun $stage_id $skycell_id" .
     662                        " because config file ($config_file) is missing\n";
     663                    $status = 0;
     664                }
     665            }
     666            elsif ($mode eq "goto_scrubbed") {
     667                my $config_file = $ipprc->filename("PPSUB.CONFIG", $path_base, $skycell_id);
     668               
     669                if ($ipprc->file_exists($config_file)) {
     670                    print STDERR "skipping scrubbed for diffRun $stage_id $skycell_id" .
     671                        " because config file ($config_file) is present\n";
     672                    $status = 0;
     673                }
    618674            }
    619675        }
     
    653709#       print STDERR "MY STATUS: $status\n";
    654710        if ($status) {
    655             my $command = "$difftool -diff_id $stage_id";
    656 
    657             if ($mode eq "goto_purged") {
    658                 $command .= " -updaterun -state purged";
     711            my $command = "$difftool -diff_id $stage_id -skycell_id $skycell_id";
     712
     713            if ($mode eq "goto_purged") {
     714                $command .= " -topurgedskyfile";
    659715            }
    660716            elsif ($mode eq "goto_cleaned") {
    661                 $command .= " -updaterun -state cleaned";
     717                $command .= " -tocleanedskyfile";
    662718            }
    663719            elsif ($mode eq "goto_scrubbed") {
    664                 $command .= " -updaterun -state scrubbed";
     720                $command .= " -toscrubbedskyfile";
    665721            }
    666722
     
    673729                &my_die("Unable to perform difftool: $error_code", "diff", $stage_id, $error_code);
    674730            }
     731
     732            # Tell magicdstool that we've cleaned up this data, so it needs to do the same if it needs to do the same.
     733            my $magicdstool = can_run('magicdstool') or die "Can't find magicdstool";
     734            $command = "$magicdstool -dbname gpc1 -stage $stage -stage_id $stage_id -updaterun -set_state goto_purged";
     735            ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     736                run(command => $command, verbose => $verbose);
     737            unless ($success) {
     738                $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     739                &my_die("Unable to perform magicdstool: $error_code", "$stage", $stage_id, $error_code);
     740            }
     741
    675742        } else {
    676743            my $command = "$difftool -updaterun -diff_id $stage_id -state $error_state";
     
    684751                &my_die("Unable to perform difftool: $error_code", "diff", $stage_id, $error_code);
    685752            }
    686             exit $PS_EXIT_UNKNOWN_ERROR;
     753#           exit $PS_EXIT_UNKNOWN_ERROR;
    687754        }
    688755    }
Note: See TracChangeset for help on using the changeset viewer.