IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 10, 2007, 10:13:50 AM (19 years ago)
Author:
eugene
Message:

require recipe for ppStats in scripts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/detrend_resid.pl

    r13732 r13748  
    125125my $bin2Name =  $ipprc->filename("PPIMAGE.BIN2", $outputRoot, $class_id);
    126126my $outputStats = $outputRoot . '.' . $class_id . '.stats';
    127 my $outputBinnedStats = $outputRoot . '.' . $class_id . '.bin.stats';
    128 
    129 # Run ppImage
     127
     128# Run ppImage & ppStats
    130129my $stats = PS::IPP::Metadata::Stats->new(); # Stats parser
    131130my $binnedStats = PS::IPP::Metadata::Stats->new(); # Stats parser
    132131unless ($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";
    135136
    136137    # Detrend to use in processing
     
    152153    &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);
    153154
    154     # Get the statistics on the residual image
     155    # Load the raw output stats file
    155156    my $statsFile;              # File handle
    156157    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);
    157158    my @contents = <$statsFile>; # Contents of file
    158159    close $statsFile;
     160
     161    # Parse the statistics on the residual image
    159162    my $mdcParser = PS::IPP::Metadata::Config->new;     # Parser for metadata config files
    160163    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 parser
    162164    $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);
    163165
    164166    # run ppStats on the binned image
    165     $command = "$ppStats $bin2Name $outputBinnedStats";
     167    $command = "$ppStats -recipe PPSTATS RESIDUAL $bin2Name";
    166168    ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    167169        run(command => $command, verbose => 1);
    168 
    169170    unless ($success) {
    170171        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     
    172173    }
    173174
    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);
    181177    $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);
    182178}
Note: See TracChangeset for help on using the changeset viewer.