Changeset 17941 for trunk/ippScripts/scripts
- Timestamp:
- Jun 5, 2008, 11:43:34 AM (18 years ago)
- Location:
- trunk/ippScripts/scripts
- Files:
-
- 3 edited
-
detrend_process_imfile.pl (modified) (10 diffs)
-
detrend_resid.pl (modified) (14 diffs)
-
detrend_stack.pl (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/detrend_process_imfile.pl
r17671 r17941 36 36 'outroot|w=s' => \$outroot, # output file base name 37 37 'dbname|d=s' => \$dbname, # Database name 38 'reduction=s' => \$reduction, # Reduction class38 'reduction=s' => \$reduction, # Reduction class 39 39 'verbose' => \$verbose, # Print to stdout 40 40 'no-update' => \$no_update, … … 44 44 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 45 45 pod2usage( -msg => "Required options: --det_id --exp_id --class_id --det_type --exp_tag --input_uri --camera --outroot", 46 -exitval => 3) unless 46 -exitval => 3) unless 47 47 defined $det_id and 48 defined $exp_id and 49 defined $class_id and 50 defined $det_type and 51 defined $exp_tag and 52 defined $input_uri and 53 defined $camera and 48 defined $exp_id and 49 defined $class_id and 50 defined $det_type and 51 defined $exp_tag and 52 defined $input_uri and 53 defined $camera and 54 54 defined $outroot; 55 55 … … 62 62 63 63 # values to extract from output metadata and the stats to calculate 64 my $STATS = 65 [ 64 my $STATS = 65 [ 66 66 # PPSTATS KEYWORD STATISTIC CHIPTOOL FLAG 67 67 { name => "ROBUST_MEDIAN", type => "mean", flag => "-bg", dtype => "float" }, … … 75 75 my $dettool = can_run('dettool') or (warn "Can't find dettool" and $missing_tools = 1); 76 76 my $ppImage = can_run('ppImage') or (warn "Can't find ppImage" and $missing_tools = 1); 77 if ($missing_tools) { 77 if ($missing_tools) { 78 78 warn("Can't find required tools."); 79 exit($PS_EXIT_CONFIG_ERROR); 79 exit($PS_EXIT_CONFIG_ERROR); 80 80 } 81 81 $ppImage .= " -dbname $dbname" if defined $dbname; … … 105 105 $command .= " -stats $outputStats"; 106 106 $command .= " -tracedest $traceDest -log $logDest"; 107 $command .= " -dbname $dbname" if defined $dbname; 107 108 108 109 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 109 run(command => $command, verbose => $verbose);110 run(command => $command, verbose => $verbose); 110 111 unless ($success) { 111 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);112 &my_die("Unable to perform ppImage: $error_code", $det_id, $exp_id, $class_id, $error_code);112 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 113 &my_die("Unable to perform ppImage: $error_code", $det_id, $exp_id, $class_id, $error_code); 113 114 } 114 115 … … 119 120 120 121 # Get the statistics on the processed image 121 my $statsFile; # File handle122 my $statsFile; # File handle 122 123 open $statsFile, $ipprc->file_resolve("$outputStats") or die "Can't open statistics file $outputStats: $!\n"; 123 124 my @contents = <$statsFile>; # Contents of file … … 125 126 126 127 # parse the statistics MDC file 127 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files128 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files 128 129 my $metadata = $mdcParser->parse(join "", @contents) 129 130 or &my_die("Unable to parse metadata config", $det_id, $exp_id, $class_id, $PS_EXIT_PROG_ERROR); … … 146 147 unless ($no_update) { 147 148 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 148 run(command => $command, verbose => $verbose);149 run(command => $command, verbose => $verbose); 149 150 unless ($success) { 150 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);151 warn("Unable to perform dettool -addprocessedimfile: $error_code\n");152 exit($error_code);151 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 152 warn("Unable to perform dettool -addprocessedimfile: $error_code\n"); 153 exit($error_code); 153 154 } 154 155 } else { … … 159 160 { 160 161 my $msg = shift; # Warning message on die 161 my $det_id = shift; # Detrend identifier162 my $det_id = shift; # Detrend identifier 162 163 my $exp_id = shift; # Exposure tag 163 164 my $class_id = shift; # Class identifier … … 166 167 carp($msg); 167 168 if (defined $det_id and defined $exp_id and defined $class_id and not $no_update) { 168 my $command = "$dettool -addprocessedimfile";169 $command .= " -det_id $det_id";170 $command .= " -exp_id $exp_id"; 171 $command .= " -class_id $class_id";172 $command .= " -code $exit_code";173 $command .= " -dbname $dbname" if defined $dbname;169 my $command = "$dettool -addprocessedimfile"; 170 $command .= " -det_id $det_id"; 171 $command .= " -exp_id $exp_id"; 172 $command .= " -class_id $class_id"; 173 $command .= " -code $exit_code"; 174 $command .= " -dbname $dbname" if defined $dbname; 174 175 system ($command); 175 176 } -
trunk/ippScripts/scripts/detrend_resid.pl
r17671 r17941 39 39 'outroot|w=s' => \$outroot, # output file base name 40 40 'dbname|d=s' => \$dbname, # Database name 41 'reduction=s' => \$reduction, # Reduction class41 'reduction=s' => \$reduction, # Reduction class 42 42 'verbose' => \$verbose, # Print to stdout 43 43 'no-update' => \$no_update, … … 47 47 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 48 48 pod2usage( -msg => "Required options: --det_id --iteration --exp_id --exp_tag --class_id --det_type --camera --input_uri --mode --detrend --outroot (not for 'verify' mode)", 49 -exitval => 3) unless 50 defined $det_id and 51 defined $iter and 52 defined $exp_id and 53 defined $exp_tag and 54 defined $class_id and 55 defined $det_type and 56 defined $input_uri and 57 defined $camera and 58 defined $mode and 59 defined $outroot and 49 -exitval => 3) unless 50 defined $det_id and 51 defined $iter and 52 defined $exp_id and 53 defined $exp_tag and 54 defined $class_id and 55 defined $det_type and 56 defined $input_uri and 57 defined $camera and 58 defined $mode and 59 defined $outroot and 60 60 (defined $detrend or lc($mode) eq 'verify'); 61 61 … … 64 64 # Recipes to use as a function of detrend type and mode 65 65 $reduction = 'DETREND' unless defined $reduction; 66 my $recipe; # Name of recipe to use66 my $recipe; # Name of recipe to use 67 67 if ($mode eq 'master') { 68 68 $recipe = uc($det_type) . '_RESID'; … … 75 75 76 76 # values to extract from output metadata and the stats to calculate 77 my $STATS = 77 my $STATS = 78 78 [ 79 79 # PPSTATS KEYWORD STATISTIC CHIPTOOL FLAG 80 80 { name => "ROBUST_MEDIAN", type => "mean", flag => "-bg", dtype => "float" }, 81 81 { name => "ROBUST_MEDIAN", type => "stdev", flag => "-bg_mean_stdev", dtype => "float" }, 82 { name => "ROBUST_STDEV", type => "rms", flag => "-bg_stdev", dtype => "float" },82 { name => "ROBUST_STDEV", type => "rms", flag => "-bg_stdev", dtype => "float" }, 83 83 { name => "SAMPLE_SKEWNESS", type => "mean", flag => "-bg_skewness", dtype => "float" }, 84 84 { name => "SAMPLE_KURTOSIS", type => "mean", flag => "-bg_kurtosis", dtype => "float" }, 85 { name => "FRINGE_0", type => "mean", flag => "-fringe_0", dtype => "float" },86 { name => "FRINGE_ERR_0", type => "rms", flag => "-fringe_1", dtype => "float" },87 { name => "FRINGE_0", type => "stdev", flag => "-fringe_2", dtype => "float" },85 { name => "FRINGE_0", type => "mean", flag => "-fringe_0", dtype => "float" }, 86 { name => "FRINGE_ERR_0", type => "rms", flag => "-fringe_1", dtype => "float" }, 87 { name => "FRINGE_0", type => "stdev", flag => "-fringe_2", dtype => "float" }, 88 88 { name => "FRINGE_RESID_0", type => "mean", flag => "-fringe_resid_0", dtype => "float" }, 89 89 { name => "FRINGE_RESID_ERR_0", type => "rms", flag => "-fringe_resid_1", dtype => "float" }, … … 92 92 my $stats = PS::IPP::Metadata::Stats->new($STATS); # Stats parser 93 93 94 my $BINNED_STATS = 94 my $BINNED_STATS = 95 95 [ 96 96 { name => "ROBUST_STDEV", type => "rms", flag => "-bin_stdev" }, … … 100 100 # Flags to specify the particular detrend to use 101 101 use constant DETRENDS => { 102 'bias' => '-bias', # Specify the bias frame103 'dark' => '-dark', # Specify the dark frame104 'shutter' => '-shutter', # Specify the shutter frame105 'flat' => '-flat', # Specify the flat frame106 'domeflat' => '-flat', # Specify the flat frame107 'skyflat' => '-flat', # Specify the flat frame108 'fringe' => '-fringe', # Specify the fringe frame109 'mask' => '-mask', # Specify the mask frame110 'darkmask' => '-mask', # Specify the mask frame111 'flatmask' => '-mask', # Specify the mask frame102 'bias' => '-bias', # Specify the bias frame 103 'dark' => '-dark', # Specify the dark frame 104 'shutter' => '-shutter', # Specify the shutter frame 105 'flat' => '-flat', # Specify the flat frame 106 'domeflat' => '-flat', # Specify the flat frame 107 'skyflat' => '-flat', # Specify the flat frame 108 'fringe' => '-fringe', # Specify the fringe frame 109 'mask' => '-mask', # Specify the mask frame 110 'darkmask' => '-mask', # Specify the mask frame 111 'flatmask' => '-mask', # Specify the mask frame 112 112 }; 113 113 114 use constant DELETE_STATS => 0; # Delete the statistics file when done?114 use constant DELETE_STATS => 0; # Delete the statistics file when done? 115 115 116 116 # Look for programs we need … … 119 119 my $ppImage = can_run('ppImage') or (warn "Can't find ppImage" and $missing_tools = 1); 120 120 my $ppStats = can_run('ppStats') or (warn "Can't find ppStats" and $missing_tools = 1); 121 if ($missing_tools) { 121 if ($missing_tools) { 122 122 warn("Can't find required tools."); 123 exit($PS_EXIT_CONFIG_ERROR); 123 exit($PS_EXIT_CONFIG_ERROR); 124 124 } 125 125 $ppImage .= " -dbname $dbname" if defined $dbname; … … 147 147 $command .= " -stats $outputStats"; 148 148 $command .= " -tracedest $traceDest -log $logDest"; 149 $command .= " -dbname $dbname" if defined $dbname; 149 150 150 151 # Detrend to use in processing 151 152 if (lc($mode) ne 'verify') { 152 my $detFlag = DETRENDS->{lc($det_type)};153 &my_die("Unrecognised detrend type: $det_type", $det_id, $iter, $exp_id, $class_id, $PS_EXIT_PROG_ERROR) unless defined $detFlag;154 $command .= " $detFlag $detrend";153 my $detFlag = DETRENDS->{lc($det_type)}; 154 &my_die("Unrecognised detrend type: $det_type", $det_id, $iter, $exp_id, $class_id, $PS_EXIT_PROG_ERROR) unless defined $detFlag; 155 $command .= " $detFlag $detrend"; 155 156 } 156 157 157 158 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 158 run(command => $command, verbose => $verbose);159 run(command => $command, verbose => $verbose); 159 160 unless ($success) { 160 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);161 &my_die("Unable to perform ppImage: $error_code", $det_id, $iter, $exp_id, $class_id, $error_code);161 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 162 &my_die("Unable to perform ppImage: $error_code", $det_id, $iter, $exp_id, $class_id, $error_code); 162 163 } 163 164 &my_die("Couldn't find expected output file: $outputName", $det_id, $iter, $exp_id, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($outputName); … … 167 168 168 169 # Load the raw output stats file 169 my $statsFile; # File handle170 my $statsFile; # File handle 170 171 open $statsFile, $ipprc->file_resolve($outputStats) or &my_die("Can't open statistics file $outputStats: $!", $det_id, $iter, $exp_id, $class_id, $PS_EXIT_SYS_ERROR); 171 172 my @contents = <$statsFile>; # Contents of file … … 173 174 174 175 # Parse the stats file contents into a metadata 175 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files176 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files 176 177 my $metadata = $mdcParser->parse(join "", @contents) or &my_die("Unable to parse metadata config doc", $det_id, $iter, $exp_id, $class_id, $PS_EXIT_PROG_ERROR); 177 178 … … 182 183 $command = "$ppStats -recipe PPSTATS RESIDUAL $bin2Name"; 183 184 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 184 run(command => $command, verbose => $verbose);185 run(command => $command, verbose => $verbose); 185 186 unless ($success) { 186 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);187 &my_die("Unable to perform ppStats: $error_code", $det_id, $iter, $exp_id, $class_id, $error_code);187 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 188 &my_die("Unable to perform ppStats: $error_code", $det_id, $iter, $exp_id, $class_id, $error_code); 188 189 } 189 190 … … 211 212 unless ($no_update) { 212 213 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 213 run(command => $command, verbose => $verbose);214 run(command => $command, verbose => $verbose); 214 215 unless ($success) { 215 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);216 warn("Unable to perform dettool -addresidimfile: $error_code\n");217 exit($error_code);216 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 217 warn("Unable to perform dettool -addresidimfile: $error_code\n"); 218 exit($error_code); 218 219 } 219 220 } else { … … 224 225 { 225 226 my $msg = shift; # Warning message on die 226 my $det_id = shift; # Detrend identifier227 my $iter = shift; # Iteration227 my $det_id = shift; # Detrend identifier 228 my $iter = shift; # Iteration 228 229 my $exp_id = shift; # Exposure tag 229 230 my $class_id = shift; # Class identifier … … 232 233 carp($msg); 233 234 if (defined $det_id and defined $iter and defined $exp_id and not $no_update) { 234 my $command = "$dettool -addresidimfile";235 $command .= " -det_id $det_id";236 $command .= " -iteration $iter";237 $command .= " -exp_id $exp_id";238 $command .= " -class_id $class_id";239 $command .= " -code $exit_code";240 $command .= " -dbname $dbname" if defined $dbname;235 my $command = "$dettool -addresidimfile"; 236 $command .= " -det_id $det_id"; 237 $command .= " -iteration $iter"; 238 $command .= " -exp_id $exp_id"; 239 $command .= " -class_id $class_id"; 240 $command .= " -code $exit_code"; 241 $command .= " -dbname $dbname" if defined $dbname; 241 242 system ($command); 242 243 } -
trunk/ippScripts/scripts/detrend_stack.pl
r17762 r17941 36 36 'outroot|w=s' => \$outroot, # output file base name 37 37 'dbname|d=s' => \$dbname, # Database name 38 'reduction=s' => \$reduction, # Reduction class for processing38 'reduction=s' => \$reduction, # Reduction class for processing 39 39 'verbose' => \$verbose, # Print to stdout 40 40 'save-temps' => \$save_temps, # Save temporary files? … … 44 44 45 45 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 46 pod2usage( -msg => "Required options: --det_id --iteration --class_id --det_type --camera --outroot", 47 -exitval => 3) unless 48 defined $det_id and 49 defined $iter and 50 defined $class_id and 51 defined $det_type and 46 pod2usage( -msg => "Required options: --det_id --iteration --class_id --det_type --camera --outroot", 47 -exitval => 3) unless 48 defined $det_id and 49 defined $iter and 50 defined $class_id and 51 defined $det_type and 52 52 defined $camera and 53 53 defined $outroot; … … 64 64 # XXX -bg_mean_stdev should take stdev of bg_mean if bg_mean_stdev == 0 (B) 65 65 # XXX (A) if imfile.Ncomp > 1, (B) if imfile.Ncomp == 1 66 my $STATS = 67 [ 66 my $STATS = 67 [ 68 68 # KEYWORD STATISTIC CHIPTOOL FLAG 69 69 { name => "ROBUST_MEDIAN", type => "mean", flag => "-bg", dtype => "float" }, … … 77 77 my $dettool = can_run('dettool') or (warn "Can't find dettool" and $missing_tools = 1); 78 78 my $ppMerge = can_run('ppMerge') or (warn "Can't find ppMerge" and $missing_tools = 1); 79 if ($missing_tools) { 79 if ($missing_tools) { 80 80 warn("Can't find required tools."); 81 exit($PS_EXIT_CONFIG_ERROR); 81 exit($PS_EXIT_CONFIG_ERROR); 82 82 } 83 83 84 84 # The output file rule name depends on the detrend type 85 85 my $FILERULES = { 'FLATMASK' => 'PPMERGE.OUTPUT.MASK', 86 'DARKMASK' => 'PPMERGE.OUTPUT.MASK',87 'MASK' => 'PPMERGE.OUTPUT.MASK',88 'BIAS' => 'PPMERGE.OUTPUT.BIAS',89 'DARK' => 'PPMERGE.OUTPUT.DARK',90 'SHUTTER' => 'PPMERGE.OUTPUT.SHUTTER',91 'FLAT' => 'PPMERGE.OUTPUT.FLAT',92 'DOMEFLAT' => 'PPMERGE.OUTPUT.FLAT',93 'SKYFLAT' => 'PPMERGE.OUTPUT.FLAT',94 'FRINGE' => 'PPMERGE.OUTPUT.FRINGE',95 };86 'DARKMASK' => 'PPMERGE.OUTPUT.MASK', 87 'MASK' => 'PPMERGE.OUTPUT.MASK', 88 'BIAS' => 'PPMERGE.OUTPUT.BIAS', 89 'DARK' => 'PPMERGE.OUTPUT.DARK', 90 'SHUTTER' => 'PPMERGE.OUTPUT.SHUTTER', 91 'FLAT' => 'PPMERGE.OUTPUT.FLAT', 92 'DOMEFLAT' => 'PPMERGE.OUTPUT.FLAT', 93 'SKYFLAT' => 'PPMERGE.OUTPUT.FLAT', 94 'FRINGE' => 'PPMERGE.OUTPUT.FRINGE', 95 }; 96 96 my $output_filerule = $FILERULES->{$det_type}; # File rule for output 97 97 &my_die("Unrecognised detrend type: $det_type", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless defined $output_filerule; … … 107 107 108 108 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 109 run(command => $command, verbose => $verbose);109 run(command => $command, verbose => $verbose); 110 110 unless ($success) { 111 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);112 &my_die("Unable to perform dettool -processedimfile: $error_code", $det_id, $iter, $class_id, $error_code);113 } 114 115 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files111 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 112 &my_die("Unable to perform dettool -processedimfile: $error_code", $det_id, $iter, $class_id, $error_code); 113 } 114 115 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files 116 116 my $metadata = $mdcParser->parse(join "", @$stdout_buf) or 117 &my_die("Unable to parse metadata config doc", $det_id, $iter, $class_id, $PS_EXIT_PROG_ERROR);118 $files = parse_md_list($metadata) or 119 &my_die("Unable to parse metadata list", $det_id, $iter, $class_id, $PS_EXIT_PROG_ERROR);117 &my_die("Unable to parse metadata config doc", $det_id, $iter, $class_id, $PS_EXIT_PROG_ERROR); 118 $files = parse_md_list($metadata) or 119 &my_die("Unable to parse metadata list", $det_id, $iter, $class_id, $PS_EXIT_PROG_ERROR); 120 120 } 121 121 … … 129 129 $num++; 130 130 131 my $image = $file->{uri}; # Image name131 my $image = $file->{uri}; # Image name 132 132 my $mask = $ipprc->filename( "PPIMAGE.OUTPUT.MASK", $file->{path_base}, $class_id ); # Mask name 133 133 my $weight = $ipprc->filename( "PPIMAGE.OUTPUT.WEIGHT", $file->{path_base}, $class_id ); # Weight name … … 137 137 138 138 if ($ipprc->file_exists( $mask )) { 139 print $listFile "\tMASK\tSTR\t" . $mask . "\n";139 print $listFile "\tMASK\tSTR\t" . $mask . "\n"; 140 140 } 141 141 if ($ipprc->file_exists( $weight )) { 142 print $listFile "\tWEIGHT\tSTR\t" . $weight . "\n";142 print $listFile "\tWEIGHT\tSTR\t" . $weight . "\n"; 143 143 } 144 144 … … 166 166 $command .= " -recipe PPMERGE $recipe"; 167 167 $command .= ' -type ' . uc($det_type); # Type of stacking to perform 168 $command .= " -stats $outputStats"; # Statistics output filename168 $command .= " -stats $outputStats"; # Statistics output filename 169 169 $command .= " -recipe PPSTATS CHIPSTATS"; 170 170 $command .= " -tracedest $traceDest -log $logDest"; 171 $command .= " -dbname $dbname" if defined $dbname; 171 172 172 173 # Stack the files 173 174 unless ($no_op) { 174 175 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 175 run(command => $command, verbose => $verbose);176 run(command => $command, verbose => $verbose); 176 177 unless ($success) { 177 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);178 &my_die("Unable to perform ppMerge: $error_code", $det_id, $iter, $class_id, $error_code);178 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 179 &my_die("Unable to perform ppMerge: $error_code", $det_id, $iter, $class_id, $error_code); 179 180 } 180 181 &my_die("Unable to find expected output file: $outputStack\n", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($outputStack); … … 185 186 # Get the statistics on the stacked image 186 187 open(my $statsFile, $ipprc->file_resolve("$outputStats")) or 187 &my_die("Can't open statistics file $outputStats: $!", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR);188 &my_die("Can't open statistics file $outputStats: $!", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR); 188 189 my $contents = do { local $/; <$statsFile> }; # Contents of file 189 190 close($statsFile); 190 191 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files191 192 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files 192 193 my $metadata = $mdcParser->parse($contents) or 193 &my_die("Unable to parse metadata config doc", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR);194 &my_die("Unable to parse metadata config doc", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR); 194 195 195 196 $stats->parse($metadata) or 196 &my_die("Unable to find all values in statistics output.", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR);197 &my_die("Unable to find all values in statistics output.", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR); 197 198 } 198 199 … … 209 210 unless ($no_update) { 210 211 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 211 run(command => $command, verbose => $verbose);212 run(command => $command, verbose => $verbose); 212 213 unless ($success) { 213 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);214 warn("Unable to perform dettool -addstacked: $error_code\n");215 exit($error_code);214 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 215 warn("Unable to perform dettool -addstacked: $error_code\n"); 216 exit($error_code); 216 217 } 217 218 } else { … … 222 223 { 223 224 my $msg = shift; # Warning message on die 224 my $det_id = shift; # Detrend identifier225 my $iter = shift; # Iteration225 my $det_id = shift; # Detrend identifier 226 my $iter = shift; # Iteration 226 227 my $class_id = shift; # Class identifier 227 228 my $exit_code = shift; # Exit code to add … … 229 230 carp($msg); 230 231 if (defined $det_id and defined $iter and defined $class_id and not $no_update) { 231 my $command = "$dettool -addstacked";232 $command .= " -det_id $det_id";233 $command .= " -iteration $iter";234 $command .= " -class_id $class_id";235 $command .= " -code $exit_code";236 $command .= " -dbname $dbname" if defined $dbname;237 system ($command);232 my $command = "$dettool -addstacked"; 233 $command .= " -det_id $det_id"; 234 $command .= " -iteration $iter"; 235 $command .= " -class_id $class_id"; 236 $command .= " -code $exit_code"; 237 $command .= " -dbname $dbname" if defined $dbname; 238 system ($command); 238 239 } 239 240 exit $exit_code;
Note:
See TracChangeset
for help on using the changeset viewer.
