IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 24, 2008, 11:54:33 AM (18 years ago)
Author:
eugene
Message:

adding dvodb, tess, end_stage, etc; adding no-update; some cleanups

File:
1 edited

Legend:

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

    r15462 r16640  
    2424
    2525# Parse the command-line arguments
    26 my ($workdir, $dbname, $telescope, $camera, $reduction, $help);
    27 GetOptions(
    28     'workdir|w=s'    => \$workdir, # working directory for output files
    29     'dbname|d=s'     => \$dbname, # Database name
    30     'telescope|t=s'  => \$telescope, # user-supplied telescope name
    31     'camera|i=s'     => \$camera, # user-supplied camera name
    32     'reduction=s'    => \$reduction, # user-supplied camera name
    33     'help'           => \$help # give help listing
     26my ($camera, $telescope, $workdir, $reduction, $dvo_db, $tess_id, $end_stage, $label, $dbname, $no_op, $help);
     27GetOptions('camera|i=s'     => \$camera,    # user-supplied camera name
     28           'telescope|t=s'  => \$telescope, # user-supplied telescope name
     29           'workdir|w=s'    => \$workdir,   # working directory for output files
     30           'reduction=s'    => \$reduction, # user-supplied camera name
     31           'dvodb=s'        => \$dvo_db,    # target dvo database
     32           'tess_id=s'      => \$tess_id,   # tessalation for warping
     33           'end_stage=s'    => \$end_stage, # stop processing at this step
     34           'label=s'        => \$label,     # set chip label
     35           'dbname|d=s'     => \$dbname,    # Database name
     36           'no-op'          => \$no_op,     # pretend but don't actually inject
     37           'help'           => \$help       # give help listing
    3438) or pod2usage( 2 );
    3539
     
    3842    defined $help;
    3943
    40 pod2usage( -msg => "Usage: $0 --telescope (name) --camera (name) [--workdir path] [--dbname dbname] (files)",
     44pod2usage( -msg => "Usage: $0 --telescope (name) --camera (name) [--workdir path] [--reduction class] [--dvodb db] [--tess_id tess] [--end_stage stage] [--label label] [--dbname dbname] (files)",
    4145           -exitval => 2 ) if
    4246    scalar @ARGV == 0;
     
    8690    $command_exp .= " -tmp_telescope $telescope";
    8791    $command_exp .= " -workdir $workdir";
    88     $command_exp .= " -dbname $dbname" if defined $dbname;
    8992    $command_exp .= " -reduction $reduction" if defined $reduction;
     93    $command_exp .= " -dvo_db $dvo_db"       if defined $dvo_db;
     94    $command_exp .= " -tess_id $tess_id"     if defined $tess_id;
     95    $command_exp .= " -end_stage $end_stage" if defined $end_stage;
     96    $command_exp .= " -label $label"         if defined $label;
     97    $command_exp .= " -dbname $dbname"       if defined $dbname;
    9098
    91     my ( $success_exp, $error_code_exp, $full_buf_exp, $stdout_buf_exp, $stderr_buf_exp ) =
    92         run( command => $command_exp, verbose => 1 );
    93     die "Unable to inject $exp_name: $error_code_exp\n" if not $success_exp;
    94    
    95     my @line = split(/\s+/, $$stdout_buf_exp[0]); # The output line, containing the exposure tag
    96     my $exp_id = $line[2];      # The exposure tag
     99    my $exp_id = 0;
     100    unless ($no_op) {
     101        my ( $success_exp, $error_code_exp, $full_buf_exp, $stdout_buf_exp, $stderr_buf_exp ) =
     102            run( command => $command_exp, verbose => 1 );
     103        die "Unable to inject $exp_name: $error_code_exp\n" if not $success_exp;
     104       
     105        my @line = split(/\s+/, $$stdout_buf_exp[0]); # The output line, containing the exposure tag
     106        $exp_id = $line[2];     # The exposure tag
     107    } else {
     108        print "skipping command: $command_exp\n";
     109    }
    97110   
    98111    # the class_id used here is temporary : register replaces it with the true class_id
     
    103116    $command_imfile .= " -dbname $dbname" if defined ($dbname);
    104117   
    105     my ( $success_imfile, $error_code_imfile, $full_buf_imfile, $stdout_buf_imfile, $stderr_buf_imfile ) = run( command => $command_imfile, verbose => 1 );
    106     die "Unable to inject $exp_name imfile: $error_code_imfile\n" if not $success_imfile;
     118    unless ($no_op) {
     119        my ( $success_imfile, $error_code_imfile, $full_buf_imfile, $stdout_buf_imfile, $stderr_buf_imfile ) = run( command => $command_imfile, verbose => 1 );
     120        die "Unable to inject $exp_name imfile: $error_code_imfile\n" if not $success_imfile;
     121    } else {
     122        print "skipping command: $command_imfile\n";
     123    }
    107124
    108125    # the class_id used here is temporary : register replaces it with the true class_id
     
    112129    $command_update .= " -dbname $dbname" if defined ($dbname);
    113130   
    114     my ( $success_update, $error_code_update, $full_buf_update, $stdout_buf_update, $stderr_buf_update ) = run( command => $command_update, verbose => 1 );
    115     die "Unable to update $exp_name: $error_code_update\n" if not $success_update;
     131    unless ($no_op) {
     132        my ( $success_update, $error_code_update, $full_buf_update, $stdout_buf_update, $stderr_buf_update ) = run( command => $command_update, verbose => 1 );
     133        die "Unable to update $exp_name: $error_code_update\n" if not $success_update;
     134    } else {
     135        print "skipping command: $command_update\n";
     136    }
    116137
    117138    return 1;
Note: See TracChangeset for help on using the changeset viewer.