IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 27, 2007, 5:28:59 PM (19 years ago)
Author:
Paul Price
Message:

Fixing up directories.

File:
1 edited

Legend:

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

    r12616 r12617  
    55
    66use IPC::Cmd qw( can_run run );
    7 use PS::IPP::Metadata::Config;
    8 use PS::IPP::Metadata::List qw( parse_md_list );
     7use PS::IPP::Config;
    98use Data::Dumper;
     9use File::Spec;
    1010
    1111use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
     
    1414my ($camera,                    # Camera used
    1515    $telescope,                 # Telescope used
    16     $path,                      # Path to use
     16    $workdir,                   # Working directory to append
    1717    );
    1818GetOptions(
    1919           'camera|c=s' => \$camera,
    2020           'telescope|t=s' => \$telescope,
    21            'path=s' => \$path,
     21           'workdir=s' => \$workdir,
    2222) or pod2usage( 2 );
    2323
    2424pod2usage(
    25           -msg => "Required options: --camera --telescope --path",
     25          -msg => "Required options: --camera --telescope --workdir",
    2626          -exitval => 3,
    27           ) unless scalar @ARGV == 0 or (defined $camera
    28                                          and defined $telescope
    29                                          and defined $path);
     27          ) unless scalar @ARGV == 0 or ( defined $camera
     28                                          and defined $telescope
     29                                          and defined $workdir );
    3030
    31 my $mdcParser = PS::IPP::Metadata::Config->new; # Metadata config parser
     31my $ipprc = PS::IPP::Config->new(); # IPP configuration
     32my $workdir_abs = $ipprc->convert_filename_absolute( $workdir );
    3233
    3334# Look for programs we need
     
    5657
    5758    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 run
     59        my $command = "$pxinject -newExp -exp_id $exp -inst $camera -telescope $telescope -workdir $workdir -imfiles " . (scalar @classes or 1) ; # Command to run
    5960        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    6061            run( command => $command, verbose => 1 );
     
    6667            my $filename = "$exp$class_id.fits";
    6768            $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 );
    6971            my $command = "$pxinject -newImfile -exp_tag $exp_tag -class chip -class_id $class_id -uri $filename"; # Command to run
    7072            my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     
    7678            my $filename = "$exp.fits";
    7779            $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 );
    7982            my $command = "$pxinject -newImfile -exp_tag $exp_tag -class fpa -class_id fpa -uri $filename"; # Command to run
    8083            my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
Note: See TracChangeset for help on using the changeset viewer.