- Timestamp:
- Jul 30, 2010, 9:31:50 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20100621/ippScripts/scripts/automate_stacks.pl
r28439 r28794 21 21 my $stacktool= can_run('stacktool') or (warn "Can't find stacktool" and $missing_tools = 1); 22 22 my $difftool = can_run('difftool') or (warn "Can't find difftool" and $missing_tools = 1); 23 my $magicdstool = can_run('magicdstool') or (warn "Can't find magicdstool" and $missing_tools = 1); 23 24 my $dettool = can_run('dettool') or (warn "Can't find dettool" and $missing_tools = 1); 24 25 my $ppConfigDump = can_run('ppConfigDump') or (warn "Can't find ppConfigDump" and $missing_tools = 1); … … 40 41 # Grab options 41 42 my ( $date, $camera, $dbname, $logfile, $verbose, $manual); 42 my ( $help, $isburning, $force_stack_count, $test_mode, $this_target_only, $this_filter_only, $ check_mode);43 my ( $help, $isburning, $force_stack_count, $test_mode, $this_target_only, $this_filter_only, $this_mode_only, $check_mode); 43 44 my ( $check_registration, $define_burntool, $queue_burntool, $check_chips, $queue_chips); 44 45 my ( $check_stacks, $queue_stacks, $check_diffs, $queue_diffs, $clean_old); … … 59 60 'this_target_only=s' => \$this_target_only, 60 61 'this_filter_only=s' => \$this_filter_only, 62 'this_mode_only=s' => \$this_mode_only, 61 63 'check_registration' => \$check_registration, 62 64 'define_burntool' => \$define_burntool, … … 86 88 --this_target_only Process only a single target. 87 89 --this_filter_only Process only a single filter. 90 --this_mode_only Process only a single clean mode. 88 91 Modes: 89 92 --check_registration Confirm the data downloaded correctly. … … 129 132 my %detfilter_list = (); 130 133 my %detmax_list = (); 134 my @mode_list = (); 131 135 my %clean_commands = (); 132 136 my %clean_retention = (); … … 151 155 if (${ $mentry }{name} eq 'MODE') { 152 156 $this_mode = ${ $mentry }{value}; 157 push @mode_list, $this_mode; 153 158 } 154 159 elsif (${ $mentry }{name} eq 'COMMAND') { … … 263 268 } 264 269 die("$this_filter_only is invalid.") if ($#filter_list != 0); 270 } 271 272 if (defined($this_mode_only)) { 273 foreach my $t (@mode_list) { 274 if ($t eq $this_mode_only) { 275 @mode_list = ($this_mode_only); 276 last; 277 } 278 } 279 die("$this_mode_only is invalid.") if ($#mode_list != 0); 265 280 } 266 281 … … 717 732 my $date = shift; 718 733 719 my $command = construct_dqstats tool_cmd($date);734 my $command = construct_dqstats_cmd($date); 720 735 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 721 736 run ( command => $command, verbose => $verbose ); … … 754 769 755 770 my $select = "-select_dateobs_begin ${date}T00:00:00 -select_dateobs_end ${date}T23:59:59 "; 771 my $use_limits = " -use_begin ${date}T00:00:00 -use_end ${date}T23:59:59 "; 756 772 $date =~ s/-//g; 757 773 … … 766 782 $cmd .= " -workdir $workdir "; 767 783 $cmd .= " -label $label "; 784 $cmd .= " $use_limits "; 768 785 if ($maxN > 0) { 769 786 $cmd .= " -random_subset -random_limit $maxN "; … … 839 856 } 840 857 if (($metadata_out{nsState} eq 'CHECKDETRENDS') && ($exposures > 0)) { 841 $metadata_out{nsState} eq 'QUEUE _DETRENDS';858 $metadata_out{nsState} eq 'QUEUEDETRENDS'; 842 859 } 843 860 } … … 1021 1038 my ($label,$workdir,$obs_mode,$object,$comment,$tess_id,$dist_group,$data_group,$reduction) = get_tool_parameters($cleaning_date,$target); 1022 1039 my $args = $command; 1023 if ((exists($clean_alternate{$mode})) && ($clean_alternate{$mode} )) {1040 if ((exists($clean_alternate{$mode})) && ($clean_alternate{$mode} eq 'A')) { 1024 1041 $args .= " -dbname $dbname -updaterun -set_state goto_cleaned -full -set_label goto_cleaned -time_stamp_end $cleaning_date "; 1042 } 1043 elsif ((exists($clean_alternate{$mode})) && ($clean_alternate{$mode} eq 'B')) { 1044 $args .= " -dbname $dbname -updaterun -set_state goto_cleaned -state full -set_label goto_cleaned -label $label "; 1025 1045 } 1026 1046 else { … … 1037 1057 my $pretend = shift; 1038 1058 1039 foreach my $mode ( sort (keys (%clean_commands))) {1040 if ((exists($clean_alternate{$mode})) && ($clean_alternate{$mode} )) {1059 foreach my $mode (@mode_list) { 1060 if ((exists($clean_alternate{$mode})) && ($clean_alternate{$mode} eq 'A')) { 1041 1061 my ($cleaning_date,$command) = construct_cleantool_args($date,"",$mode); 1042 1062 if ($cleaning_date eq 'no clean') { … … 1050 1070 unless ($success) { 1051 1071 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 1052 &my_die("Unable to perform stacktool: $error_code", 0,0,$date, $PS_EXIT_SYS_ERROR);1072 &my_die("Unable to perform cleantool ($command): $error_code", 0,0,$date, $PS_EXIT_SYS_ERROR); 1053 1073 } 1054 1074 } … … 1070 1090 unless ($success) { 1071 1091 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 1072 &my_die("Unable to perform stacktool: $error_code", 0,0,$date, $PS_EXIT_SYS_ERROR);1092 &my_die("Unable to perform cleantool ($command): $error_code", 0,0,$date, $PS_EXIT_SYS_ERROR); 1073 1093 } 1074 1094 }
Note:
See TracChangeset
for help on using the changeset viewer.
