Changeset 12617
- Timestamp:
- Mar 27, 2007, 5:28:59 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/ipp_serial_inject_mosaic.pl
r12616 r12617 5 5 6 6 use IPC::Cmd qw( can_run run ); 7 use PS::IPP::Metadata::Config; 8 use PS::IPP::Metadata::List qw( parse_md_list ); 7 use PS::IPP::Config; 9 8 use Data::Dumper; 9 use File::Spec; 10 10 11 11 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); … … 14 14 my ($camera, # Camera used 15 15 $telescope, # Telescope used 16 $ path, # Path to use16 $workdir, # Working directory to append 17 17 ); 18 18 GetOptions( 19 19 'camera|c=s' => \$camera, 20 20 'telescope|t=s' => \$telescope, 21 ' path=s' => \$path,21 'workdir=s' => \$workdir, 22 22 ) or pod2usage( 2 ); 23 23 24 24 pod2usage( 25 -msg => "Required options: --camera --telescope -- path",25 -msg => "Required options: --camera --telescope --workdir", 26 26 -exitval => 3, 27 ) unless scalar @ARGV == 0 or ( defined $camera28 and defined $telescope29 and defined $path);27 ) unless scalar @ARGV == 0 or ( defined $camera 28 and defined $telescope 29 and defined $workdir ); 30 30 31 my $mdcParser = PS::IPP::Metadata::Config->new; # Metadata config parser 31 my $ipprc = PS::IPP::Config->new(); # IPP configuration 32 my $workdir_abs = $ipprc->convert_filename_absolute( $workdir ); 32 33 33 34 # Look for programs we need … … 56 57 57 58 foreach my $exp ( @ARGV ) { 58 my $command = "$pxinject -newExp -exp_id $exp -inst $camera -telescope $telescope -workdir $ path-imfiles " . (scalar @classes or 1) ; # Command to run59 my $command = "$pxinject -newExp -exp_id $exp -inst $camera -telescope $telescope -workdir $workdir -imfiles " . (scalar @classes or 1) ; # Command to run 59 60 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 60 61 run( command => $command, verbose => 1 ); … … 66 67 my $filename = "$exp$class_id.fits"; 67 68 $filename = File::Spec->catfile( $exp, $filename ) if defined $add_dir; 68 $filename = File::Spec->catfile( $path, $filename); 69 $filename = File::Spec->catfile( $workdir_abs, $filename); 70 $filename = $ipprc->convert_filename_relative( $filename ); 69 71 my $command = "$pxinject -newImfile -exp_tag $exp_tag -class chip -class_id $class_id -uri $filename"; # Command to run 70 72 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 76 78 my $filename = "$exp.fits"; 77 79 $filename = File::Spec->catfile( $exp, $filename ) if defined $add_dir; 78 $filename = File::Spec->catfile( $path, $filename); 80 $filename = File::Spec->catfile( $workdir_abs, $filename); 81 $filename = $ipprc->convert_filename_relative( $filename ); 79 82 my $command = "$pxinject -newImfile -exp_tag $exp_tag -class fpa -class_id fpa -uri $filename"; # Command to run 80 83 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
Note:
See TracChangeset
for help on using the changeset viewer.
