Changeset 13678
- Timestamp:
- Jun 6, 2007, 9:36:30 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/detrend_stack.pl (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/detrend_stack.pl
r13275 r13678 1 1 #!/usr/bin/env perl 2 2 3 use Carp; 3 4 use warnings; 4 5 use strict; … … 32 33 use Pod::Usage qw( pod2usage ); 33 34 34 my ($det_id, $iter, $class_id, $det_type, $camera, $dbname, $workdir, $no_update, $no_op );35 my ($det_id, $iter, $class_id, $det_type, $camera, $dbname, $workdir, $no_update, $no_op, $quiet); 35 36 GetOptions( 36 37 'det_id|d=s' => \$det_id, … … 43 44 'no-update' => \$no_update, 44 45 'no-op' => \$no_op, 46 'quiet' => \$quiet, 45 47 ) or pod2usage( 2 ); 46 48 47 49 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 48 pod2usage( 49 -msg => "Required options: --det_id --iteration --class_id --det_type --camera", 50 -exitval => 3, 51 ) unless defined $det_id 50 pod2usage( -msg => "Required options: --det_id --iteration --class_id --det_type --camera", -exitval => 3 ) 51 unless defined $det_id 52 52 and defined $iter 53 53 and defined $class_id 54 54 and defined $det_type 55 55 and defined $camera; 56 57 my $verbose = 1; 58 if (defined $quiet) { $verbose = 0; } 56 59 57 60 # Recipes to use as a function of detrend type … … 86 89 $command .= " -dbname $dbname" if defined $dbname; 87 90 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 88 run(command => $command, verbose => 1);91 run(command => $command, verbose => $verbose); 89 92 unless ($success) { 90 93 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); … … 115 118 116 119 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 117 run(command => $command, verbose => 1);120 run(command => $command, verbose => $verbose); 118 121 unless ($success) { 119 122 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); … … 149 152 150 153 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 151 run(command => $command, verbose => 1);154 run(command => $command, verbose => $verbose); 152 155 unless ($success) { 153 156 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); … … 166 169 my $exit_code = shift; # Exit code to add 167 170 168 warn($msg);171 carp($msg); 169 172 if ($det_id and $iter and $class_id and not $no_update) { 170 173 my $command = "$dettool -addstacked -det_id $det_id -iteration $iter -class_id $class_id -code $exit_code";
Note:
See TracChangeset
for help on using the changeset viewer.
