Index: trunk/ippScripts/scripts/ipp_simulation_data.pl
===================================================================
--- trunk/ippScripts/scripts/ipp_simulation_data.pl	(revision 13122)
+++ trunk/ippScripts/scripts/ipp_simulation_data.pl	(revision 13275)
@@ -13,12 +13,13 @@
 use Pod::Usage qw( pod2usage );
 use PS::IPP::Config qw(
-    $PS_EXIT_SUCCESS
-    $PS_EXIT_UNKNOWN_ERROR
-    $PS_EXIT_SYS_ERROR
-    $PS_EXIT_CONFIG_ERROR
-    $PS_EXIT_PROG_ERROR
-    $PS_EXIT_DATA_ERROR
-    $PS_EXIT_TIMEOUT_ERROR
-    );
+		       $PS_EXIT_SUCCESS
+		       $PS_EXIT_UNKNOWN_ERROR
+		       $PS_EXIT_SYS_ERROR
+		       $PS_EXIT_CONFIG_ERROR
+		       $PS_EXIT_PROG_ERROR
+		       $PS_EXIT_DATA_ERROR
+		       $PS_EXIT_TIMEOUT_ERROR
+		       caturi
+		       );
 
 my $ipprc = PS::IPP::Config->new(); # IPP configuration
@@ -28,4 +29,5 @@
     $telescope,			# Telesceope name
     $dbname,			# Database name
+    $path,			# Path to data
     $workdir,			# Working directory for data
     $no_update			# Don't update the database
@@ -37,4 +39,5 @@
 	   'telescope=s'   => \$telescope,
 	   'dbname=s'      => \$dbname,
+	   'path=s'        => \$path,
 	   'workdir=s'     => \$workdir,
 	   'no-update'     => \$no_update,
@@ -44,12 +47,14 @@
 
 pod2usage(
-          -msg => "Required options: --name --camera --telescope --dbname",
+          -msg => "Required options: --name --path --camera --telescope --dbname",
 	    -exitval => 3,
 	  ) unless
     defined $name and
+    defined $path and
     defined $camera and
     defined $telescope and
     defined $dbname;
 
+$workdir = $path if not defined $workdir;
 
 # Look for programs we need
@@ -64,6 +69,4 @@
     exit($PS_EXIT_CONFIG_ERROR); 
 }
-
-$workdir = $ipprc->convert_filename_absolute( $workdir );
 
 # Number of bias images
@@ -120,8 +123,8 @@
     my $basename;		# Output base filename
     ( $basename, $counter ) = filename( $name, $counter );
-    my $filename = File::Spec->catfile( $workdir, $basename ) if defined $workdir; # File name
+    my $filename = caturi( $path, $basename );
     run( command => "$ppSim -camera $camera -type BIAS $filename",
 	 verbose => 1 ) or die "Unable to run ppSim";
-    run( command => "$inject --camera $camera --telescope $telescope --workdir $workdir " .
+    run( command => "$inject --camera $camera --telescope $telescope --path $path --workdir $workdir " .
 	 "--dbname $dbname $basename",
 	 verbose => 1 ) or die "Unable to inject file.";
@@ -132,8 +135,8 @@
     my $basename;		# Output base filename
     ( $basename, $counter ) = filename( $name, $counter );
-    my $filename = File::Spec->catfile( $workdir, $basename ) if defined $workdir; # File name
+    my $filename = caturi( $path, $basename );
     run ( command => "$ppSim -camera $camera -type DARK -exptime $exptime $filename",
 	  verbose => 1 ) or die "Unable to run ppSim";
-    run( command => "$inject --camera $camera --telescope $telescope --workdir $workdir " .
+    run( command => "$inject --camera $camera --telescope $telescope --path $path --workdir $workdir " .
 	 "--dbname $dbname $basename",
 	 verbose => 1 ) or die "Unable to inject file.";
@@ -146,8 +149,8 @@
 	my $basename;		# Output base filename
 	( $basename, $counter ) = filename( $name, $counter );
-	my $filename = File::Spec->catfile( $workdir, $basename ) if defined $workdir; # File name
+	my $filename = caturi( $path, $basename );
 	run( command => "$ppSim -camera $camera -type FLAT -filter $filter -exptime $exptime $filename",
 	     verbose => 1 ) or die "Unable to run ppSim";
-        run( command => "$inject --camera $camera --telescope $telescope --workdir $workdir " .
+        run( command => "$inject --camera $camera --telescope $telescope --path $path --workdir $workdir " .
 	     "--dbname $dbname $basename",
 	     verbose => 1 ) or die "Unable to inject file.";
@@ -174,10 +177,10 @@
 	my $basename;		# Output base filename
 	( $basename, $counter ) = filename( $name, $counter );
-	my $filename = File::Spec->catfile( $workdir, $basename ) if defined $workdir; # File name
+	my $filename = caturi( $path, $basename );
 	run( command => "$ppSim -camera $camera -type OBJECT -filter $filter -exptime $exptime " .
 	     "-skyrate $sky -ra $ra -dec $dec -pa $pa -scale $scale -zp $zp -seeing $seeing $filename",
 	     verbose => 1 ) or die "Unable to run ppSim";
-	run( command => "$inject --camera $camera --telescope $telescope --workdir $workdir " .
-	     "--dbname $dbname $basename ",
+	run( command => "$inject --camera $camera --telescope $telescope --path $path --workdir $workdir " .
+	     "--dbname $dbname $basename",
 	     verbose => 1 ) or die "Unable to inject file.";
     }
@@ -199,6 +202,3 @@
 }
 
-
-
-
 __END__
