Changeset 12614
- Timestamp:
- Mar 27, 2007, 5:18:07 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/ipp_serial_inject_mosaic.pl
r12613 r12614 14 14 my ($camera, # Camera used 15 15 $telescope, # Telescope used 16 $exp_type, # Type of exposure17 16 $path, # Path to use 18 17 ); … … 20 19 'camera|c=s' => \$camera, 21 20 'telescope|t=s' => \$telescope, 22 'exp_type|e=s' => \$exp_type,23 21 'path=s' => \$path, 24 22 ) or pod2usage( 2 ); 25 23 26 24 pod2usage( 27 -msg => "Required options: --camera --telescope -- exp_type --path",25 -msg => "Required options: --camera --telescope --path", 28 26 -exitval => 3, 29 27 ) unless scalar @ARGV == 0 or (defined $camera 30 28 and defined $telescope 31 and defined $exp_type32 29 and defined $path); 33 30 … … 42 39 my @classes; 43 40 my $imfiles; 41 my $add_dir; # Add directory name to get file name? 44 42 if ($camera eq "MEGACAM") { 45 43 for (my $i = 0; $i < 36; $i++) { … … 52 50 } elsif ($camera eq "TC3") { 53 51 @classes = ( '00', '01', '10', '11', '20', '21', '30', '31' ); 52 $add_dir = 1; 54 53 } else { 55 54 die "Unrecognised camera name: $camera.\n"; … … 57 56 58 57 foreach my $exp ( @ARGV ) { 59 my $command = "$pxinject -newExp -exp_id $exp -inst $camera -telescope $telescope - exp_type $exp_type -imfiles " . (scalar @classes or 1) ; # Command to run58 my $command = "$pxinject -newExp -exp_id $exp -inst $camera -telescope $telescope -imfiles " . (scalar @classes or 1) ; # Command to run 60 59 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 61 60 run( command => $command, verbose => 1 ); … … 65 64 my $exp_tag = $line[2]; # The exposure tag 66 65 foreach my $class_id (@classes) { 67 my $command = "$pxinject -newImfile -exp_tag $exp_tag -class chip -class_id $class_id -uri $path/$exp$class_id.fits"; # Command to run 66 my $filename = "$exp$class_id.fits"; 67 $filename = File::Spec->catfile( $exp, $filename ) if defined $add_dir; 68 $filename = File::Spec->catfile( $path, $filename); 69 my $command = "$pxinject -newImfile -exp_tag $exp_tag -class chip -class_id $class_id -uri $filename"; # Command to run 68 70 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 69 71 run( command => $command, verbose => 1 ); … … 72 74 73 75 if (scalar @classes == 0) { 74 my $command = "$pxinject -newImfile -exp_tag $exp_tag -class fpa -class_id fpa -uri $path/$exp.fits"; # Command to run 76 my $filename = "$exp$class_id.fits"; 77 $filename = File::Spec->catfile( $exp, $filename ) if defined $add_dir; 78 $filename = File::Spec->catfile( $path, $filename); 79 my $command = "$pxinject -newImfile -exp_tag $exp_tag -class fpa -class_id fpa -uri $filename"; # Command to run 75 80 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 76 81 run( command => $command, verbose => 1 );
Note:
See TracChangeset
for help on using the changeset viewer.
