IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 15, 2007, 4:56:47 PM (19 years ago)
Author:
Paul Price
Message:

Adding dbname and workdir options.

File:
1 edited

Legend:

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

    r11414 r11847  
    88use PS::IPP::Metadata::List qw( parse_md_list );
    99use Data::Dumper;
     10
     11my ($dbname,                    # Database name to use
     12    $workdir,                   # Working directory
     13    );
     14GetOptions(
     15           'dbname|d=s'  => \$dbname,
     16           'workdir|w=s' => \$workdir,
     17) or pod2usage( 2 );
     18
     19pod2usage(
     20          -msg => "Required options: --dbname",
     21          -exitval => 3,
     22          ) unless defined $dbname;
    1023
    1124my $mdcParser = PS::IPP::Metadata::Config->new; # Metadata config parser
     
    5366                my $camera = $item->{camera};
    5467               
    55                 my $command = "$detrend_process_imfile --det_id $det_id --exp_tag $exp_tag --class $class --class_id $class_id --det_type $det_type --input_uri $uri --camera $camera";
     68                my $command = "$detrend_process_imfile --det_id $det_id --exp_tag $exp_tag --class $class --class_id $class_id --det_type $det_type --input_uri $uri --camera $camera --dbname $dbname";
     69                $command .= " --workdir $workdir" if defined $workdir;
    5670                my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    5771                    run( command => $command, verbose => 1 );
     
    7993        my $det_id = $item->{det_id};
    8094
    81         my $command = "$detrend_process_exp --det_id $det_id --exp_tag $exp_tag --camera $camera";
     95        my $command = "$detrend_process_exp --det_id $det_id --exp_tag $exp_tag --camera $camera --dbname $dbname";
     96        $command .= " --workdir $workdir" if defined $workdir;
    8297        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    8398            run( command => $command, verbose => 1 );
     
    102117        my $camera = $item->{camera};
    103118
    104         my $command = "$detrend_stack --det_id $det_id --iteration $iteration --class_id $class_id --det_type $det_type --camera $camera";
     119        my $command = "$detrend_stack --det_id $det_id --iteration $iteration --class_id $class_id --det_type $det_type --camera $camera --dbname $dbname";
     120        $command .= " --workdir $workdir" if defined $workdir;
    105121        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    106122            run( command => $command, verbose => 1 );
     
    123139        my $det_type = $item->{det_type};
    124140
    125         my $command = "$detrend_norm_calc --det_id $det_id --iteration $iteration --det_type $det_type";
     141        my $command = "$detrend_norm_calc --det_id $det_id --iteration $iteration --det_type $det_type --dbname $dbname";
     142        $command .= " --workdir $workdir" if defined $workdir;
    126143        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    127144            run( command => $command, verbose => 1 );
     
    148165        my $camera = $item->{camera};
    149166
    150         my $command = "$detrend_norm_apply --det_id $det_id --iteration $iteration --class_id $class_id --value $value --input_uri $uri --camera $camera --det_type $det_type";
     167        my $command = "$detrend_norm_apply --det_id $det_id --iteration $iteration --class_id $class_id --value $value --input_uri $uri --camera $camera --det_type $det_type --dbname $dbname";
     168        $command .= " --workdir $workdir" if defined $workdir;
    151169        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    152170            run( command => $command, verbose => 1 );
     
    173191        my $camera = $item->{camera};
    174192
    175         my $command = "$detrend_norm_exp --det_id $det_id --iteration $iteration --camera $camera --det_type $det_type";
     193        my $command = "$detrend_norm_exp --det_id $det_id --iteration $iteration --camera $camera --det_type $det_type --dbname $dbname";
     194        $command .= " --workdir $workdir" if defined $workdir;
    176195        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    177196            run( command => $command, verbose => 1 );
     
    210229                my $mode = $item->{mode};
    211230
    212                 my $command = "$detrend_resid --det_id $det_id --iteration $iteration --exp_tag $exp_tag --class_id $class_id --det_type $det_type --camera $camera --input_uri $uri --mode $mode";
     231                my $command = "$detrend_resid --det_id $det_id --iteration $iteration --exp_tag $exp_tag --class_id $class_id --det_type $det_type --camera $camera --input_uri $uri --mode $mode --dbname $dbname";
    213232                $command .= " --detrend $detrend" if defined $detrend;
     233                $command .= " --workdir $workdir" if defined $workdir;
    214234
    215235                my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     
    240260        my $det_type = $item->{det_type};
    241261
    242         my $command = "$detrend_reject_imfile --det_id $det_id --iteration $iteration --exp_tag $exp_tag --det_type $det_type --camera $camera";
     262        my $command = "$detrend_reject_imfile --det_id $det_id --iteration $iteration --exp_tag $exp_tag --det_type $det_type --camera $camera --dbname $dbname";
     263        $command .= " --workdir $workdir" if defined $workdir;
    243264        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    244265            run( command => $command, verbose => 1 );
     
    262283        my $det_type = $item->{det_type};
    263284
    264         my $command = "$detrend_reject_exp --det_id $det_id --iteration $iteration --det_type $det_type --camera $camera";
     285        my $command = "$detrend_reject_exp --det_id $det_id --iteration $iteration --det_type $det_type --camera $camera --dbname $dbname";
     286        $command .= " --workdir $workdir" if defined $workdir;
    265287        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    266288            run( command => $command, verbose => 1 );
Note: See TracChangeset for help on using the changeset viewer.