Index: trunk/ippScripts/scripts/ipp_serial_inject_mosaic.pl
===================================================================
--- trunk/ippScripts/scripts/ipp_serial_inject_mosaic.pl	(revision 12613)
+++ trunk/ippScripts/scripts/ipp_serial_inject_mosaic.pl	(revision 12614)
@@ -14,5 +14,4 @@
 my ($camera,			# Camera used
     $telescope,			# Telescope used
-    $exp_type,			# Type of exposure
     $path,			# Path to use
     );
@@ -20,14 +19,12 @@
 	   'camera|c=s' => \$camera,
 	   'telescope|t=s' => \$telescope,
-	   'exp_type|e=s' => \$exp_type,
 	   'path=s' => \$path,
 ) or pod2usage( 2 );
 
 pod2usage(
-	  -msg => "Required options: --camera --telescope --exp_type --path",
+	  -msg => "Required options: --camera --telescope --path",
 	  -exitval => 3,
 	  ) unless scalar @ARGV == 0 or (defined $camera
 					 and defined $telescope
-					 and defined $exp_type
 					 and defined $path);
 
@@ -42,4 +39,5 @@
     my @classes;
     my $imfiles;
+    my $add_dir;		# Add directory name to get file name?
     if ($camera eq "MEGACAM") {
 	for (my $i = 0; $i < 36; $i++) {
@@ -52,4 +50,5 @@
     } elsif ($camera eq "TC3") {
 	@classes = ( '00', '01', '10', '11', '20', '21', '30', '31' );
+	$add_dir = 1;
     } else {
 	die "Unrecognised camera name: $camera.\n";
@@ -57,5 +56,5 @@
 
     foreach my $exp ( @ARGV ) {
-	my $command = "$pxinject -newExp -exp_id $exp -inst $camera -telescope $telescope -exp_type $exp_type -imfiles " . (scalar @classes or 1) ; # Command to run
+	my $command = "$pxinject -newExp -exp_id $exp -inst $camera -telescope $telescope -imfiles " . (scalar @classes or 1) ; # Command to run
 	my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
 	    run( command => $command, verbose => 1 );
@@ -65,5 +64,8 @@
 	my $exp_tag = $line[2];	# The exposure tag
 	foreach my $class_id (@classes) {
-	    my $command = "$pxinject -newImfile -exp_tag $exp_tag -class chip -class_id $class_id -uri $path/$exp$class_id.fits"; # Command to run
+	    my $filename = "$exp$class_id.fits";
+	    $filename = File::Spec->catfile( $exp, $filename ) if defined $add_dir;
+	    $filename = File::Spec->catfile( $path, $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 ) =
 		run( command => $command, verbose => 1 );
@@ -72,5 +74,8 @@
 
 	if (scalar @classes == 0) {
-	    my $command = "$pxinject -newImfile -exp_tag $exp_tag -class fpa -class_id fpa -uri $path/$exp.fits"; # Command to run
+	    my $filename = "$exp$class_id.fits";
+	    $filename = File::Spec->catfile( $exp, $filename ) if defined $add_dir;
+	    $filename = File::Spec->catfile( $path, $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 ) =
 		run( command => $command, verbose => 1 );
