IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25472


Ignore:
Timestamp:
Sep 21, 2009, 4:52:53 PM (17 years ago)
Author:
watersc1
Message:

add options to examine_burntool_pcontrol.pl to be more convenient. Clarity edits to ipp_apply_burntool.pl

Location:
trunk/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/examine_burntool_pcontrol.pl

    r25425 r25472  
    55use Getopt::Std;
    66
    7 getopts('hf',\%opt);
     7getopts('hfcP',\%opt);
    88if (exists($opt{h})) {
    99    print STDERR "Usage: examine_burntool_pcontrol.pl [-f] <pcontrol.pro>\n";
    1010    print STDERR "         -f          Read all burntool entries, even those commented out.\n";
     11    print STDERR "         -c          Print out the needed mysql statement to do a convert. DOES NOT EXECUTE THIS!\n";
     12    print STDERR "         -P          Print out the ipp_apply_burntool.pl commands, even if fully updated.\n";
    1113    print STDERR "\n";
    1214    print STDERR "         Reads in the pcontrol.pro file you're using to run burntool, and uses the\n";
     
    1921    print STDERR "                  B             Current version value for burntool_state. Burntool succeeded.\n";
    2022    print STDERR "                  b             Old version value for burntool_state. Burntool needs to be rerun.\n";
     23    print STDERR "                  ?             No matching rawImfile entry found in database.\n";
    2124    exit(1);
    2225}
     
    3639    print STDERR "GOOD == $burntoolStateGood\n";
    3740}
     41$convert_bt_state = -1.0 * $burntoolStateGood;
    3842
    3943# Read a class_id and burntool_state pair, and set the correct cell of the (sorry, global) character array vector
     
    121125    # images on a single night.
    122126    $sth = "SELECT exp_id,exp_name,obs_mode,dateobs,class_id,burntool_state,comment FROM rawImfile WHERE dateobs >= '${dmin}' AND dateobs <= '${dmax}' order by dateobs limit 60000";
     127
     128    $no_sth = "UPDATE rawImfile SET burntool_state = $convert_bt_state WHERE dateobs >= '${dmin}' AND dateobs <= '${dmax}' AND user_1 = 1.0;";
    123129    $data_ref = $db->selectall_arrayref( $sth );
    124130
     
    133139    # Print out query for clarity, and the header:
    134140    print "#### $sth\n";
     141    if (exists($opt{c})) {
     142        print "#### $no_sth\n";
     143    }
    135144    print "#                                                     0       1       2       3       4       5       6       7       \n";
    136145    print "#exp_i exp_name       obs_mode dateobs             nB 0123456701234567012345670123456701234567012345670123456701234567 comment\n";
     
    176185                    }
    177186                    else {
    178                         $vector[$j] = '[32m?[m';
     187                        $vector[$j] = '[36;40;01m?[m';
    179188                    }
    180189                }
     
    192201
    193202    # If we didn't find that all 60 chips had succesful burntools run, print out the ipp_apply_burntool.pl command we would need to fix this:
    194     if ($burncount != 60) {
     203    if (($burncount != 60)||(exists($opt{P}))) {
    195204        for ($j = 0; $j < 64; $j++) {
    196205#           printf("%d %s %d\n",$j, $vector[$j], ($vector[$j] !~ /B/));
    197             if ($vector[$j] !~ /B/) {
     206            if (($vector[$j] !~ /B/)||(exists($opt{P}))) {
    198207                if ($vector[$j] ne '_') {
    199208                    $id = sprintf("XY%d%d",int($j / 8),$j % 8);
  • trunk/tools/ipp_apply_burntool.pl

    r25425 r25472  
    6767
    6868# Determine the value of a "good" burntool run.
    69 my $config_cmd = "$ppConfigDump -camera $camera -dump-camera - | grep BURNTOOL";
     69my $config_cmd = "$ppConfigDump -camera $camera -dump-camera - | grep BURNTOOL | uniq";
    7070my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    7171    run ( command => $config_cmd, verbose => $verbose);
     
    110110
    111111my $files = parse_md_list($metadata) or
    112     &my_die("Unable to parse metadat list", $class_id, $dateobs_begin, $dateobs_end, $PS_EXIT_SYS_ERROR);
     112    &my_die("Unable to parse metadata list", $class_id, $dateobs_begin, $dateobs_end, $PS_EXIT_SYS_ERROR);
    113113
    114114my $REALRUN = 1;
     
    130130   
    131131    my $process = 0;
     132    my $previousTableStyle = 0;
    132133
    133134    if ($state == 0) {
     
    145146    elsif ($state == $burntoolStateGood) {
    146147        $process = 0;
    147         $previousTable = "infits=$rawImfileReal";
     148        $previousTableStyle = 1;
    148149    }
    149150    elsif ($state == -1 * $burntoolStateGood) {
    150151        $process = 0;
    151         $previousTable = "in=$outTableReal";
     152#       $previousTable = "in=$outTableReal";
     153        $previousTableStyle = -1;
    152154    }
    153155    else {
    154156        $process = 1;
    155157    }
    156 
     158    if ($REALRUN == 0) {
     159        print "##Pretending to process as instructed!\n";
     160        $process = 1;
     161    }
    157162    if (($process == 1)||($processNext == 1)) {
    158163        $processNext = 1;
     
    190195        }
    191196
     197        $previousTableStyle = -1;
     198       
     199        print "\n";
     200    }
     201   
     202    if ($previousTableStyle == 1) {
     203        $previousTable = "infits=$rawImfileReal";
     204    }
     205    elsif ($previousTableStyle == -1) {
    192206        $previousTable = "in=$outTableReal";
    193 
    194         print "\n";
    195     }
     207    }
     208    else {
     209        die "previousTableStyle undefined!\n";
     210    }
     211   
    196212}
    197213   
Note: See TracChangeset for help on using the changeset viewer.