IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13748


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

require recipe for ppStats in scripts

Location:
trunk/ippScripts/scripts
Files:
11 edited

Legend:

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

    r13698 r13748  
    2828use Pod::Usage qw( pod2usage );
    2929
    30 use constant RECIPE => 'PPIMAGE_OBDSFRA'; # Recipe to use
     30my $RECIPE = 'PPIMAGE_OBDSFRA'; # Recipe to use
    3131
    3232# Parse the command-line arguments
     
    9595    print "outputStats: $outputStats\n";
    9696
    97     my $command = "$ppImage -file $input $outputRoot -recipe PPIMAGE " . RECIPE .
    98         " -stat $outputStats"; # Command to run ppImage
     97    my $command = "$ppImage -file $input $outputRoot";
     98    $command .= " -recipe PPIMAGE $RECIPE";
     99    $command .= " -recipe PPSTATS CHIPSTATS";
     100    $command .= " -stats $outputStats"; # Command to run ppImage
     101
    99102    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    100103        run(command => $command, verbose => 1);
     
    103106        &my_die("Unable to perform ppImage: $error_code", $chip_id, $class_id, $error_code);
    104107    }
     108
    105109    &my_die("Couldn't find expected output file: $outputImage\n", $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputImage);
    106110    &my_die("Couldn't find expected output file: $outputMask\n", $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputMask);
  • trunk/ippScripts/scripts/detrend_norm_apply.pl

    r13732 r13748  
    7070
    7171
    72 use constant RECIPE => 'PPIMAGE_N'; # Recipe to use with ppImage
     72my $RECIPE_PPIMAGE = 'PPIMAGE_N'; # Recipe to use with ppImage
     73my $RECIPE_PPSTATS = 'CHIPSTATS'; # Recipe to use with ppStats
    7374
    7475# Look for programs we need
     
    9394my $stats = PS::IPP::Metadata::Stats->new(); # Stats parser
    9495unless ($no_op) {
    95     my $command = "$ppImage -file $input $outputRoot -norm $value -stat $statsName -recipe PPIMAGE " . RECIPE(); # Command to run
     96    my $command = "$ppImage -file $input $outputRoot";
     97    $command .= " -norm $value -stats $statsName";
     98    $command .= " -recipe PPIMAGE $RECIPE_PPIMAGE";
     99    $command .= " -recipe PPSTATS $RECIPE_PPSTATS";
    96100    $command .= ' -isfringe' if lc($det_type) eq 'fringe';
     101
    97102    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    98103        run(command => $command, verbose => 1);
  • trunk/ippScripts/scripts/detrend_process_imfile.pl

    r13732 r13748  
    9999my $stats = PS::IPP::Metadata::Stats->new(); # Stats parser
    100100unless ($no_op) {
    101     my $command = "$ppImage -file $input_uri $outputRoot -recipe PPIMAGE $recipe" .
    102         " -stat $outputStats"; # Command to run ppImage
     101    my $command = "$ppImage -file $input_uri $outputRoot";
     102    $command .= " -recipe PPIMAGE $recipe";
     103    $command .= " -recipe PPSTATS CHIPSTATS";
     104    $command .= " -stats $outputStats";
     105
    103106    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    104107        run(command => $command, verbose => 1);
  • 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}
  • trunk/ippScripts/scripts/detrend_stack.pl

    r13698 r13748  
    116116    $command .= ' -type ' . uc($det_type); # Type of stacking to perform
    117117    $command .= " -stats $outputStats"; # Statistics output filename
     118    $command .= " -recipe PPSTATS CHIPSTATS";
    118119   
    119120    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
  • trunk/ippScripts/scripts/diff_skycell.pl

    r13717 r13748  
    143143my $stats = PS::IPP::Metadata::Stats->new(); # Stats parser
    144144unless ($no_op) {
    145     my $command = "$ppSub $input $template $outputRoot -inmask $inputMask -refmask $templateMask -stat $outputStats"; # Command to run ppSub
     145    my $command = "$ppSub $input $template $outputRoot";
     146    $command .= " -inmask $inputMask";
     147    $command .= " -refmask $templateMask";
     148    $command .= " -stats $outputStats";
     149    $command .= " -recipe PPSTATS CHIPSTATS";
    146150
    147151    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
  • trunk/ippScripts/scripts/ipp_serial_inject.pl

    r13743 r13748  
    5757    my $relfile = $ipprc->convert_filename_relative( $absfile );
    5858
    59     my $command_type = "$ppStats -concept FPA.OBSTYPE -concept FPA.TELESCOPE -concept FPA.INSTRUMENT $absfile";
     59    my $command_type = "$ppStats -recipe PPSTATS RESIDUAL $absfile";
    6060    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command_type, verbose => 1);
    6161    die "Unable to perform ppStats: $error_code\n" if not $success;
     
    6969        if ($row->{name} eq "FPA.TELESCOPE")  { $telescope = $row->{value}; }
    7070        if ($row->{name} eq "FPA.INSTRUMENT") { $instrument = $row->{value}; } # this entry must return the camera in the ipp/config system which we load
    71 #       if ($row->{name} eq "FPA.OBSTYPE")    { $type = $row->{value}; }
    7271    }
    7372   
  • trunk/ippScripts/scripts/register_exp.pl

    r13698 r13748  
    8686my $regtool = can_run('regtool')
    8787    or (warn "can't find regtool" and $missing_tools = 1);
    88 my $ppStats = can_run('ppStats')
    89     or (warn "can't find ppStats" and $missing_tools = 1);
    9088
    9189if ($missing_tools) {
  • trunk/ippScripts/scripts/register_imfile.pl

    r13698 r13748  
    5858    and defined $uri;
    5959
    60 my $RECIPE = "PPSTATS_REGISTER"; # Recipe to use for ppStats
     60my $RECIPE = "REGISTER"; # Recipe to use for ppStats
    6161
    6262# These values should be constant for all components
  • trunk/ippScripts/scripts/stack_skycell.pl

    r13717 r13748  
    143143my $stats = PS::IPP::Metadata::Stats->new(); # Stats parser
    144144unless ($no_op) {
    145     my $command = "$ppStack $listName $outputRoot -stat $outputStats"; # Command to run pois
     145    my $command = "$ppStack $listName $outputRoot";
     146    $command .= " -stats $outputStats";
     147    $command .= " -recipe PPSTATS CHIPSTATS";
    146148
    147149    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
  • trunk/ippScripts/scripts/warp_skycell.pl

    r13711 r13748  
    118118my $stats = PS::IPP::Metadata::Stats->new(); # Stats parser
    119119unless ($no_op) {
    120     my $command = "$pswarp -list $list1Name -masklist $list2Name -astromlist $list3Name $outputRoot $skyFile -stat $outputStats"; # Command to run pswarp
     120    my $command = "$pswarp -list $list1Name";
     121    $command .= " -masklist $list2Name";
     122    $command .= " -astromlist $list3Name";
     123    $command .= " $outputRoot $skyFile";
     124    $command .= " -stats $outputStats";
     125    $command .= " -recipe PPSTATS CHIPSTATS";
     126
    121127    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    122128        run(command => $command, verbose => 1);
Note: See TracChangeset for help on using the changeset viewer.