Index: trunk/ippScripts/scripts/chip_imfile.pl
===================================================================
--- trunk/ippScripts/scripts/chip_imfile.pl	(revision 13926)
+++ trunk/ippScripts/scripts/chip_imfile.pl	(revision 13937)
@@ -29,6 +29,4 @@
 use Pod::Usage qw( pod2usage );
 
-my $RECIPE = 'PPIMAGE_OBDSFRA'; # Recipe to use
-
 # Parse the command-line arguments
 my ($exp_id,			# Exposure identifier
@@ -36,8 +34,8 @@
     $class_id,			# Class identifier
     $input,			# Input FITS file
-    $recipe,			# Recipe to use
     $camera,			# Camera
     $dbname,			# Database name
     $workdir,			# Working directory, for output files
+    $reduction,			# Reduction class
     $no_update,			# Don't update the database?
     $no_op,			# Don't do any operations?
@@ -48,8 +46,8 @@
 	   'class_id=s'    => \$class_id,
 	   'uri|u=s'       => \$input,
-	   'recipe=s'      => \$recipe,
 	   'camera|c=s'    => \$camera,
 	   'dbname|d=s'    => \$dbname, # Database name
 	   'workdir|w=s'   => \$workdir,
+	   'reduction=s'   => \$reduction,
 	   'no-update'     => \$no_update,
 	   'no-op'         => \$no_op,
@@ -67,4 +65,6 @@
 
 $ipprc->define_camera($camera);
+$reduction = 'DEFAULT' unless defined $reduction;
+my $recipe = $ipprc->reduction($reduction, 'CHIP'); # Recipe to use
 
 # Look for programs we need
@@ -97,5 +97,5 @@
 
     my $command = "$ppImage -file $input $outputRoot";
-    $command .= " -recipe PPIMAGE $RECIPE";
+    $command .= " -recipe PPIMAGE $recipe";
     $command .= " -recipe PPSTATS CHIPSTATS";
     $command .= " -stats $outputStats"; # Command to run ppImage
@@ -130,6 +130,6 @@
 my $bg_stdev = ($stats->bg_stdev() or 'NAN');
 my $bg_mean_stdev = ($stats->bg_mean_stdev() or 'NAN');
-my $fringe_0 	  = (${$stats->fringe()[0]} or 'NAN');
-my $fringe_1 	  = (${$stats->fringe_err()[0]} or 'NAN');
+my $fringe_0 	  = (${$stats->fringe()}[0] or 'NAN');
+my $fringe_1 	  = (${$stats->fringe_err()}[0] or 'NAN');
 my $fringe_2 	  = 'NAN';
 
