Changeset 14039 for trunk/ippScripts/scripts/ipp_serial_inject_mosaic.pl
- Timestamp:
- Jul 5, 2007, 6:16:04 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/ipp_serial_inject_mosaic.pl
r13275 r14039 1 1 #!/usr/bin/env perl 2 3 # this program injects a set of multi-file exposures into the db. the 4 # program takes a list of base exposure names and injects all files 5 # associated with the exposure. It constructs the expected filenames 6 # from the exposure tag and rules for the camera. This program is for 7 # the test only since it requires too much information at the inject 8 # stage. use 'ipp_serial_inject.pl' for single-file images and 9 # 'ipp_serial_inject_split.pl' for multiple file images in split 10 # format 11 12 # this program should not fail because of the data format or the 13 # configuration, except for the very basic database setup. 2 14 3 15 use warnings; … … 75 87 } 76 88 77 foreach my $exp ( @ARGV ) { 78 my $command = "$pxinject -newExp -exp_id $exp -inst $camera -telescope $telescope -workdir $workdir -dbname $dbname -imfiles " . (scalar @classes or 1) ; # Command to run 89 foreach my $exp_name ( @ARGV ) { 90 my $command = "$pxinject -newExp"; 91 " -exp_name $exp_name"; 92 " -inst $camera"; 93 " -telescope $telescope"; 94 " -workdir $workdir"; 95 " -dbname $dbname" if defined $dbname; 96 " -imfiles " . (scalar @classes or 1) ; # Command to run 97 79 98 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 80 99 run( command => $command, verbose => 1 ); 81 die "Unable to inject $exp : $error_code\n" if not $success;100 die "Unable to inject $exp_name: $error_code\n" if not $success; 82 101 83 102 my @line = split(/\s+/, $$stdout_buf[0]); # The output line, containing the exposure tag 84 my $exp_ tag= $line[2]; # The exposure tag103 my $exp_id = $line[2]; # The exposure tag 85 104 for (my $i = 0; $i < scalar @classes; $i++) { 86 105 my $class_id = $classes[$i]; 87 106 my $file_id = $files[$i]; 88 my $filename = $exp . $file_id . '.fits';89 $filename = caturi( $exp , $filename ) if defined $add_dir;107 my $filename = $exp_name . $file_id . '.fits'; 108 $filename = caturi( $exp_name, $filename ) if defined $add_dir; 90 109 $filename = caturi( $path, $filename ); 91 110 … … 93 112 94 113 $filename = $ipprc->convert_filename_relative( $filename ); 95 my $command = "$pxinject -newImfile -exp_tag $exp_tag -class chip -class_id $class_id -uri $filename -dbname $dbname"; # Command to run 114 my $command = "$pxinject -newImfile"; 115 " -exp_id $exp_id"; 116 " -exp_name $exp_name"; 117 " -class chip"; 118 " -class_id $class_id"; 119 " -uri $filename"; 120 " -dbname $dbname" if defined ($dbname); # Command to run 121 96 122 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 97 123 run( command => $command, verbose => 1 );
Note:
See TracChangeset
for help on using the changeset viewer.
