IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 3, 2010, 8:41:49 AM (16 years ago)
Author:
eugene
Message:

updates from trunk

Location:
branches/tap_branches
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/tap_branches

  • branches/tap_branches/ippScripts/scripts/chip_imfile.pl

    r25555 r27838  
    88use Sys::Hostname;
    99my $host = hostname();
     10my $date = `date`;
    1011print "\n\n";
    11 print "Starting script $0 on $host\n\n";
     12print "Starting script $0 on $host at $date\n\n";
    1213
    1314use DateTime;
     
    5354    'reduction=s'       => \$reduction, # Reduction class
    5455    'run-state=s'       => \$run_state, # current state of the run (new, update)
    55     'magicked        => \$magicked,  # magicked state of input file
     56    'magicked=s'        => \$magicked,  # magicked state of input file
    5657    'deburned=s'        => \$deburned,  # does deburned image exist?
    5758    'threads=s'         => \$threads,   # Number of threads to use for ppImage
     
    134135    $command = "$ppConfigDump -camera $camera -dump-recipe PPIMAGE -recipe PPIMAGE $recipe_ppImage -";
    135136    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    136         run(command => $command, verbose => $verbose);
     137        run(command => $command, verbose => 0);
    137138    unless ($success) {
    138139        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     
    146147
    147148    if ($useDeburnedImage) {
    148         my $useBestBurntool  = metadataLookupBool($recipeData, 'USE.BEST.BURNTOOL');
    149 
    150         ## Check that we have required programs:
    151 #       print STDERR "Inside burntool loop!\n";
    152         my $regtool  = can_run('regtool') or &my_die ("Can't find regtool", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
    153         my $funpack  = can_run('funpack') or &my_die ("Can't find funpack", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
    154         my $burntool = can_run('burntool') or &my_die ("Can't find burntool", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
    155        
     149        my $useBestBurntool  = metadataLookupBool($recipeData, 'USE.BEST.BURNTOOL');
     150
     151        ## Check that we have required programs:
     152#       print STDERR "Inside burntool loop!\n";
     153        my $regtool  = can_run('regtool') or &my_die ("Can't find regtool", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
     154        my $funpack  = can_run('funpack') or &my_die ("Can't find funpack", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
     155        my $burntool = can_run('burntool') or &my_die ("Can't find burntool", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
     156
    156157        ## Check the current burntool processing version:
    157158        my $regtool_state_cmd = "$regtool -processedimfile -exp_id $exp_id -class_id $class_id -limit 1";
     
    173174        my $burntoolState = 999;
    174175        foreach my $regEntry (@$regData2) {
    175 #           print "$regEntry->{exp_id} $regEntry->{burntool_state}\n";
     176           print "$regEntry->{exp_id} $regEntry->{burntool_state}\n";
    176177
    177178            if ($regEntry->{exp_id} == $exp_id) {
     
    182183            &my_die("Unable to find burntool_state in metadata", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
    183184        }
    184         if ($burntoolState == 32767) {
    185             $burntoolState = 0;
    186         }
     185        if ($burntoolState == 32767) {
     186            $burntoolState = 0;
     187        }
    187188
    188189        ## Read camera config to get the current good burntool state :
     
    190191        my $camera_config_cmd = "$ppConfigDump -camera $camera -dump-camera -";
    191192        ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    192             run(command => $camera_config_cmd, verbose => $verbose);
     193            run(command => $camera_config_cmd, verbose => 0);
    193194        unless ($success) {
    194195            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     
    206207        }
    207208
    208         if (abs($burntoolState) != $burntoolStateGood) {
    209             if ($useBestBurntool) {
    210                 &my_die("Image burntool version does not match current accepted version.", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
    211             }
    212             else {
    213                 warn ("Image burntool version does not match current accepted version. Continuing as requested.");
    214                 # Internally pretend that we're at a good version.
    215                 if ($burntoolState < -10) {
    216                     $burntoolState = -1 * $burntoolStateGood;
    217                 }
    218                 elsif ($burntoolState > 10) {
    219                     $burntoolState = $burntoolStateGood;
    220                 }
    221                 elsif ($burntoolState == 0) {
    222                     # You've told me to use a deburned image, and that you don't care if it's the most recent. The database has told me
    223                     # that burntool has never been run on this image. We'll hope the database is wrong, but I don't really trust that.
    224                     warn ("burntool_state suggests no table will be found. This will likely crash.");
    225                     $burntoolState = -1 * $burntoolStateGood;
    226                 }
    227                 else {
    228                     &my_die("No valid burntool table will be found.", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
    229                 }
    230             }
    231         }
     209        print "burntool state vs burntoolStateGood : $burntoolState vs $burntoolStateGood\n";
     210        if (abs($burntoolState) != $burntoolStateGood) {
     211            if ($useBestBurntool) {
     212                &my_die("Image burntool version does not match current accepted version.", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
     213            }
     214            else {
     215                warn ("Image burntool version does not match current accepted version. Continuing as requested.");
     216                # Internally pretend that we're at a good version.
     217                if ($burntoolState < -10) {
     218                    $burntoolState = -1 * $burntoolStateGood;
     219                }
     220                elsif ($burntoolState > 10) {
     221                    $burntoolState = $burntoolStateGood;
     222                }
     223                elsif ($burntoolState == 0) {
     224                    # You've told me to use a deburned image, and that you don't care if it's the most recent. The database has told me
     225                    # that burntool has never been run on this image. We'll hope the database is wrong, but I don't really trust that.
     226                    warn ("burntool_state suggests no table will be found. This will likely crash.");
     227                    $burntoolState = -1 * $burntoolStateGood;
     228                }
     229                else {
     230                    &my_die("No valid burntool table will be found.", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
     231                }
     232            }
     233        }
    232234
    233235        ## We now know that we have an image that has been burntooled.
     
    258260            }
    259261
    260             $burntool_cmd .= "$tempName in=${burntoolTable_uriReal} apply=t";
     262            $burntool_cmd .= "$tempName in=${burntoolTable_uriReal} persist=t apply=t";
    261263        }
    262264        elsif ($burntoolState == $burntoolStateGood) { # Burntool information stored in a header table.
    263             $burntool_cmd .= "$tempName apply=t";
     265            $burntool_cmd .= "$tempName persist=t apply=t";
    264266        }
    265267        else {
     
    375377    if ($do_stats) {
    376378        my $outputStatsReal = $ipprc->file_resolve($outputStats);
    377         &my_die("Couldn't find expected output file: $outputStats", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless -f $outputStatsReal;
     379        &my_die("Couldn't find expected output file: $outputStats", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputStatsReal);
    378380
    379381        # measure chip stats
     
    398400        &my_die("Couldn't find expected output file: $outputBin1\n",   $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputBin1);
    399401        &my_die("Couldn't find expected output file: $outputBin2\n",   $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputBin2);
     402        if ($run_state eq 'new') {
     403            &my_die("Couldn't find expected output file: $configuration", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($configuration);
     404        }
    400405    }
    401406
     
    411416    $command .= " -uri $outputImage";
    412417    $command .= " -path_base $outroot";
    413     $command .= " -magicked" if $magicked;
     418    $command .= " -magicked $magicked" if $magicked;
    414419    $command .= " -hostname $host" if defined $host;
    415420    $command .= " -dbname $dbname" if defined $dbname;
Note: See TracChangeset for help on using the changeset viewer.