Changeset 11837 for trunk/ippScripts/scripts/detrend_resid.pl
- Timestamp:
- Feb 15, 2007, 2:23:33 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/detrend_resid.pl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/detrend_resid.pl
r11829 r11837 34 34 35 35 my ($det_id, $iter, $exp_tag, $class_id, $det_type, $detrend, 36 $input_uri, $camera, $mode, $dbname, $workdir, $no_update );36 $input_uri, $camera, $mode, $dbname, $workdir, $no_update, $no_op); 37 37 GetOptions( 38 38 'det_id|d=s' => \$det_id, … … 48 48 'workdir|w=s' => \$workdir, # Working directory, for output files 49 49 'no-update' => \$no_update, 50 'no-op' => \$no_op, 50 51 ) or pod2usage( 2 ); 51 52 … … 138 139 139 140 # Run ppImage 140 { 141 my $stats = PS::IPP::Metadata::Stats->new(); # Stats parser 142 unless ($no_op) { 141 143 my $command = "$ppImage -file $input_uri $outputRoot -recipe PPIMAGE $recipe" . 142 144 " -stat $outputStats "; # Command to run ppImage … … 159 161 &my_die("Couldn't find expected output file: $bin1Name", $det_id, $iter, $exp_tag, $class_id, $PS_EXIT_SYS_ERROR) unless -f $bin1Name; 160 162 &my_die("Couldn't find expected output file: $bin2Name", $det_id, $iter, $exp_tag, $class_id, $PS_EXIT_SYS_ERROR) unless -f $bin2Name; 161 } 162 163 # Get the statistics on the residual image 164 my $stats; # Statistics from ppImage 165 { 163 164 # Get the statistics on the residual image 166 165 my $statsFile; # File handle 167 166 open $statsFile, $outputStats or &my_die("Can't open statistics file $outputStats: $!", $det_id, $iter, $exp_tag, $class_id, $PS_EXIT_SYS_ERROR); … … 179 178 $bin1Name = $ipprc->convert_filename_relative( $bin1Name ); 180 179 $bin2Name = $ipprc->convert_filename_relative( $bin2Name ); 180 181 my $bg = ($stats->bg_mean() or 'NAN'); 182 my $bg_stdev = ($stats->bg_stdev() or 'NAN'); 183 my $bg_mean_stdev = ($stats->bg_mean_stdev() or 'NAN'); 184 181 185 unless ($no_update) { 182 186 my $command = "$dettool -addresidimfile -det_id $det_id -iteration $iter -exp_tag $exp_tag " . 183 187 "-class_id $class_id -recip $recipe -uri $outputName -b1_uri $outputRoot"; # Command to run dettool 184 $command .= " -bg " . $stats->bg_mean();188 $command .= " -bg $bg -bg_stdev $bg_stdev -bg_mean_stdev $bg_mean_stdev"; 185 189 $command .= " -dbname $dbname" if defined $dbname; 186 187 if (defined($stats->bg_mean_stdev())) {188 $command .= " -bg_mean_stdev " . $stats->bg_mean_stdev();189 } else {190 # May be undefined if there is only a single imfile191 $command .= ' -bg_mean_stdev 0';192 }193 194 $command .= " -bg_stdev " . $stats->bg_stdev();195 190 196 191 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
Note:
See TracChangeset
for help on using the changeset viewer.
