Changeset 33076
- Timestamp:
- Jan 10, 2012, 2:13:00 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/lap_science.pl (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/lap_science.pl
r32928 r33076 33 33 # Global configuration constants that probably should be read from elsewhere. 34 34 my $qstack_threshold = 0.05; # Only make a quickstack if more than 5% of the exposures require it. 35 my $minimum_stack_inputs = 6; # We can avoid magicking stack inputs if we have more than this number.35 my $minimum_stack_inputs = 2; # We can avoid magicking stack inputs if we have more than this number. 36 36 37 37 GetOptions( … … 620 620 my $are_warped = 0; 621 621 my $are_magicked = 0; 622 623 622 foreach my $exposure (@$exposures) { 624 623 $total_exposures++; … … 710 709 $exposure->{data_state} = 'to_diff'; 711 710 } 712 if (($exposure->{diff_id})&&(&S64_IS_NOT_NULL($exposure->{diff_id}))) { 711 if (($exposure->{diff_id})&& 712 (&S64_IS_NOT_NULL($exposure->{diff_id}))&& 713 (($exposure->{diffRun_state} eq 'full')|| 714 ($exposure->{diffRun_state} eq 'cleaned')) 715 ) { 716 $are_magicked++; 713 717 $have_diff ++; 714 $exposure->{data_state} = 'to_magic'; 715 } 716 if (($exposure->{magicked})&& 717 ($exposure->{warpRun_state})&& 718 ($exposure->{warpRun_state} eq 'full')&& 719 (&S64_IS_NOT_NULL($exposure->{magicked}))) { # This exposure has been magicked, so it is through with diff. 720 $are_magicked++; 718 # $exposure->{data_state} = 'to_magic'; 721 719 $exposure->{data_state} = 'full'; 722 # $can_fstack ++; 723 } 724 &update_this_exposure($exposure); 720 } 721 # We no longer need to care about magic 722 # if (($exposure->{magicked})&& 723 # ($exposure->{warpRun_state})&& 724 # ($exposure->{warpRun_state} eq 'full')&& 725 # (&S64_IS_NOT_NULL($exposure->{magicked}))) { # This exposure has been magicked, so it is through with diff. 726 # $are_magicked++; 727 # $exposure->{data_state} = 'full'; 728 # # $can_fstack ++; 729 # } 730 unless ($debug) { 731 &update_this_exposure($exposure); 732 } 725 733 } 726 734 … … 748 756 if ($defined_fstack == 0) { # We have not yet made any stacks. 749 757 print "STATUS: We can attempt to queue deep final stacks.\n"; 750 my $Nstacks_made = &queue_muggle_finalstack($exposures); 758 my $Nstacks_made; 759 unless ($debug) { 760 $Nstacks_made = &queue_muggle_finalstack($exposures); 761 } 751 762 print "STATUS: Made $Nstacks_made final stacks.\n"; 752 763 exit($Nstacks_made); … … 756 767 if ($have_fstack == $defined_fstack) { # We have made all the stacks we have asked for (so far) 757 768 if ($are_magicked < $total_exposures) { # But we have not yet made diffs 769 # if ($have_diff < $total_exposures) { # We have not yet made diffs 758 770 if (($can_diff == $total_exposures)&& # And we have exposures that should be diffed. 759 771 ($have_diff < $can_diff)) { # and we haven't made them all yet, either. … … 763 775 # &update_this_exposure($exposure); 764 776 # } 765 &queue_diffs($exposures); 777 unless ($debug) { 778 &queue_diffs($exposures); 779 } 766 780 exit(0); 767 781 } … … 774 788 } 775 789 elsif ($are_magicked == $total_exposures) { # We have made all of the diffs, and propagated through magic 776 print "STATUS: We can create all remaining stacks possible.\n"; 777 my $Nstacks_made = &queue_magic_finalstack($exposures); 778 if ($Nstacks_made == 0) { # We have made all the stacks that we will ever make. 790 print "STATUS: We would create all remaining stacks possible, but no longer require magic.\n"; 791 # my $Nstacks_made = -1; 792 # unless ($debug) { 793 # $Nstacks_made = &queue_muggle_finalstack($exposures); 794 # } 795 # if ($Nstacks_made == 0) { # We have made all the stacks that we will ever make. 779 796 print "STATUS: No more stacks generated. Deactivating exposures for this complete lapRun.\n"; 780 &deactivate_exposures($exposures); 781 $command = "$laptool -updaterun -lap_id $lap_id"; 782 $command .= " -dbname $dbname " if defined $dbname; 783 $command .= " -set_state full "; 784 my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 785 run(command => $command, verbose => $verbose); 786 unless ($success) { 787 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 788 &my_die("Unable to perform laptool -updaterun: $error_code", $lap_id); 789 } 797 unless ($debug) { 798 &deactivate_exposures($exposures); 799 800 $command = "$laptool -updaterun -lap_id $lap_id"; 801 $command .= " -dbname $dbname " if defined $dbname; 802 $command .= " -set_state full "; 803 my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 804 run(command => $command, verbose => $verbose); 805 unless ($success) { 806 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 807 &my_die("Unable to perform laptool -updaterun: $error_code", $lap_id); 808 } 809 # } 790 810 exit(0); 791 811 } 792 else {793 print "STATUS: $Nstacks_made stacks made.\n";794 exit(0);795 }812 # else { 813 # print "STATUS: $Nstacks_made stacks made.\n"; 814 # exit(0); 815 # } 796 816 } 797 817 else { # What? … … 995 1015 foreach $exposure (@$exposures) { 996 1016 if (($exposure->{data_state} ne 'drop')&& 997 (S64_IS_NOT_NULL($exposure->{magicked}))&&1017 # (S64_IS_NOT_NULL($exposure->{magicked}))&& 998 1018 (S64_IS_NOT_NULL($exposure->{warp_id}))) { 999 1019 $warps .= " -warp_id $exposure->{warp_id} "; … … 1478 1498 $command .= " -set_data_state $exposure->{data_state} "; 1479 1499 } 1480 1481 my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 1482 run(command => $command, verbose => $verbose); 1483 unless ($success) { 1484 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 1485 &my_die("Unable to perform laptool -updateexp: $error_code", $exposure->{lap_id}, $exposure->{proj_cell}); 1500 unless ($do_nothing) { 1501 my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 1502 run(command => $command, verbose => $verbose); 1503 1504 unless ($success) { 1505 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 1506 &my_die("Unable to perform laptool -updateexp: $error_code", $exposure->{lap_id}, $exposure->{proj_cell}); 1507 } 1486 1508 } 1487 1509 }
Note:
See TracChangeset
for help on using the changeset viewer.
