Changeset 31430
- Timestamp:
- May 4, 2011, 2:20:59 PM (15 years ago)
- Location:
- branches/czw_branch/20110406
- Files:
-
- 2 edited
-
ippScripts/scripts/lap_science.pl (modified) (28 diffs)
-
ippTools/src/laptool.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20110406/ippScripts/scripts/lap_science.pl
r31429 r31430 25 25 my $laptool = can_run('laptool') or (warn "Can't find laptool" and $missing_tools = 1); 26 26 27 my ( $help, $verbose, $debug );27 my ( $help, $verbose, $debug, $do_nothing); 28 28 my ( $camera, $dbname); 29 29 my ( $lap_id ); … … 34 34 'verbose' => \$verbose, 35 35 'debug' => \$debug, 36 'do_nothing' => \$do_nothing, 36 37 37 38 'camera=s' => \$camera, … … 106 107 unless ($success) { 107 108 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 108 &my_die("Unable to perform laptool : $error_code", $lap_id);109 &my_die("Unable to perform laptool -updaterun: $error_code", $lap_id); 109 110 } 110 111 } … … 126 127 unless ($success) { 127 128 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 128 &my_die("Unable to perform chiptool : $error_code", $exp_id, $data_group);129 &my_die("Unable to perform chiptool -listrun: $error_code", $exp_id, $data_group); 129 130 } 130 131 my $chips = $mdcParser->parse_list(join "", @$stdout_buf) or 131 &my_die("Unable to parse metadata from chiptool ", $exp_id, $data_group);132 &my_die("Unable to parse metadata from chiptool -listrun", $exp_id, $data_group); 132 133 # There should be only one. 133 134 my $chip = ${ $chips }[0]; … … 148 149 unless ($success) { 149 150 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 150 &my_die("Unable to perform laptool : $error_code", $lap_id);151 &my_die("Unable to perform laptool -pendingrun: $error_code", $lap_id); 151 152 } 152 153 my $Runs = $mdcParser->parse_list(join "", @$stdout_buf) or 153 &my_die("Unable to parse metadata from laptool ", $lap_id);154 &my_die("Unable to parse metadata from laptool -pendingrun", $lap_id); 154 155 # There should be only one. 155 156 my $Run = ${ $Runs }[0]; … … 186 187 unless ($success) { 187 188 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 188 &my_die("Unable to perform chiptool : $error_code", $exposure->{lap_id}, $exposure->{proj_cell});189 &my_die("Unable to perform chiptool -definebyquery: $error_code", $exposure->{lap_id}, $exposure->{proj_cell}); 189 190 } 190 191 … … 205 206 unless ($success) { 206 207 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 207 &my_die("Unable to perform laptool : $error_code", $lap_id);208 &my_die("Unable to perform laptool -pendingexp: $error_code", $lap_id); 208 209 } 209 210 … … 214 215 215 216 my $exposures = $mdcParser->parse_list(join "", @$stdout_buf) or 216 &my_die("Unable to parse metadata from laptool ", $lap_id);217 &my_die("Unable to parse metadata from laptool -pendingexp", $lap_id); 217 218 218 219 my $counter = 0; … … 324 325 unless($success) { 325 326 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 326 &my_die("Unable to perform laptool : $error_code", $lap_id, "");327 &my_die("Unable to perform laptool -stacks: $error_code", $lap_id, ""); 327 328 } 328 329 … … 334 335 335 336 my $stacks = $mdcParser->parse_list(join "", @$stdout_buf) or 336 &my_die("Unable to parse metadata from laptool ", $lap_id, "");337 &my_die("Unable to parse metadata from laptool -stacks", $lap_id, ""); 337 338 338 339 my $total_qstacks = 0; … … 396 397 unless ($success) { 397 398 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 398 &my_die("Unable to perform laptool : $error_code", $lap_id);399 &my_die("Unable to perform laptool -exposures: $error_code", $lap_id); 399 400 } 400 401 … … 405 406 406 407 my $exposures = $mdcParser->parse_list(join "", @$stdout_buf) or 407 &my_die("Unable to parse metadata from laptool ", $lap_id);408 &my_die("Unable to parse metadata from laptool -exposures", $lap_id); 408 409 409 410 # Need to prescan to see who matches whom. … … 466 467 # } 467 468 # } 468 if ((($exposure->{warpRun_state})&& # This exposure has a warp 469 ($exposure->{warpRun_state} eq 'full'))|| # This exposure's warp is either done or impossible. 470 ($exposure->{data_state} eq 'drop')) { 469 if ($exposure->{data_state} eq 'drop') { # This exposure is impossible, so fudge the counts so we get through. 471 470 $can_qstack ++; 472 471 $can_diff ++; 472 $have_diff ++; 473 $can_fstack ++; 474 next; 475 } 476 477 if (($exposure->{warpRun_state})&& # This exposure has a warp 478 ($exposure->{warpRun_state} eq 'full')) { # This exposure's warp is done. 479 $can_qstack ++; 480 $can_diff ++; 473 481 } 474 482 if (($exposure->{magicked}&& 475 &S64_IS_NOT_NULL($exposure->{magicked}))|| # This exposure has been magicked, so it is through with diff. 476 ($exposure->{data_state} eq 'drop')) { 483 &S64_IS_NOT_NULL($exposure->{magicked}))) { # This exposure has been magicked, so it is through with diff. 477 484 $can_fstack ++; 478 485 } … … 497 504 498 505 print "STATUS: TOTAL_EXPOSURES: $total_exposures\n"; 499 506 if ($do_nothing) { 507 exit(0); 508 } 500 509 if (($needs_qstack == 1)&& # Do we need the quick stack? 501 510 ($defined_qstack == 0)&& # Have we not made it already? … … 533 542 unless ($success) { 534 543 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 535 &my_die("Unable to perform laptool : $error_code", $lap_id);544 &my_die("Unable to perform laptool -updaterun: $error_code", $lap_id); 536 545 } 537 546 } … … 564 573 $command .= " -dbname $dbname " if defined $dbname; 565 574 $command .= " -definebyquery -select_label $label -select_skycell_id ${proj_cell}.% -select_filter $filter "; 566 $command .= " -set_label ${label} .quick-set_data_group ${proj_cell}.quick.${date} ";575 $command .= " -set_label ${label} -set_data_group ${proj_cell}.quick.${date} "; 567 576 $command .= " -set_workdir $workdir -set_dist_group NODIST "; 568 577 $command .= " -min_num 2 -set_reduction QUICKSTACK "; … … 572 581 unless ($success) { 573 582 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 574 &my_die("Unable to perform chiptool: $error_code", $lap_id);583 &my_die("Unable to perform stacktool -definebyquery: $error_code", $lap_id); 575 584 } 576 585 … … 584 593 unless ($success) { 585 594 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 586 &my_die("Unable to perform chiptool: $error_code", $lap_id);595 &my_die("Unable to perform stacktool -sassskyfile: $error_code", $lap_id); 587 596 } 588 597 589 598 my $stacks = $mdcParser->parse_list(join "", @$stdout_buf) or 590 &my_die("Unable to parse metadata from laptool", $lap_id, "");599 &my_die("Unable to parse metadata from stacktool -sassskyfile", $lap_id, ""); 591 600 592 601 my $stack = ${ $stacks }[0]; … … 604 613 unless ($success) { 605 614 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 606 &my_die("Unable to perform chiptool: $error_code", $lap_id);615 &my_die("Unable to perform laptool -updaterun: $error_code", $lap_id); 607 616 } 608 617 … … 634 643 $command .= " -dbname $dbname " if defined $dbname; 635 644 $command .= " -definebyquery -select_label $label -select_skycell_id ${proj_cell}.% -select_filter $filter "; 636 $command .= " -set_label ${label} .final-set_workdir $workdir -set_data_group ${proj_cell}.final.${date} ";645 $command .= " -set_label ${label} -set_workdir $workdir -set_data_group ${proj_cell}.final.${date} "; 637 646 $command .= " -min_num 2 -set_reduction THREEPI_STACK "; 638 647 … … 641 650 unless ($success) { 642 651 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 643 &my_die("Unable to perform chiptool: $error_code", $lap_id);652 &my_die("Unable to perform stacktool -definebyquery: $error_code", $lap_id); 644 653 } 645 654 … … 654 663 unless ($success) { 655 664 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 656 &my_die("Unable to perform chiptool: $error_code", $lap_id);665 &my_die("Unable to perform stacktool -sassskyfile: $error_code", $lap_id); 657 666 } 658 667 659 668 my $stacks = $mdcParser->parse_list(join "", @$stdout_buf) or 660 &my_die("Unable to parse metadata from laptool", $lap_id, "");669 &my_die("Unable to parse metadata from stacktool -sassskyfile", $lap_id, ""); 661 670 662 671 my $stack = ${ $stacks }[0]; … … 673 682 unless ($success) { 674 683 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 675 &my_die("Unable to perform chiptool: $error_code", $lap_id);684 &my_die("Unable to perform laptool -updaterun: $error_code", $lap_id); 676 685 } 677 686 … … 742 751 unless ($success) { 743 752 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 744 &my_die("unable to perform difftool : $error_code", $exposure->{lap_id}, $exposure->{proj_cell});753 &my_die("unable to perform difftool -definewarp(warp|stack): $error_code", $exposure->{lap_id}, $exposure->{proj_cell}); 745 754 } 746 755 747 756 my $diffs = $mdcParser->parse_list(join "", @$stdout_buf) or 748 &my_die("Unable to parse metadata from laptool", $lap_id, "");757 &my_die("Unable to parse metadata from difftool -definewarp(warp|stack)", $lap_id, ""); 749 758 750 759 my $diff = ${ $diffs }[0]; … … 781 790 unless ($success) { 782 791 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 783 &my_die("Unable to perform laptool : $error_code", "none", "none");792 &my_die("Unable to perform laptool -inactiveexp: $error_code", "none", "none"); 784 793 } 785 794 if (@$stdout_buf == 0) { … … 789 798 790 799 my $exposures = $mdcParser->parse_list(join "", @$stdout_buf) or 791 &my_die("Unable to parse metadata from laptool ", $lap_id);800 &my_die("Unable to parse metadata from laptool -inactiveexp", $lap_id); 792 801 793 802 my @clean_modes = ( … … 814 823 unless ($success) { 815 824 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 816 &my_die("Unable to perform laptool: $error_code", "none", "none");825 &my_die("Unable to perform cleantool: $command : $error_code", "none", "none"); 817 826 } 818 827 } … … 893 902 unless ($success) { 894 903 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 895 &my_die("Unable to perform laptool : $error_code", $exposure->{lap_id}, $exposure->{proj_cell});904 &my_die("Unable to perform laptool -updateexp: $error_code", $exposure->{lap_id}, $exposure->{proj_cell}); 896 905 } 897 906 } -
branches/czw_branch/20110406/ippTools/src/laptool.c
r31429 r31430 460 460 if (rows) { 461 461 // We're done with these exposures now, so mark them as inactive. 462 if ((strcmp(state,"drop") == 0)|| 463 (strcmp(state,"full") == 0)) { 464 values = psMetadataAlloc(); 465 psMetadataAddBool(values, PS_LIST_TAIL, "active", 0, "", false); 466 long exps = psDBUpdateRows(config->dbh, "lapExp", where, values); 467 468 if (exps) { 469 return(true); 470 } 471 else { 472 return(true); // We shouldn't really fail if we didn't change anything. Maybe there's nothing to change. 462 if (state) { 463 if ((strcmp(state,"drop") == 0)|| 464 (strcmp(state,"full") == 0)) { 465 values = psMetadataAlloc(); 466 psMetadataAddBool(values, PS_LIST_TAIL, "active", 0, "", false); 467 long exps = psDBUpdateRows(config->dbh, "lapExp", where, values); 468 469 if (exps) { 470 return(true); 471 } 472 else { 473 return(true); // We shouldn't really fail if we didn't change anything. Maybe there's nothing to change. 474 } 473 475 } 474 476 }
Note:
See TracChangeset
for help on using the changeset viewer.
