IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 5, 2008, 12:09:48 PM (18 years ago)
Author:
Paul Price
Message:

Adding -dbname for binaries. Probably not required for all of these, but it can't hurt (much).

File:
1 edited

Legend:

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

    r17671 r17943  
    4545pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    4646pod2usage( -msg => "Required options: --det_id --det_type --exp_id --exp_tag --camera --outroot",
    47            -exitval => 3) unless
    48     defined $det_id   and 
    49     defined $det_type and 
    50     defined $exp_id   and 
    51     defined $exp_tag  and 
     47           -exitval => 3) unless
     48    defined $det_id   and
     49    defined $det_type and
     50    defined $exp_id   and
     51    defined $exp_tag  and
    5252    defined $camera   and
    5353    defined $outroot;
     
    6868# XXX -bg_mean_stdev should take stdev of bg_mean if bg_mean_stdev == 0     (B)
    6969# XXX  (A) if imfile.Ncomp > 1, (B) if imfile.Ncomp == 1
    70 my $STATS = 
    71    [   
     70my $STATS =
     71   [
    7272       #          KEYWORD                 STATISTIC          CHIPTOOL FLAG
    7373       { name => "bg",             type => "mean",  flag => "-bg",            dtype => "float" },
     
    8282my $dettool = can_run('dettool') or (warn "Can't find dettool" and $missing_tools = 1);
    8383my $ppImage = can_run('ppImage') or (warn "Can't find ppImage" and $missing_tools = 1);
    84 if ($missing_tools) { 
     84if ($missing_tools) {
    8585    warn("Can't find required tools.");
    86     exit($PS_EXIT_CONFIG_ERROR); 
     86    exit($PS_EXIT_CONFIG_ERROR);
    8787}
    8888
     
    9393    $command .= " -dbname $dbname" if defined $dbname;
    9494    ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    95         run(command => $command, verbose => $verbose);
    96     unless ($success) {
    97         $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    98         &my_die("Unable to perform dettool -processedimfile: $error_code", $det_id, $exp_id, $error_code);
     95        run(command => $command, verbose => $verbose);
     96    unless ($success) {
     97        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     98        &my_die("Unable to perform dettool -processedimfile: $error_code", $det_id, $exp_id, $error_code);
    9999    }
    100100
    101101    # convert stdout to a metadata
    102     my $mdcParser = PS::IPP::Metadata::Config->new;     # Parser for metadata config files
     102    my $mdcParser = PS::IPP::Metadata::Config->new;     # Parser for metadata config files
    103103    my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
    104         &my_die("Unable to parse metadata config doc", $det_id, $exp_id, $PS_EXIT_PROG_ERROR);
     104        &my_die("Unable to parse metadata config doc", $det_id, $exp_id, $PS_EXIT_PROG_ERROR);
    105105
    106106    # parse the file info in the metadata
    107107    $files = parse_md_list($metadata) or
    108         &my_die("Unable to parse metadata list", $det_id, $exp_id, $PS_EXIT_PROG_ERROR);
     108        &my_die("Unable to parse metadata list", $det_id, $exp_id, $PS_EXIT_PROG_ERROR);
    109109
    110110    # parse the stats in the metadata
    111111    unless ($stats->parse($metadata)) {
    112         &my_die("Unable to find all values in statistics output.\n", $det_id, $exp_id, $PS_EXIT_PROG_ERROR);
     112        &my_die("Unable to find all values in statistics output.\n", $det_id, $exp_id, $PS_EXIT_PROG_ERROR);
    113113    }
    114114}
     
    138138    # Make the jpeg for binning 1
    139139    $command = "$ppImage -list $list1Name $outroot -recipe PPIMAGE $recipe1"; # Command to run
    140     ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    141         run(command => $command, verbose => $verbose);
    142     unless ($success) {
    143         $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    144         &my_die("Unable to perform ppImage: $error_code", $det_id, $exp_id, $error_code);
     140    $command .= " -dbname $dbname" if defined $dbname;
     141    ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     142        run(command => $command, verbose => $verbose);
     143    unless ($success) {
     144        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     145        &my_die("Unable to perform ppImage: $error_code", $det_id, $exp_id, $error_code);
    145146    }
    146147    &my_die("Unable to find expected output file: $jpeg1", $det_id, $exp_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($jpeg1);
    147    
     148
    148149    # Make the jpeg for binning 2
    149150    $command = "$ppImage -list $list2Name $outroot -recipe PPIMAGE $recipe2"; # Command to run
    150     ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    151         run(command => $command, verbose => $verbose);
    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_id, $error_code);
     151    $command .= " -dbname $dbname" if defined $dbname;
     152    ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     153        run(command => $command, verbose => $verbose);
     154    unless ($success) {
     155        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     156        &my_die("Unable to perform ppImage: $error_code", $det_id, $exp_id, $error_code);
    155157    }
    156158    &my_die("Unable to find expected output file: $jpeg2", $det_id, $exp_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($jpeg2);
     
    168170unless ($no_update) {
    169171    ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    170         run(command => $command, verbose => $verbose);
    171     unless ($success) {
    172         $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    173         warn("Unable to perform dettool -addprocessedexp: $error_code");
    174         exit($error_code);
     172        run(command => $command, verbose => $verbose);
     173    unless ($success) {
     174        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     175        warn("Unable to perform dettool -addprocessedexp: $error_code");
     176        exit($error_code);
    175177    }
    176178} else {
     
    181183{
    182184    my $msg = shift; # Warning message on die
    183     my $det_id = shift;         # Detrend identifier
     185    my $det_id = shift;         # Detrend identifier
    184186    my $exp_id = shift; # Exposure tag
    185187    my $exit_code = shift; # Exit code to add
     
    187189    carp($msg);
    188190    if (defined $det_id and defined $exp_id and not $no_update) {
    189         my $command = "$dettool -addprocessedexp";
    190         $command .= " -det_id $det_id";
    191         $command .= " -exp_id $exp_id";
    192         $command .= " -code $exit_code";
    193         $command .= " -dbname $dbname" if defined $dbname;
     191        my $command = "$dettool -addprocessedexp";
     192        $command .= " -det_id $det_id";
     193        $command .= " -exp_id $exp_id";
     194        $command .= " -code $exit_code";
     195        $command .= " -dbname $dbname" if defined $dbname;
    194196        system ($command);
    195197    }
Note: See TracChangeset for help on using the changeset viewer.