IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 42396


Ignore:
Timestamp:
Feb 17, 2023, 11:07:10 AM (3 years ago)
Author:
tdeboer
Message:

burntool script typo fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-ps1-20211104/ippScripts/scripts/ipp_apply_burntool_fix.pl

    r37313 r42396  
    1515my $missing_tools;
    1616my $regtool = can_run('regtool') or (warn "Can't find regtool" and $missing_tools = 1);
     17my $ppConfigDump = can_run('ppConfigDump') or (warn "Can't find ppConfigDump" and $missing_tools = 1);
    1718my $burntool = can_run('ipp_apply_burntool_single.pl') or (warn "Can't find ipp_burntool_apply_single.pl" and $missing_tools = 1);
    1819if ($missing_tools) {
     
    6566die "failed to find uri in regtool output" unless $uri;
    6667
     68# Determine the value of a "good" burntool run.
     69my $config_cmd = "$ppConfigDump -camera $camera -get-key BURNTOOL.STATE.GOOD";
     70my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     71    run ( command => $config_cmd, verbose => $verbose);
     72unless ($success) {
     73    $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     74    carp("Unable to perform ppConfigDUmp $config_cmd: $error_code");
     75    exit $error_code;
     76}
     77
     78my $recipeData = $mdcParser->parse(join "", @$stdout_buf) or die("Unable to parse Config metadata");
     79
     80my $burntoolStateGood = 999;
     81foreach my $cfg (@$recipeData) {
     82    if ($cfg->{name} eq 'BURNTOOL.STATE.GOOD') {
     83        $burntoolStateGood = $cfg->{value};
     84    }
     85}
     86if ($burntoolStateGood == 999) {
     87    die("Failed to determine BURNTOOL.STATE.GOOD");
     88}
     89
     90
    6791# Construct burntool table name
    6892my $table;
    69 ($table = $uri) =~ s/\.fits/\.burn\.tbl/;
     93if($burntoolStateGood == 15) {
     94    ($table = $uri) =~ s/\.fits/\.burn\.v15\.tbl/;     
     95} else {
     96    ($table = $uri) =~ s/\.fits/\.burn\.tbl/;           
     97}
     98
    7099print "$table\n";
    71100
Note: See TracChangeset for help on using the changeset viewer.