IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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

File:
1 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);
Note: See TracChangeset for help on using the changeset viewer.