Changeset 16640
- Timestamp:
- Feb 24, 2008, 11:54:33 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/ipp_serial_inject.pl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/ipp_serial_inject.pl
r15462 r16640 24 24 25 25 # 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 26 my ($camera, $telescope, $workdir, $reduction, $dvo_db, $tess_id, $end_stage, $label, $dbname, $no_op, $help); 27 GetOptions('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 34 38 ) or pod2usage( 2 ); 35 39 … … 38 42 defined $help; 39 43 40 pod2usage( -msg => "Usage: $0 --telescope (name) --camera (name) [--workdir path] [-- dbname dbname] (files)",44 pod2usage( -msg => "Usage: $0 --telescope (name) --camera (name) [--workdir path] [--reduction class] [--dvodb db] [--tess_id tess] [--end_stage stage] [--label label] [--dbname dbname] (files)", 41 45 -exitval => 2 ) if 42 46 scalar @ARGV == 0; … … 86 90 $command_exp .= " -tmp_telescope $telescope"; 87 91 $command_exp .= " -workdir $workdir"; 88 $command_exp .= " -dbname $dbname" if defined $dbname;89 92 $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; 90 98 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 } 97 110 98 111 # the class_id used here is temporary : register replaces it with the true class_id … … 103 116 $command_imfile .= " -dbname $dbname" if defined ($dbname); 104 117 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 } 107 124 108 125 # the class_id used here is temporary : register replaces it with the true class_id … … 112 129 $command_update .= " -dbname $dbname" if defined ($dbname); 113 130 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 } 116 137 117 138 return 1;
Note:
See TracChangeset
for help on using the changeset viewer.
