IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 26722


Ignore:
Timestamp:
Jan 29, 2010, 10:52:03 AM (16 years ago)
Author:
eugene
Message:

more verbosity on burntool states, less on ppConfigDump

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20091201/ippScripts/scripts/chip_imfile.pl

    r25555 r26722  
    5353    'reduction=s'       => \$reduction, # Reduction class
    5454    'run-state=s'       => \$run_state, # current state of the run (new, update)
    55     'magicked        => \$magicked,  # magicked state of input file
     55    'magicked=s'        => \$magicked,  # magicked state of input file
    5656    'deburned=s'        => \$deburned,  # does deburned image exist?
    5757    'threads=s'         => \$threads,   # Number of threads to use for ppImage
     
    134134    $command = "$ppConfigDump -camera $camera -dump-recipe PPIMAGE -recipe PPIMAGE $recipe_ppImage -";
    135135    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    136         run(command => $command, verbose => $verbose);
     136        run(command => $command, verbose => 0);
    137137    unless ($success) {
    138138        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     
    146146
    147147    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        
     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
    156156        ## Check the current burntool processing version:
    157157        my $regtool_state_cmd = "$regtool -processedimfile -exp_id $exp_id -class_id $class_id -limit 1";
     
    173173        my $burntoolState = 999;
    174174        foreach my $regEntry (@$regData2) {
    175 #           print "$regEntry->{exp_id} $regEntry->{burntool_state}\n";
     175           print "$regEntry->{exp_id} $regEntry->{burntool_state}\n";
    176176
    177177            if ($regEntry->{exp_id} == $exp_id) {
     
    182182            &my_die("Unable to find burntool_state in metadata", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
    183183        }
    184         if ($burntoolState == 32767) {
    185             $burntoolState = 0;
    186         }
     184        if ($burntoolState == 32767) {
     185            $burntoolState = 0;
     186        }
    187187
    188188        ## Read camera config to get the current good burntool state :
     
    190190        my $camera_config_cmd = "$ppConfigDump -camera $camera -dump-camera -";
    191191        ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    192             run(command => $camera_config_cmd, verbose => $verbose);
     192            run(command => $camera_config_cmd, verbose => 0);
    193193        unless ($success) {
    194194            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     
    206206        }
    207207
    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         }
     208        print "burntool state vs burntoolStateGood : $burntoolState vs $burntoolStateGood\n";
     209        if (abs($burntoolState) != $burntoolStateGood) {
     210            if ($useBestBurntool) {
     211                &my_die("Image burntool version does not match current accepted version.", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
     212            }
     213            else {
     214                warn ("Image burntool version does not match current accepted version. Continuing as requested.");
     215                # Internally pretend that we're at a good version.
     216                if ($burntoolState < -10) {
     217                    $burntoolState = -1 * $burntoolStateGood;
     218                }
     219                elsif ($burntoolState > 10) {
     220                    $burntoolState = $burntoolStateGood;
     221                }
     222                elsif ($burntoolState == 0) {
     223                    # 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
     224                    # that burntool has never been run on this image. We'll hope the database is wrong, but I don't really trust that.
     225                    warn ("burntool_state suggests no table will be found. This will likely crash.");
     226                    $burntoolState = -1 * $burntoolStateGood;
     227                }
     228                else {
     229                    &my_die("No valid burntool table will be found.", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
     230                }
     231            }
     232        }
    232233
    233234        ## We now know that we have an image that has been burntooled.
     
    411412    $command .= " -uri $outputImage";
    412413    $command .= " -path_base $outroot";
    413     $command .= " -magicked" if $magicked;
     414    $command .= " -magicked $magicked" if $magicked;
    414415    $command .= " -hostname $host" if defined $host;
    415416    $command .= " -dbname $dbname" if defined $dbname;
Note: See TracChangeset for help on using the changeset viewer.