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_process_imfile.pl

    r11830 r11837  
    3232use Pod::Usage qw( pod2usage );
    3333
    34 my ($det_id, $exp_tag, $class_id, $det_type, $input_uri, $camera, $dbname, $workdir, $no_update);
     34my ($det_id, $exp_tag, $class_id, $det_type, $input_uri, $camera, $dbname, $workdir, $no_update, $no_op);
    3535GetOptions(
    3636    'det_id|d=s'        => \$det_id,
     
    4242    'dbname|d=s'        => \$dbname, # Database name
    4343    'workdir|w=s'       => \$workdir, # Working directory, for output files
    44     'no-update'         => \$no_update
     44    'no-update'         => \$no_update,
     45    'no-op'             => \$no_op,
    4546) or pod2usage( 2 );
    4647
     
    105106
    106107# Run ppImage
    107 {
     108my $stats = PS::IPP::Metadata::Stats->new(); # Stats parser
     109unless ($no_op) {
    108110    my $command = "$ppImage -file $input_uri $outputRoot -recipe PPIMAGE $recipe" .
    109111        " -stat $outputStats"; # Command to run ppImage
     
    118120    &my_die("Couldn't find expected output file: $outputBin1", $det_id, $exp_tag, $class_id, $PS_EXIT_SYS_ERROR) unless -f $outputBin1;
    119121    &my_die("Couldn't find expected output file: $outputBin2", $det_id, $exp_tag, $class_id, $PS_EXIT_SYS_ERROR) unless -f $outputBin2;
    120 }
    121122
    122 # Get the statistics on the processed image
    123 my $stats;                      # Statistics from ppImage
    124 {
     123    # Get the statistics on the processed image
    125124    my $statsFile;              # File handle
    126125    open $statsFile, "$outputStats" or die "Can't open statistics file $outputStats: $!\n";
     
    130129    my $metadata = $mdcParser->parse(join "", @contents)
    131130        or &my_die("Unable to parse metadata config", $det_id, $exp_tag, $class_id, $PS_EXIT_PROG_ERROR);
    132     $stats = PS::IPP::Metadata::Stats->new(); # Stats parser
    133131    $stats->parse($metadata) or &my_die("Unable to find all values in statistics output.", $det_id, $exp_tag, $class_id, $PS_EXIT_PROG_ERROR);
    134132}
     
    139137$outputBin2  = $ipprc->convert_filename_relative( $outputBin2  );
    140138
     139my $bg = ($stats->bg_mean() or 'NAN');
     140my $bg_stdev = ($stats->bg_stdev() or 'NAN');
     141my $bg_mean_stdev = ($stats->bg_mean_stdev() or 'NAN');
     142
    141143# Add the processed file to the database
    142144unless ($no_update) {
    143145    my $command = "$dettool -addprocessedimfile -det_id $det_id -exp_tag $exp_tag " .
    144146        "-class_id $class_id -recip $recipe -uri $outputImage -b1_uri $outputRoot";  # Command to run dettool
    145     $command .= " -bg " . $stats->bg_mean();
    146     if (defined($stats->bg_mean_stdev())) {
    147         $command .= " -bg_mean_stdev " . $stats->bg_mean_stdev();
    148     } else {
    149         # May be undefined if there's only a single imfile
    150         $command .= " -bg_mean_stdev 0";
    151     }
    152     $command .= " -bg_stdev " . $stats->bg_stdev();
     147    $command .= " -bg $bg -bg_stdev $bg_stdev -bg_mean_stdev $bg_mean_stdev";
    153148    $command .= " -dbname $dbname" if defined $dbname;
    154149
Note: See TracChangeset for help on using the changeset viewer.