- Timestamp:
- Mar 5, 2012, 5:19:48 PM (14 years ago)
- Location:
- branches/meh_branches/ppstack_test
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippScripts/scripts/nightly_science.pl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/meh_branches/ppstack_test
- Property svn:mergeinfo changed
-
branches/meh_branches/ppstack_test/ippScripts/scripts/nightly_science.pl
r31906 r33415 996 996 $cmd .= " -min_num 4"; 997 997 $cmd .= " -select_good_frac_min 0.05"; 998 $cmd .= " -set_reduction NIGHTLY_STACK "; 998 if (defined($reduction)) { 999 $cmd .= " -set_reduction $reduction "; 1000 } 1001 else { 1002 $cmd .= " -set_reduction NIGHTLY_STACK "; 1003 } 999 1004 $cmd .= " $select "; 1000 1005 if ($debug == 1) { … … 1410 1415 } 1411 1416 } 1417 if ((defined($science_config{$target}{SELF_WSDIFFS})) && ($science_config{$target}{SELF_WSDIFFS} == 1)) { 1418 foreach my $filter (@filter_list) { 1419 # This one needs to return a state to see if we need to wait on stacking before checking again. 1420 $metadata_out{nsDiffState} = self_WS_diff_queue($date,$target,$filter,$pretend); 1421 } 1422 } 1412 1423 } 1413 1424 } … … 1702 1713 1703 1714 my ($lunation_start,$lunation_end) = get_lunation_extent($date); 1704 1715 1716 1717 # Get a list of exposures that could be diffed 1705 1718 my $new_data_group = "${data_group}.offnight"; 1706 1719 my $new_dist_group = "${dist_group}.offnight"; 1707 my $cmd = "$difftool -dbname $dbname -definewarpwarp "; 1708 $cmd .= "-input_label $label -template_label $label "; 1709 $cmd .= "-set_workdir $workdir -set_dist_group $new_dist_group -set_data_group $new_data_group "; 1710 $cmd .= " -simple -set_label $label -filter $filter "; 1711 $cmd .= " -dateobs_begin ${lunation_start}T00:00:00 -dateobs_end ${lunation_end}T23:59:59 -distance 1.5 "; 1712 1713 if (defined($pretend)) { 1714 $cmd .= ' -pretend '; 1715 } 1716 if (defined($debug)) { 1717 print STDERR "ON_diffs wants to run this command: $cmd\n"; 1718 } 1719 1720 if (($debug == 0)&&(!defined($pretend))) { 1721 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 1722 run ( command => $cmd, verbose => $verbose ); 1723 unless ($success) { 1724 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 1725 &my_die("Unable to perform difftool: $error_code", 0,0,$date, $PS_EXIT_SYS_ERROR); 1726 } 1727 } 1728 } 1720 my $check_cmd = "$difftool -dbname $dbname -definewarpwarp "; 1721 $check_cmd .= "-input_label $label -template_label $label "; 1722 $check_cmd .= "-set_workdir $workdir -set_dist_group $new_dist_group -set_data_group $new_data_group "; 1723 $check_cmd .= " -mintimediff 40000 "; 1724 $check_cmd .= " -pretend -simple -rerun -set_label $label -filter $filter "; 1725 $check_cmd .= " -dateobs_begin ${lunation_start}T00:00:00 -dateobs_end ${lunation_end}T23:59:59 -distance 1.5 "; 1726 1727 my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 1728 run ( command => $check_cmd, verbose => $verbose ); 1729 unless ($success) { 1730 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 1731 &my_die("Unable to perform difftool: $error_code", 0,0,$date, $PS_EXIT_SYS_ERROR); 1732 } 1733 1734 # Parse results 1735 my $diffs = $mdcParser->parse_list(join "", @$stdout_buf) or 1736 &my_die("Unable to parse metadata from difftool -definewarpwarp", 0, 0, $date, $PS_EXIT_PROG_ERROR); 1737 foreach my $diff (@$diffs) { 1738 unless (multi_date_verify_uniqueness_diff($diff->{input_warp_id},$diff->{template_warp_id},$date,$target)) { 1739 # If we don't already have a diff with these inputs, make a diff with these inputs. 1740 my $cmd = "$difftool -dbname $dbname -definewarpwarp "; 1741 $cmd .= "-input_label $label -template_label $label "; 1742 $cmd .= "-warp_id $diff->{input_warp_id} -template_warp_id $diff->{template_warp_id} "; 1743 $cmd .= "-set_workdir $workdir -set_dist_group $new_dist_group -set_data_group $new_data_group "; 1744 $cmd .= " -mintimediff 40000 "; 1745 $cmd .= " -simple -rerun -set_label $label -filter $filter "; 1746 $cmd .= " -dateobs_begin ${lunation_start}T00:00:00 -dateobs_end ${lunation_end}T23:59:59 -distance 1.5 "; 1747 1748 if (defined($pretend)) { 1749 $cmd .= ' -pretend '; 1750 } 1751 print STDERR "ON_diffs wants to run this command: $cmd\n"; 1729 1752 1753 if (($debug == 0)&&(!defined($pretend))) { 1754 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 1755 run ( command => $cmd, verbose => $verbose ); 1756 unless ($success) { 1757 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 1758 &my_die("Unable to perform difftool: $error_code", 0,0,$date, $PS_EXIT_SYS_ERROR); 1759 } 1760 } 1761 } 1762 } 1763 } 1764 1765 sub intranight_WS_diff_queue { 1766 my $date = shift; 1767 my $target = shift; 1768 my $filter = shift; 1769 my $pretend = shift; 1770 my ($label,$workdir,$obs_mode,$object,$comment,$tess_id,$dist_group,$data_group,$reduction) = get_tool_parameters($date,$target); 1771 my $db = init_gpc_db(); 1772 1773 my ($stacks_to_finish,$stacks_total) = check_stack_count($label); 1774 if (($stacks_to_finish == 0)&&($stacks_total != 0)) { 1775 my $cmd = "$difftool -dbname $dbname -definewarpstack "; 1776 $cmd .= " -good_frac 0.2 "; 1777 $cmd .= " -warp_label $label -stack_label $label -set_label $label "; 1778 $cmd .= " -set_workdir $workdir -available -set_reduction WARPSTACK -set_dist_group $dist_group "; 1779 $cmd .= " -rerun "; 1780 } 1781 } 1782 1783 sub check_stack_count { 1784 my $label = shift; 1785 1786 my $stacks_to_finish = 0; 1787 my $stacks_total = 0; 1788 1789 my $sth = "SELECT DISTINCT stack_id from stackRun where label = '$label' AND state = 'new'"; 1790 my $data_ref = $db->selectall_arrayref( $sth ); 1791 $stacks_to_finish = $#{ $data_ref } + 1; 1792 1793 $sth = "SELECT DISTINCT stack_id from stackRun where label = '$label'"; 1794 $data_ref = $db->selectall_arrayref( $sth ); 1795 $stacks_total = $#{ $data_ref } + 1; 1796 return($stacks_to_finish,$stacks_total); 1797 } 1730 1798 1731 1799
Note:
See TracChangeset
for help on using the changeset viewer.
