IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 18, 2009, 10:29:30 AM (17 years ago)
Author:
watersc1
Message:

Modified chip_imfile.pl to accept burntool tables and apply corrections on-the-fly. Fixed bugs in ipp_cleanup.pl. Incremented BURNTOOL.STATE.GOOD to match updated upstream code.

File:
1 edited

Legend:

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

    r25324 r25442  
    123123            my $config_file = $ipprc->filename("PPIMAGE.CONFIG", $path_base, $class_id);
    124124
    125             if (!$config_file or ! -e $config_file) {
     125#            if (!$config_file or ! -e $config_file) {
     126            unless ($ipprc->file_exists($config_file)) {
    126127                print STDERR "skipping cleanup for chipRun $stage_id $class_id "
    127                     . " because config file is missing\n";
     128                    . " because config file ($config_file) is missing\n";
    128129                $status = 0;
    129130            }
     
    132133            my $config_file = $ipprc->filename("PPIMAGE.CONFIG", $path_base, $class_id);
    133134
    134             if ($config_file and -e $config_file) {
     135            if ($ipprc->file_exists($config_file)) {
    135136                print STDERR "skipping scrubbed for chipRun $stage_id $class_id "
    136                     . " because config file is present\n";
     137                    . " because config file ($config_file) is present\n";
    137138                $status = 0;
    138139            }
     
    144145
    145146            # delete the temporary image datafiles
    146             addFilename (\@files, "PPIMAGE.OUTPUT", $path_base, $class_id);
    147             addFilename (\@files, "PPIMAGE.OUTPUT.MASK", $path_base, $class_id);
    148             addFilename (\@files, "PPIMAGE.OUTPUT.VARIANCE", $path_base, $class_id);
     147#            addFilename (\@files, "PPIMAGE.OUTPUT", $path_base, $class_id);
     148#            addFilename (\@files, "PPIMAGE.OUTPUT.MASK", $path_base, $class_id);
     149#            addFilename (\@files, "PPIMAGE.OUTPUT.VARIANCE", $path_base, $class_id);
    149150            addFilename (\@files, "PPIMAGE.CHIP", $path_base, $class_id);
    150151            addFilename (\@files, "PPIMAGE.CHIP.MASK", $path_base, $class_id);
     
    236237    if ($mode eq "goto_cleaned") {
    237238        my $config_file = $ipprc->filename("PSASTRO.CONFIG", $path_base);
    238 
    239         if (!$config_file or ! -e $config_file) {
     239       
     240        unless ($ipprc->file_exists($config_file)) {
    240241            print STDERR "skipping cleanup for camRun $stage_id because config file is missing\n";
    241242            $status = 0;
     
    245246        my $config_file = $ipprc->filename("PSASTRO.CONFIG", $path_base);
    246247
    247         if ($config_file and -e $config_file) {
     248        if ($ipprc->file_exists($config_file)) {
    248249            print STDERR "skipping cleanup for camRun $stage_id because config file ($config_file) is present\n";
    249250            $status = 0;
     
    329330            my $config_file = $ipprc->filename("PSWARP.CONFIG", $path_base, $skycell_id);
    330331
    331             if (!$config_file or ! -e $config_file) {
     332            unless ($ipprc->file_exists($config_file)) {
    332333                print STDERR "skipping cleanup for warpRun $stage_id $skycell_id" .
    333334                    " because config file is missing\n";
     
    338339            my $config_file = $ipprc->filename("PSWARP.CONFIG", $path_base, $skycell_id);
    339340
    340             if ($config_file and -e $config_file) {
     341            if ($ipprc->file_exists($config_file)) {
    341342                print STDERR "skipping scrubbed for warpRun $stage_id $skycell_id" .
    342343                    " because config file is present\n";
     
    345346        }
    346347        if ($status) {
     348            my @files = ();
    347349            # delete the temporary image datafiles
    348350            addFilename(\@files, "PSWARP.OUTPUT", $path_base, $skycell_id );
     
    433435            my $config_file = $ipprc->filename("PPSTACK.CONFIG", $path_base, $skycell_id);
    434436
    435             $config_file =~ s%^file://%%;
    436             if (!$config_file or ! -e $config_file) {
     437            unless ($ipprc->file_exists($config_file)) {
    437438                print STDERR "skipping cleanup for stackRun $stage_id $skycell_id" .
    438439                    " because config file is missing\n";
    439440                $status = 0;
    440441            }
    441             $config_file = 'file://' . $config_file;
    442442        }
    443443        elsif ($mode eq "goto_scrubbed") {
    444444            my $config_file = $ipprc->filename("PPSTACK.CONFIG", $path_base, $skycell_id);
    445             $config_file =~ s%^file://%%;
    446             if ($config_file and -e $config_file) {
     445
     446            if ($ipprc->file_exists($config_file)) {
    447447                print STDERR "skipping scrubbed for stackRun $stage_id $skycell_id" .
    448448                    " because config file is present\n";
     
    451451        }
    452452        if ($status) {
     453            my @files = ();
    453454            # delete the temporary image datafiles
    454455            addFilename(\@files, "PPSTACK.OUTPUT", $path_base, $skycell_id);
     
    535536            my $config_file = $ipprc->filename("PPSUB.CONFIG", $path_base, $skycell_id);
    536537
    537             $config_file =~ s%^file://%%;
    538             if (!$config_file or ! -e $config_file) {
     538            unless ($ipprc->file_exists($config_file)) {
    539539                print STDERR "skipping cleanup for diffRun $stage_id $skycell_id" .
    540540                    " because config file ($config_file) is missing\n";
    541541                $status = 0;
    542542            }
    543             $config_file = 'file://' . $config_file;
    544543        }
    545544        elsif ($mode eq "goto_scrubbed") {
    546545            my $config_file = $ipprc->filename("PPSUB.CONFIG", $path_base, $skycell_id);
    547             $config_file =~ s%^file://%%;
    548             if ($config_file and -e $config_file) {
     546
     547            if ($ipprc->file_exists($config_file)) {
    549548                print STDERR "skipping scrubbed for diffRun $stage_id $skycell_id" .
    550549                    " because config file ($config_file) is present\n";
     
    553552        }
    554553        if ($status) {
     554            my @files = ();
    555555            # delete the temporary image datafiles
    556556            addFilename(\@files, "PPSUB.OUTPUT", $path_base, $skycell_id);
     
    581581               
    582582            }
    583             print STDERR "MY FILES: @files\n";
     583#           print STDERR "MY FILES: @files\n";
    584584            $status = &delete_files(\@files);
    585585        }
    586         print STDERR "MY STATUS: $status\n";
     586#       print STDERR "MY STATUS: $status\n";
    587587        if ($status) {
    588588            my $command = "$difftool -diff_id $stage_id";
     
    675675            my $config_file = $ipprc->filename("PPSIM.CONFIG", $path_base, $class_id);
    676676
    677             if (!$config_file or ! -e $config_file) {
     677            unless ($ipprc->file_exists($config_file)) {
    678678                print STDERR "skipping cleanup for fakeRun $stage_id $class_id "
    679679                    . " because config file is missing\n";
     
    684684            my $config_file = $ipprc->filename("PPSIM.CONFIG", $path_base, $class_id);
    685685
    686             if ($config_file and -e $config_file) {
     686            if ($ipprc->file_exists($config_file)) {
    687687                print STDERR "skipping scrubbed for fakeRun $stage_id $class_id "
    688688                    . " because config file is present\n";
     
    795795            my $config_file = $ipprc->filename("PPIMAGE.CONFIG", $path_base, $class_id);
    796796
    797             if (!$config_file or ! -e $config_file) {
     797            unless ($ipprc->file_exists($config_file)) {
    798798                print STDERR "skipping cleanup for detrend.process.imfile $stage_id $class_id "
    799799                    . " because config file is missing\n";
     
    804804            my $config_file = $ipprc->filename("PPIMAGE.CONFIG", $path_base, $class_id);
    805805
    806             if ($config_file and -e $config_file) {
     806            if ($ipprc->file_exists($config_file)) {
    807807                print STDERR "skipping scrubbed for detrend.process.imfile $stage_id $class_id "
    808808                    . " because config file is present\n";
     
    942942            my $config_file = $ipprc->filename("PSIMAGE.CONFIG", $path_base);
    943943           
    944             if (!$config_file or ! -e $config_file) {
     944            unless ($ipprc->file_exists($config_file)) {
    945945                print STDERR "skipping cleanup for $stage $stage_id because config file is missing\n";
    946946                $status = 0;
     
    950950            my $config_file = $ipprc->filename("PSIMAGE.CONFIG", $path_base);
    951951           
    952             if ($config_file and -e $config_file) {
     952            if ($ipprc->file_exists($config_file)) {
    953953                print STDERR "skipping cleanup for $stage $stage_id because config file ($config_file) is present\n";
    954954                $status = 0;
     
    10941094
    10951095        if ($status) {
     1096            my @files = ();
    10961097            # delete the temporary image datafiles
    10971098            # There's no convenient way to get the detrend type, so I'm queueing all of them for deletion.
     
    12271228                run(command => $command, verbose => $verbose);
    12281229            unless ($success) {
    1229                 print STDERR "WTF: $success TTT $error_code QQQ\n";
    12301230                $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    12311231                &my_die("Unable to perform dettool: $error_code", "$stage", $stage_id, $error_code);
     
    13161316            my $config_file = $ipprc->filename("PPIMAGE.CONFIG", $path_base);
    13171317           
    1318             if (!$config_file or ! -e $config_file) {
     1318            unless ($ipprc->file_exists($config_file)) {
    13191319                print STDERR "skipping cleanup for $stage $stage_id because config file is missing\n";
    13201320                $status = 0;
     
    13241324            my $config_file = $ipprc->filename("PPIMAGE.CONFIG", $path_base);
    13251325           
    1326             if ($config_file and -e $config_file) {
     1326            if ($ipprc->file_exists($config_file)) {
    13271327                print STDERR "skipping cleanup for $stage $stage_id because config file ($config_file) is present\n";
    13281328                $status = 0;
     
    14501450            my $config_file = $ipprc->filename("PPIMAGE.CONFIG", $path_base);
    14511451           
    1452             if (!$config_file or ! -e $config_file) {
     1452            unless ($ipprc->file_exists($config_file)) {
    14531453                print STDERR "skipping cleanup for $stage $stage_id because config file is missing\n";
    14541454                $status = 0;
     
    14581458            my $config_file = $ipprc->filename("PPIMAGE.CONFIG", $path_base);
    14591459           
    1460             if ($config_file and -e $config_file) {
     1460            if ($ipprc->file_exists($config_file)) {
    14611461                print STDERR "skipping cleanup for $stage $stage_id because config file ($config_file) is present\n";
    14621462                $status = 0;
     
    15911591            my $config_file = $ipprc->filename("PPIMAGE.CONFIG", $path_base, $class_id);
    15921592
    1593             if (!$config_file or ! -e $config_file) {
     1593            unless ($ipprc->file_exists($config_file)) {
    15941594                print STDERR "skipping cleanup for $stage $stage_id $class_id "
    15951595                    . " because config file is missing\n";
     
    16001600            my $config_file = $ipprc->filename("PPIMAGE.CONFIG", $path_base, $class_id);
    16011601
    1602             if ($config_file and -e $config_file) {
     1602            if ($ipprc->file_exists($config_file)) {
    16031603                print STDERR "skipping scrubbed for $stage $stage_id $class_id "
    16041604                    . " because config file is present\n";
     
    17311731            my $config_file = $ipprc->filename("PPIMAGE.CONFIG", $path_base);
    17321732           
    1733             if (!$config_file or ! -e $config_file) {
     1733            unless ($ipprc->file_exists($config_file)) {
    17341734                print STDERR "skipping cleanup for $stage $stage_id because config file is missing\n";
    17351735                $status = 0;
     
    17391739            my $config_file = $ipprc->filename("PPIMAGE.CONFIG", $path_base);
    17401740           
    1741             if ($config_file and -e $config_file) {
     1741            if ($ipprc->file_exists($config_file)) {
    17421742                print STDERR "skipping cleanup for $stage $stage_id because config file ($config_file) is present\n";
    17431743                $status = 0;
     
    18331833{
    18341834    my $files = shift; # reference to a list of files to unlink
    1835 
    1836 #     open(TMPLOG,">>/tmp/czw.cleanup.log");
    1837 #     flock(TMPLOG,2);
     1835#     my $test_verbose = 1;
     1836   
     1837#     if ($test_verbose == 1) {
     1838#       open(TMPLOG,">>/tmp/czw.cleanup.log");
     1839#       flock(TMPLOG,2);
     1840#     }
    18381841
    18391842    # this script is, of course, very dangerous.
    18401843    foreach my $file (@$files) {
    1841         print STDERR "unlinking $file\n";
    1842 #       print TMPLOG "$stage $stage_id $file";
    1843 #       my $ff = $file;
    1844 #       $ff =~ s%^file://%%;
    1845 #       unless (-e $ff) {
    1846 #           print TMPLOG "\t File not found\n";
     1844        print STDERR "unlinking $stage $stage_id $file";
     1845        unless ($ipprc->file_exists($file)) {
     1846            print STDERR "\t File not found\n";
     1847        }
     1848        else {
     1849            print STDERR "\n";
     1850        }
     1851
     1852#       if ($test_verbose == 1) {
     1853#           print TMPLOG "$stage $stage_id $file";
     1854           
     1855#           else {
     1856#               print TMPLOG "\n";
     1857#           }
    18471858#       }
    1848 #       else {
    1849 #           print TMPLOG "\n";
    1850 #       }
    18511859
    18521860        $ipprc->file_delete($file);
    18531861    }
    18541862
    1855 #     flock(TMPLOG,8);
    1856 #     close(TMPLOG);
     1863#     if ($test_verbose == 1) {
     1864#       flock(TMPLOG,8);
     1865#       close(TMPLOG);
     1866#     }
    18571867
    18581868    return 1;
Note: See TracChangeset for help on using the changeset viewer.