IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 16559


Ignore:
Timestamp:
Feb 21, 2008, 8:57:30 AM (18 years ago)
Author:
Paul Price
Message:

Fixing serial script to correspond to recent changes to the individual scripts.

File:
1 edited

Legend:

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

    r14959 r16559  
    77use Pod::Usage qw( pod2usage );
    88use IPC::Cmd 0.36 qw( can_run run );
    9 use PS::IPP::Metadata::Config;
     9use PS::IPP::Metadata::Config qw( caturi );
    1010use PS::IPP::Metadata::List qw( parse_md_list );
    1111use Data::Dumper;
    1212
    1313my ($dbname,                    # Database name to use
     14    $workdir_global             # Global working directory
    1415    );
    1516GetOptions(
     
    6869                my $reduction = $item->{reduction};
    6970
    70                 my $command = "$detrend_process_imfile --det_id $det_id --exp_tag $exp_tag --exp_id $exp_id --class_id $class_id --det_type $det_type --input_uri $uri --camera $camera --dbname $dbname";
     71                $workdir = $workdir_global unless defined $workdir and $workdir ne "NULL";
     72                die "No working directory specified.\n" unless defined $workdir;
     73
     74                my $outroot = caturi( $workdir, "$camera.$det_type.$det_id", $exp_tag, "$exp_tag.detproc.$det_id" );
     75
     76                my $command = "$detrend_process_imfile --det_id $det_id --exp_tag $exp_tag --exp_id $exp_id --class_id $class_id --det_type $det_type --input_uri $uri --camera $camera --dbname $dbname --outroot $outroot";
    7177                $command .= " --reduction $reduction" if defined $reduction;
    72                 $command .= " --workdir $workdir" if defined $workdir;
    7378                my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    7479                    run( command => $command, verbose => 1 );
     
    99104        my $workdir = $item->{workdir};
    100105
    101         my $command = "$detrend_process_exp --det_id $det_id --det_type $det_type --exp_tag $exp_tag --exp_id $exp_id --camera $camera --dbname $dbname";
    102         $command .= " --workdir $workdir" if defined $workdir;
     106        $workdir = $workdir_global unless defined $workdir and $workdir ne "NULL";
     107        die "No working directory specified.\n" unless defined $workdir;
     108       
     109        my $outroot = caturi( $workdir, "$camera.$det_type.$det_id", $exp_tag, "$exp_tag.detproc.$det_id" );
     110
     111        my $command = "$detrend_process_exp --det_id $det_id --det_type $det_type --exp_tag $exp_tag --exp_id $exp_id --camera $camera --dbname $dbname --outroot $outroot";
    103112        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    104113            run( command => $command, verbose => 1 );
     
    125134        my $reduction = $item->{reduction};
    126135
    127         my $command = "$detrend_stack --det_id $det_id --iteration $iteration --class_id $class_id --det_type $det_type --camera $camera --dbname $dbname";
     136        $workdir = $workdir_global unless defined $workdir and $workdir ne "NULL";
     137        die "No working directory specified.\n" unless defined $workdir;
     138       
     139        my $outroot = caturi( $workdir, "$camera.$det_type.$det_id", "$camera.$det_type.$det_id.$iteration" );
     140
     141        my $command = "$detrend_stack --det_id $det_id --iteration $iteration --class_id $class_id --det_type $det_type --camera $camera --dbname $dbname --outroot $outroot";
    128142        $command .= " --reduction $reduction" if defined $reduction;
    129         $command .= " --workdir $workdir" if defined $workdir;
    130143        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    131144            run( command => $command, verbose => 1 );
     
    147160        my $iteration = $item->{iteration};
    148161        my $det_type = $item->{det_type};
    149         my $workdir = $item->{workdir};
    150 
    151         my $command = "$detrend_norm_calc --det_id $det_id --iteration $iteration --det_type $det_type --dbname $dbname";
    152         $command .= " --workdir $workdir" if defined $workdir;
     162        my $camera = $item->{camera};
     163        my $workdir = $item->{workdir};
     164
     165        $workdir = $workdir_global unless defined $workdir and $workdir ne "NULL";
     166        die "No working directory specified.\n" unless defined $workdir;
     167       
     168        my $outroot = caturi( $workdir, "$camera.$det_type.$det_id", "$camera.$det_type.normstat.$det_id.$iteration" );
     169
     170        my $command = "$detrend_norm_calc --det_id $det_id --iteration $iteration --det_type $det_type --dbname $dbname --outroot $outroot";
    153171        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    154172            run( command => $command, verbose => 1 );
     
    176194        my $workdir = $item->{workdir};
    177195
    178         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";
    179         $command .= " --workdir $workdir" if defined $workdir;
     196        $workdir = $workdir_global unless defined $workdir and $workdir ne "NULL";
     197        die "No working directory specified.\n" unless defined $workdir;
     198       
     199        my $outroot = caturi( $workdir, "$camera.$det_type.$det_id", "$camera.$det_type.norm.$det_id.$iteration" );
     200
     201        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 --outroot $outroot";
    180202        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    181203            run( command => $command, verbose => 1 );
     
    203225        my $workdir = $item->{workdir};
    204226
    205         my $command = "$detrend_norm_exp --det_id $det_id --iteration $iteration --camera $camera --det_type $det_type --dbname $dbname";
    206         $command .= " --workdir $workdir" if defined $workdir;
     227        $workdir = $workdir_global unless defined $workdir and $workdir ne "NULL";
     228        die "No working directory specified.\n" unless defined $workdir;
     229       
     230        my $outroot = caturi( $workdir, "$camera.$det_type.$det_id", "$camera.$det_type.normexp.$det_id.$iteration" );
     231
     232        my $command = "$detrend_norm_exp --det_id $det_id --iteration $iteration --camera $camera --det_type $det_type --dbname $dbname --outroot $outroot";
    207233        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    208234            run( command => $command, verbose => 1 );
     
    244270                my $reduction = $item->{reduction};
    245271
    246                 my $command = "$detrend_resid --det_id $det_id --iteration $iteration --exp_tag $exp_tag --exp_id $exp_id --class_id $class_id --det_type $det_type --camera $camera --input_uri $uri --mode $mode --dbname $dbname";
     272                $workdir = $workdir_global unless defined $workdir and $workdir ne "NULL";
     273                die "No working directory specified.\n" unless defined $workdir;
     274               
     275                my $outroot = caturi( $workdir, "$camera.$det_type.$det_id", $exp_tag, "$exp_tag.detresid.$det_id.$iteration" );
     276               
     277                my $command = "$detrend_resid --det_id $det_id --iteration $iteration --exp_tag $exp_tag --exp_id $exp_id --class_id $class_id --det_type $det_type --camera $camera --input_uri $uri --mode $mode --dbname $dbname --outroot $outroot";
    247278                $command .= " --reduction $reduction" if defined $reduction;
    248279                $command .= " --detrend $detrend" if defined $detrend;
    249                 $command .= " --workdir $workdir" if defined $workdir;
    250280
    251281                my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     
    278308        my $workdir = $item->{workdir};
    279309
    280         my $command = "$detrend_reject_imfile --det_id $det_id --iteration $iteration --exp_tag $exp_tag --exp_id $exp_id --det_type $det_type --camera $camera --dbname $dbname";
    281         $command .= " --workdir $workdir" if defined $workdir;
     310        $workdir = $workdir_global unless defined $workdir and $workdir ne "NULL";
     311        die "No working directory specified.\n" unless defined $workdir;
     312       
     313        my $outroot = caturi( $workdir, "$camera.$det_type.$det_id", $exp_tag, "$exp_tag.detresid.$det_id.$iteration" );
     314       
     315        my $command = "$detrend_reject_imfile --det_id $det_id --iteration $iteration --exp_tag $exp_tag --exp_id $exp_id --det_type $det_type --camera $camera --dbname $dbname --outroot $outroot";
    282316        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    283317            run( command => $command, verbose => 1 );
     
    302336        my $workdir = $item->{workdir};
    303337
    304         my $command = "$detrend_reject_exp --det_id $det_id --iteration $iteration --det_type $det_type --camera $camera --dbname $dbname";
    305         $command .= " --workdir $workdir" if defined $workdir;
     338        $workdir = $workdir_global unless defined $workdir and $workdir ne "NULL";
     339        die "No working directory specified.\n" unless defined $workdir;
     340       
     341        my $outroot = caturi( $workdir, "$camera.$det_type.$det_id", "$camera.$det_type.$det_id.$iteration.detreject" );
     342       
     343        my $command = "$detrend_reject_exp --det_id $det_id --iteration $iteration --det_type $det_type --camera $camera --dbname $dbname --outroot $outroot";
    306344        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    307345            run( command => $command, verbose => 1 );
Note: See TracChangeset for help on using the changeset viewer.