Index: trunk/ippScripts/scripts/phase3.pl
===================================================================
--- trunk/ippScripts/scripts/phase3.pl	(revision 9524)
+++ trunk/ippScripts/scripts/phase3.pl	(revision 9892)
@@ -22,4 +22,5 @@
 GetOptions(
     'exp_tag|e=s'       => \$exp_tag,
+    'camera|c=s'        => \$camera,
     'no-update'         => \$no_update
 ) or pod2usage( 2 );
@@ -27,7 +28,10 @@
 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
 pod2usage(
-    -msg => "Required options: --exp_tag",
+    -msg => "Required options: --exp_tag --camera",
     -exitval => 3,
-) unless defined $exp_tag;
+) unless defined $exp_tag
+    and defined $camera;
+
+$ipprc->define_camera($camera);
 
 use constant RECIPE1 => 'PPIMAGE_J1'; # Recipe to use for ppImage to make JPEGs
@@ -110,6 +114,6 @@
 
 # Output products --- need to synch with the camera configuration!
-my $jpeg1Name = $outputRoot . ".b1.jpg"; # Binned JPEG #1
-my $jpeg2Name = $outputRoot . ".b2.jpg"; # Binned JPEG #2
+my $jpeg1 = $ipprc->filename("PPIMAGE.JPEG1", $outputRoot); # Binned JPEG #1
+my $jpeg2 = $ipprc->filename("PPIMAGE.JPEG2", $outputRoot); # Binned JPEG #2
 
 # Make the jpeg for binning 1
@@ -118,5 +122,5 @@
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
 	run(command => $command, verbose => 1);
-    die "Unable to find expected output file: $jpeg1Name\n" if not -f $jpeg1Name;
+    die "Unable to find expected output file: $jpeg1\n" if not -f $jpeg1;
 }
 
@@ -126,5 +130,5 @@
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
 	run(command => $command, verbose => 1);
-    die "Unable to find expected output file: $jpeg2Name\n" if not -f $jpeg2Name;
+    die "Unable to find expected output file: $jpeg2\n" if not -f $jpeg2;
 }
 
@@ -132,9 +136,9 @@
 # Add the result into the database
 $outputRoot = File::Spec->abs2rel( $outputRoot, $ipprc->workdir() );
-$jpeg1Name  = File::Spec->abs2rel( $jpeg1Name, $ipprc->workdir() );
-$jpeg2Name  = File::Spec->abs2rel( $jpeg2Name, $ipprc->workdir() );
+$jpeg1  = File::Spec->abs2rel( $jpeg1, $ipprc->workdir() );
+$jpeg2  = File::Spec->abs2rel( $jpeg2, $ipprc->workdir() );
 unless ($no_update) {
     my $command = "$p3tool -addprocessedexp -exp_tag $exp_tag -uri UNKNOWN " .
-	"-recip " . RECIPE1() . "," . RECIPE2() . " -b1_uri $jpeg1Name -b2_uri $jpeg2Name " .
+	"-recip " . RECIPE1() . "," . RECIPE2() . " -b1_uri $jpeg1 -b2_uri $jpeg2 " .
 	"-bg $bg -bg_stdev $bg_stdev -bg_mean_stdev $bg_mean_stdev " .
 	"-sigma_ra 0.0 -sigma_dec 0.0 -nastro 0 -zp_mean 0.0 -zp_stdev 0.0"; # Command to run
