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

    r11829 r11837  
    3333use Pod::Usage qw( pod2usage );
    3434
    35 my ($det_id, $exp_tag, $camera, $dbname, $workdir, $no_update);
     35my ($det_id, $exp_tag, $camera, $dbname, $workdir, $no_update, $no_op);
    3636GetOptions(
    3737    'det_id|d=s'        => \$det_id,
     
    4040    'dbname|d=s'        => \$dbname, # Database name
    4141    'workdir|w=s'       => \$workdir,   # Working directory, for output files
    42     'no-update'         => \$no_update
     42    'no-update'         => \$no_update,
     43    'no-op'             => \$no_op,
    4344) or pod2usage( 2 );
    4445
     
    102103        my $stats = Statistics::Descriptive::Sparse->new; # Statistics calculator
    103104        $stats->add_data(@backgrounds);
    104         $bg = $stats->mean();
    105         $bg_mean_stdev = $stats->standard_deviation() || 0.0;
     105        $bg = ($stats->mean() or 'NAN');
     106        $bg_mean_stdev = ($stats->standard_deviation() or 'NAN');
    106107    }
    107108    {
    108109        my $stats = Statistics::Descriptive::Sparse->new; # Statistics calculator
    109110        $stats->add_data(@variances);
    110         $bg_stdev = sqrt( $stats->mean() );
     111        $bg_stdev = (sqrt( $stats->mean() ) or 'NAN');
    111112    }
    112113}
     
    143144my $jpeg2 = $ipprc->filename("PPIMAGE.JPEG2", $outputRoot); # Binned JPEG #2
    144145
    145 # Make the jpeg for binning 1
    146 {
    147     my $command = "$ppImage -list $list1Name $outputRoot -recipe PPIMAGE " . RECIPE1; # Command to run
    148     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    149         run(command => $command, verbose => 1);
    150     unless ($success) {
    151         $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    152         &my_die("Unable to perform ppImage: $error_code", $det_id, $exp_tag, $error_code);
    153     }
    154     &my_die("Unable to find expected output file: $jpeg1", $det_id, $exp_tag, $PS_EXIT_SYS_ERROR) unless -f $jpeg1;
    155 }
    156 
    157 # Make the jpeg for binning 2
    158 {
    159     my $command = "$ppImage -list $list2Name $outputRoot -recipe PPIMAGE " . RECIPE2; # Command to run
    160     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    161         run(command => $command, verbose => 1);
    162     unless ($success) {
    163         $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    164         &my_die("Unable to perform ppImage: $error_code", $det_id, $exp_tag, $error_code);
    165     }
    166     &my_die("Unable to find expected output file: $jpeg2", $det_id, $exp_tag, $PS_EXIT_SYS_ERROR) unless -f $jpeg2;
    167 }
    168 
     146unless ($no_op) {
     147    # Make the jpeg for binning 1
     148    {
     149        my $command = "$ppImage -list $list1Name $outputRoot -recipe PPIMAGE " . RECIPE1; # Command to run
     150        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     151            run(command => $command, verbose => 1);
     152        unless ($success) {
     153            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     154            &my_die("Unable to perform ppImage: $error_code", $det_id, $exp_tag, $error_code);
     155        }
     156        &my_die("Unable to find expected output file: $jpeg1", $det_id, $exp_tag, $PS_EXIT_SYS_ERROR) unless -f $jpeg1;
     157    }
     158   
     159    # Make the jpeg for binning 2
     160    {
     161        my $command = "$ppImage -list $list2Name $outputRoot -recipe PPIMAGE " . RECIPE2; # Command to run
     162        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     163            run(command => $command, verbose => 1);
     164        unless ($success) {
     165            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     166            &my_die("Unable to perform ppImage: $error_code", $det_id, $exp_tag, $error_code);
     167        }
     168        &my_die("Unable to find expected output file: $jpeg2", $det_id, $exp_tag, $PS_EXIT_SYS_ERROR) unless -f $jpeg2;
     169    }
     170}
    169171
    170172# Add the result into the database
Note: See TracChangeset for help on using the changeset viewer.