Index: trunk/ippScripts/scripts/camera_exp.pl
===================================================================
--- trunk/ippScripts/scripts/camera_exp.pl	(revision 16018)
+++ trunk/ippScripts/scripts/camera_exp.pl	(revision 16196)
@@ -37,5 +37,5 @@
 use Pod::Usage qw( pod2usage );
 
-my ($exp_tag, $cam_id, $recipe, $camera, $dbname, $workdir, $reduction, $dvodb, $no_update, $no_op);
+my ($exp_tag, $cam_id, $camera, $outroot, $recipe, $dbname, $reduction, $dvodb, $no_update, $no_op);
 GetOptions(
 	   'exp_tag=s'          => \$exp_tag, # Exposure identifier
@@ -44,5 +44,5 @@
 	   'camera|c=s'        => \$camera, # Camera
 	   'dbname|d=s'        => \$dbname, # Database name
-	   'workdir|w=s'       => \$workdir, # Working directory
+	   'outroot|w=s'       => \$outroot, # output file base name
 	   'reduction=s'       => \$reduction, # Reduction class		       
 	   'dvodb|w=s'         => \$dvodb,  # output DVO database
@@ -55,7 +55,9 @@
 	  -msg => "Required options: --exp_tag --cam_id --camera",
 	  -exitval => 3,
-	  ) unless defined $exp_tag
-    and defined $cam_id
-    and defined $camera;
+	  ) unless 
+    defined $exp_tag and
+    defined $cam_id and
+    defined $outroot and
+    defined $camera;
 
 $ipprc->define_camera($camera);
@@ -136,4 +138,5 @@
 }
 
+### not needed to have such an extensive temp file name.
 my ($list1File, $list1Name) = tempfile( "$exp_tag.cm.$cam_id.b1.list.XXXX", UNLINK => 1 ); # For binning 1
 my ($list2File, $list2Name) = tempfile( "$exp_tag.cm.$cam_id.b2.list.XXXX", UNLINK => 1 ); # For binning 2
@@ -162,13 +165,11 @@
 
 # Output products
-$workdir = caturi( $workdir, $exp_tag ) if defined $workdir;
-my $outputRoot = $ipprc->file_prepare( "$exp_tag.cm.$cam_id", $workdir, ${$files}[0]->{path_base} );
-
-my $jpeg1      = $ipprc->filename("PPIMAGE.JPEG1", $outputRoot); # Binned JPEG #1
-my $jpeg2      = $ipprc->filename("PPIMAGE.JPEG2", $outputRoot); # Binned JPEG #2
-my $fpaObjects = $ipprc->filename("PSASTRO.OUTPUT.MEF", $outputRoot); # MEF psastro output
-
-my $traceDest = 'file:' . $ipprc->file_resolve($outputRoot) . ".trace"; # Trace messages
-my $logDest = 'file:' . $ipprc->file_resolve($outputRoot) . ".log"; # Log messages
+$ipprc->outroot_prepare($outroot);
+
+my $jpeg1      = $ipprc->filename("PPIMAGE.JPEG1", 	$outroot) or &my_die("Missing entry from camera config", $cam_id, $PS_EXIT_CONFIG_ERROR);
+my $jpeg2      = $ipprc->filename("PPIMAGE.JPEG2", 	$outroot) or &my_die("Missing entry from camera config", $cam_id, $PS_EXIT_CONFIG_ERROR);
+my $fpaObjects = $ipprc->filename("PSASTRO.OUTPUT.MEF", $outroot) or &my_die("Missing entry from camera config", $cam_id, $PS_EXIT_CONFIG_ERROR);
+my $traceDest  = $ipprc->filename("TRACE.EXP",          $outroot) or &my_die("Missing entry from camera config", $cam_id, $PS_EXIT_CONFIG_ERROR);
+my $logDest    = $ipprc->filename("LOG.EXP", 	        $outroot) or &my_die("Missing entry from camera config", $cam_id, $PS_EXIT_CONFIG_ERROR);
 
 # convert supplied DVO database name to UNIX filename
@@ -184,5 +185,5 @@
     # Make the jpeg for binning 1
     {
-	my $command = "$ppImage -list $list1Name $outputRoot -recipe PPIMAGE $recipe1"; # Command to run
+	my $command = "$ppImage -list $list1Name $outroot -recipe PPIMAGE $recipe1"; # Command to run
 	my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
 	    run(command => $command, verbose => 1);
@@ -196,5 +197,5 @@
     # Make the jpeg for binning 2
     {
-	my $command = "$ppImage -list $list2Name $outputRoot -recipe PPIMAGE $recipe2"; # Command to run
+	my $command = "$ppImage -list $list2Name $outroot -recipe PPIMAGE $recipe2"; # Command to run
 	my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
 	    run(command => $command, verbose => 1);
@@ -229,5 +230,5 @@
 	    # XXX add a ppStats call which will collect the astrometry stats
 	    my $command;
-	    $command  = "$psastro -list $list3Name $outputRoot";
+	    $command  = "$psastro -list $list3Name $outroot";
 	    $command .= " +mosastro -chipastro";
 	    $command .= " -F PSASTRO.OUTPUT PSASTRO.OUTPUT.MEF";
@@ -276,5 +277,5 @@
 $fpaCommand .= " -cam_id $cam_id";
 $fpaCommand .= " -uri UNKNOWN";
-$fpaCommand .= " -path_base $outputRoot";
+$fpaCommand .= " -path_base $outroot";
 $fpaCommand .= " -dbname $dbname" if defined $dbname;
 $fpaCommand .= $chipStats->cmdflags();
