Index: trunk/ippScripts/scripts/ipp_serial_inject_mosaic.pl
===================================================================
--- trunk/ippScripts/scripts/ipp_serial_inject_mosaic.pl	(revision 12616)
+++ trunk/ippScripts/scripts/ipp_serial_inject_mosaic.pl	(revision 12617)
@@ -5,7 +5,7 @@
 
 use IPC::Cmd qw( can_run run );
-use PS::IPP::Metadata::Config;
-use PS::IPP::Metadata::List qw( parse_md_list );
+use PS::IPP::Config;
 use Data::Dumper;
+use File::Spec;
 
 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
@@ -14,20 +14,21 @@
 my ($camera,			# Camera used
     $telescope,			# Telescope used
-    $path,			# Path to use
+    $workdir,			# Working directory to append
     );
 GetOptions(
 	   'camera|c=s' => \$camera,
 	   'telescope|t=s' => \$telescope,
-	   'path=s' => \$path,
+	   'workdir=s' => \$workdir,
 ) or pod2usage( 2 );
 
 pod2usage(
-	  -msg => "Required options: --camera --telescope --path",
+	  -msg => "Required options: --camera --telescope --workdir",
 	  -exitval => 3,
-	  ) unless scalar @ARGV == 0 or (defined $camera
-					 and defined $telescope
-					 and defined $path);
+	  ) unless scalar @ARGV == 0 or ( defined $camera
+					  and defined $telescope
+					  and defined $workdir );
 
-my $mdcParser = PS::IPP::Metadata::Config->new;	# Metadata config parser
+my $ipprc = PS::IPP::Config->new(); # IPP configuration
+my $workdir_abs = $ipprc->convert_filename_absolute( $workdir );
 
 # Look for programs we need
@@ -56,5 +57,5 @@
 
     foreach my $exp ( @ARGV ) {
-	my $command = "$pxinject -newExp -exp_id $exp -inst $camera -telescope $telescope -workdir $path -imfiles " . (scalar @classes or 1) ; # Command to run
+	my $command = "$pxinject -newExp -exp_id $exp -inst $camera -telescope $telescope -workdir $workdir -imfiles " . (scalar @classes or 1) ; # Command to run
 	my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
 	    run( command => $command, verbose => 1 );
@@ -66,5 +67,6 @@
 	    my $filename = "$exp$class_id.fits";
 	    $filename = File::Spec->catfile( $exp, $filename ) if defined $add_dir;
-	    $filename = File::Spec->catfile( $path, $filename);
+	    $filename = File::Spec->catfile( $workdir_abs, $filename);
+	    $filename = $ipprc->convert_filename_relative( $filename );
 	    my $command = "$pxinject -newImfile -exp_tag $exp_tag -class chip -class_id $class_id -uri $filename"; # Command to run
 	    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
@@ -76,5 +78,6 @@
 	    my $filename = "$exp.fits";
 	    $filename = File::Spec->catfile( $exp, $filename ) if defined $add_dir;
-	    $filename = File::Spec->catfile( $path, $filename);
+	    $filename = File::Spec->catfile( $workdir_abs, $filename);
+	    $filename = $ipprc->convert_filename_relative( $filename );
 	    my $command = "$pxinject -newImfile -exp_tag $exp_tag -class fpa -class_id fpa -uri $filename"; # Command to run
 	    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
