Changeset 13748 for trunk/ippScripts/scripts/detrend_resid.pl
- Timestamp:
- Jun 10, 2007, 10:13:50 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/detrend_resid.pl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/detrend_resid.pl
r13732 r13748 125 125 my $bin2Name = $ipprc->filename("PPIMAGE.BIN2", $outputRoot, $class_id); 126 126 my $outputStats = $outputRoot . '.' . $class_id . '.stats'; 127 my $outputBinnedStats = $outputRoot . '.' . $class_id . '.bin.stats'; 128 129 # Run ppImage 127 128 # Run ppImage & ppStats 130 129 my $stats = PS::IPP::Metadata::Stats->new(); # Stats parser 131 130 my $binnedStats = PS::IPP::Metadata::Stats->new(); # Stats parser 132 131 unless ($no_op) { 133 my $command = "$ppImage -file $input_uri $outputRoot -recipe PPIMAGE $recipe" . 134 " -stat $outputStats "; # Command to run ppImage 132 my $command = "$ppImage -file $input_uri $outputRoot"; 133 $command .= " -recipe PPIMAGE $recipe"; 134 $command .= " -recipe PPSTATS RESIDUAL"; 135 $command .= " -stats $outputStats"; 135 136 136 137 # Detrend to use in processing … … 152 153 &my_die("Couldn't find expected output file: $bin2Name", $det_id, $iter, $exp_tag, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($bin2Name); 153 154 154 # Get the statistics on the residual image155 # Load the raw output stats file 155 156 my $statsFile; # File handle 156 157 open $statsFile, $ipprc->file_resolve($outputStats) or &my_die("Can't open statistics file $outputStats: $!", $det_id, $iter, $exp_tag, $class_id, $PS_EXIT_SYS_ERROR); 157 158 my @contents = <$statsFile>; # Contents of file 158 159 close $statsFile; 160 161 # Parse the statistics on the residual image 159 162 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files 160 163 my $metadata = $mdcParser->parse(join "", @contents) or &my_die("Unable to parse metadata config doc", $det_id, $iter, $exp_tag, $class_id, $PS_EXIT_PROG_ERROR); 161 # $stats = PS::IPP::Metadata::Stats->new(); # Stats parser162 164 $stats->parse($metadata) or &my_die("Unable to find all values in statistics output.", $det_id, $iter, $exp_tag, $class_id, $PS_EXIT_PROG_ERROR); 163 165 164 166 # run ppStats on the binned image 165 $command = "$ppStats $bin2Name $outputBinnedStats";167 $command = "$ppStats -recipe PPSTATS RESIDUAL $bin2Name"; 166 168 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 167 169 run(command => $command, verbose => 1); 168 169 170 unless ($success) { 170 171 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); … … 172 173 } 173 174 174 &my_die("Couldn't find expected output file: $outputBinnedStats", $det_id, $iter, $exp_tag, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($outputBinnedStats); 175 176 open $statsFile, $ipprc->file_resolve($outputBinnedStats) or &my_die("Can't open statistics file $outputBinnedStats: $!", $det_id, $iter, $exp_tag, $class_id, $PS_EXIT_SYS_ERROR); 177 @contents = <$statsFile>; # Contents of file 178 close $statsFile; 179 my $binnedMetadata = $mdcParser->parse(join "", @contents) or &my_die("Unable to parse metadata config doc", $det_id, $iter, $exp_tag, $class_id, $PS_EXIT_PROG_ERROR); 180 # $binnedStats = PS::IPP::Metadata::Stats->new(); # Stats parser 175 # parse the binned image statistics 176 my $binnedMetadata = $mdcParser->parse(join "", @$stdout_buf) or &my_die("Unable to parse metadata output", $det_id, $iter, $exp_tag, $class_id, $PS_EXIT_PROG_ERROR); 181 177 $binnedStats->parse($binnedMetadata) or &my_die("Unable to find all values in statistics output.", $det_id, $iter, $exp_tag, $class_id, $PS_EXIT_PROG_ERROR); 182 178 }
Note:
See TracChangeset
for help on using the changeset viewer.
