IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 15, 2007, 2:23:33 PM (19 years ago)
Author:
Paul Price
Message:

Adding --no-op option which turns off processing (so one can track only the database work flow) for everything except the phase 0 scripts (need to have some real data in the database in order to track it).

File:
1 edited

Legend:

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

    r11829 r11837  
    3434
    3535my ($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);
    3737GetOptions(
    3838    'det_id|d=s'        => \$det_id,
     
    4848    'workdir|w=s'       => \$workdir,   # Working directory, for output files
    4949    'no-update'         => \$no_update,
     50    'no-op'             => \$no_op,
    5051) or pod2usage( 2 );
    5152
     
    138139
    139140# Run ppImage
    140 {
     141my $stats = PS::IPP::Metadata::Stats->new(); # Stats parser
     142unless ($no_op) {
    141143    my $command = "$ppImage -file $input_uri $outputRoot -recipe PPIMAGE $recipe" .
    142144        " -stat $outputStats "; # Command to run ppImage
     
    159161    &my_die("Couldn't find expected output file: $bin1Name", $det_id, $iter, $exp_tag, $class_id, $PS_EXIT_SYS_ERROR) unless -f $bin1Name;
    160162    &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
    166165    my $statsFile;              # File handle
    167166    open $statsFile, $outputStats or &my_die("Can't open statistics file $outputStats: $!", $det_id, $iter, $exp_tag, $class_id, $PS_EXIT_SYS_ERROR);
     
    179178$bin1Name = $ipprc->convert_filename_relative( $bin1Name );
    180179$bin2Name = $ipprc->convert_filename_relative( $bin2Name );
     180
     181my $bg = ($stats->bg_mean() or 'NAN');
     182my $bg_stdev = ($stats->bg_stdev() or 'NAN');
     183my $bg_mean_stdev = ($stats->bg_mean_stdev() or 'NAN');
     184
    181185unless ($no_update) {
    182186    my $command = "$dettool -addresidimfile -det_id $det_id -iteration $iter -exp_tag $exp_tag " .
    183187        "-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";
    185189    $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 imfile
    191         $command .= ' -bg_mean_stdev 0';
    192     }
    193 
    194     $command .= " -bg_stdev " . $stats->bg_stdev();
    195190
    196191    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
Note: See TracChangeset for help on using the changeset viewer.