Changeset 8621
- Timestamp:
- Aug 25, 2006, 4:50:36 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/detrend_stack.pl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/detrend_stack.pl
r8617 r8621 56 56 # Stack the files 57 57 my $output = $detType . '_' . $classId . '_' . $detId . '_' . $iter . '.fit'; # Output name 58 my $outputStats = $detType . '_' . $classId . '_' . $detId . '_' . $iter . '.stats'; # Statistics name 58 59 { 59 60 my $command = "$ppMerge $output"; # Command to run … … 64 65 $command .= " -recipe PPMERGE $recipe"; 65 66 $command .= ' -type ' . uc($detType); # Type of stacking to perform 67 $command .= " -stats $outputStats"; # Statistics output filename 66 68 67 69 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 69 71 die "Unable to perform ppMerge: $error_code\n" if not $success; 70 72 die "Unable to find expected output file: $output\n" if not -f $output; 73 die "Unable to find expected output file: $outputStats\n" if not -f $outputStats; 71 74 } 72 75 73 ### XXX: Need to add statistics 74 my $bg_mean = 0; 75 my $bg_stdev = 0; 76 my $bg_mean_stdev = 0; 76 ### Could do some sort of JPEG generation here. 77 77 78 # Get the statistics on the stacked image 79 my $stats; # Statistics from ppImage 80 { 81 my $statsFile; # File handle 82 open $statsFile, "$outputStats" or die "Can't open statistics file $outputStats: $!\n"; 83 my @contents = <$statsFile>; # Contents of file 84 close $statsFile; 85 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files 86 my $metadata = $mdcParser->parse(join "", @contents); # Metadata from the stats 87 $stats = PS::IPP::Metadata::Stats->new(); # Stats parser 88 $stats->parse($metadata) or die "Unable to find all values in statistics output.\n"; 89 } 78 90 79 91 # Add the resultant into the database … … 81 93 my $command = "$dettool -addstacked -det_id $detId -iteration $iter -class_id $classId" . 82 94 " -uri $output -recip $recipe"; # Command to run 83 $command .= ' -bg ' . $ bg_mean;84 $command .= ' -bg_stdev ' . $ bg_stdev;85 $command .= ' -bg_mean_stdev ' . $ bg_mean_stdev;95 $command .= ' -bg ' . $stats->bg_mean(); 96 $command .= ' -bg_stdev ' . $stats->bg_stdev(); 97 $command .= ' -bg_mean_stdev ' . $stats->bg_mean_stdev(); 86 98 $command .= ' -pleasenormalize' if NORMALISE()->{$detType}; 87 99 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
Note:
See TracChangeset
for help on using the changeset viewer.
