Index: trunk/ippScripts/scripts/detrend_norm_calc.pl
===================================================================
--- trunk/ippScripts/scripts/detrend_norm_calc.pl	(revision 9095)
+++ trunk/ippScripts/scripts/detrend_norm_calc.pl	(revision 9097)
@@ -61,19 +61,19 @@
 my %matrix; # Matrix of statistics as a function of exposures and classes
 foreach my $file (@$files) {
-    my $expId = $file->{'exp_id'}; # Exposure ID
+    my $expTag = $file->{'exp_tag'}; # Exposure ID
     my $classId = $file->{'class_id'}; # Class ID
     my $stat = $file->{STATISTIC()}; # Statistic of interest
 
     # Create matrix elements
-    $matrix{$expId} = {} if not defined $matrix{$expId};
-    $matrix{$expId}->{$classId} = $stat;
+    $matrix{$expTag} = {} if not defined $matrix{$expId};
+    $matrix{$expTag}->{$classId} = $stat;
 }
 
 # Generate the input for ppNormCalc
 my $normData;			# Normalisation data
-foreach my $expId (keys %matrix) {
-    $normData .= "$expId\tMETADATA\n";
-    foreach my $classId (keys %{$matrix{$expId}}) {
-	$normData .= "\t" . $classId . "\tF32\t" . $matrix{$expId}->{$classId} . "\n";
+foreach my $expTag (keys %matrix) {
+    $normData .= "$expTag\tMETADATA\n";
+    foreach my $classId (keys %{$matrix{$expTag}}) {
+	$normData .= "\t" . $classId . "\tF32\t" . $matrix{$expTag}->{$classId} . "\n";
     }
     $normData .= "END\n\n";
Index: trunk/ippScripts/scripts/detrend_process_imfile.pl
===================================================================
--- trunk/ippScripts/scripts/detrend_process_imfile.pl	(revision 9095)
+++ trunk/ippScripts/scripts/detrend_process_imfile.pl	(revision 9097)
@@ -14,8 +14,8 @@
 use Pod::Usage qw( pod2usage );
 
-my ($det_id, $exp_id, $class, $class_id, $det_type, $input_uri, $output_uri, $no_update);
+my ($det_id, $exp_tag, $class, $class_id, $det_type, $input_uri, $output_uri, $no_update);
 GetOptions(
     'det_id|d=s'        => \$det_id,
-    'exp_id|e=s'        => \$exp_id,
+    'exp_tag|e=s'        => \$exp_tag,
     'class=s'           => \$class,     # unused
     'class_id|i=s'      => \$class_id,
@@ -27,8 +27,8 @@
 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
 pod2usage(
-    -msg => "Required options: --det_id --exp_id --class_id --det_type --input_uri",
+    -msg => "Required options: --det_id --exp_tag --class_id --det_type --input_uri",
     -exitval => 3,
 ) unless defined $det_id
-    and defined $exp_id
+    and defined $exp_tag
     and defined $class_id
     and defined $det_type
@@ -55,5 +55,5 @@
 
 ### Output file name --- must match camera configuration!
-my $outputRoot =  $exp_id . '.detproc.' . $det_id;
+my $outputRoot =  $exp_tag . '.detproc.' . $det_id;
 my $outputName = $outputRoot . '.' . $class_id ;
 my $outputImage = $outputName . '.fits';
@@ -87,5 +87,5 @@
 # Add the processed file to the database
 unless ($no_update) {
-    my $command = "$dettool -addprocessed -det_id $det_id -exp_id $exp_id " .
+    my $command = "$dettool -addprocessed -det_id $det_id -exp_tag $exp_tag " .
 	"-class_id $class_id -recip $recipe -uri $outputImage"; # Command to run dettool
     $command .= " -bg " . $stats->bg_mean();
@@ -100,5 +100,5 @@
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
 	run(command => $command, verbose => 1);
-    die "Unable to perform dettool -addprocessed for $det_id/$exp_id/$class_id: $error_code\n"
+    die "Unable to perform dettool -addprocessed for $det_id/$exp_tag/$class_id: $error_code\n"
 	if not $success;
 }
Index: trunk/ippScripts/scripts/detrend_reject_exp.pl
===================================================================
--- trunk/ippScripts/scripts/detrend_reject_exp.pl	(revision 9095)
+++ trunk/ippScripts/scripts/detrend_reject_exp.pl	(revision 9097)
@@ -73,14 +73,14 @@
 }
 
-my @expIds;			# Array of exposure IDs
+my @expTags;			# Array of exposure IDs
 my @means;			# Array of means
 my @stdevs;			# Array of stdevs
 my @meanStdevs;			# Array of mean stdevs
 foreach my $exposure (@$exposures) {
-    die "Unable to find exposure id.\n" if not defined $exposure->{exp_id};
+    die "Unable to find exposure id.\n" if not defined $exposure->{exp_tag};
     die "Unable to find mean.\n" if not defined $exposure->{bg};
     die "Unable to find stdev.\n" if not defined $exposure->{bg_stdev};
     die "Unable to find mean stdev.\n" if not defined $exposure->{bg_mean_stdev};
-    push @expIds, $exposure->{exp_id};
+    push @expTags, $exposure->{exp_tag};
     push @means, $exposure->{bg};
     push @stdevs, $exposure->{bg_stdev};
@@ -105,6 +105,6 @@
 my $numRejected = 0;		# Number of exposures rejected
 for (my $i = 0; $i < scalar @means; $i++) {
-    my $expId = $expIds[$i];	# Exposure ID
-    my $command = "$dettool -updateresidexp -det_id $det_id -iteration $iter -exp_id $expId"; # Command to run
+    my $expTag = $expTags[$i];	# Exposure ID
+    my $command = "$dettool -updateresidexp -det_id $det_id -iteration $iter -exp_tag $expTag"; # Command to run
     my $reject = 0;		# Reject this exposure?
     if (defined REJECT_MEAN->{$det_type} and
@@ -112,5 +112,5 @@
 	$meanStats->standard_deviation() > 0 and
 	($means[$i] - $meanStats->mean()) / $meanStats->standard_deviation() > REJECT_MEAN->{$det_type}) {
-	print "Rejecting $expId based on bad mean: " .
+	print "Rejecting $expTag based on bad mean: " .
 	    (($means[$i] - $meanStats->mean()) / $meanStats->standard_deviation()) .
 	    " vs " . REJECT_MEAN->{$det_type} . "\n";
@@ -121,5 +121,5 @@
 	     ($stdevs[$i] - $stdevStats->mean()) / $stdevStats->standard_deviation() >
 	     REJECT_STDEV->{$det_type}) {
-	print "Rejecting $expId based on bad stdev: " .
+	print "Rejecting $expTag based on bad stdev: " .
 	    (($stdevs[$i] - $stdevStats->mean()) / $stdevStats->standard_deviation()) .
 	    " vs " . REJECT_STDEV->{$det_type} . "\n";
@@ -130,5 +130,5 @@
 	     ($meanStdevs[$i] - $meanStdevStats->mean()) / $meanStdevStats->standard_deviation() >
 	     REJECT_MEAN_STDEV->{$det_type}) {
-	print "Rejecting $expId based on bad stdev: " .
+	print "Rejecting $expTag based on bad stdev: " .
 	    (($meanStdevs[$i] - $meanStdevStats->mean()) / $meanStdevStats->standard_deviation()) .
 	    " vs " . REJECT_MEAN_STDEV->{$det_type} . "\n";
Index: trunk/ippScripts/scripts/detrend_reject_imfile.pl
===================================================================
--- trunk/ippScripts/scripts/detrend_reject_imfile.pl	(revision 9095)
+++ trunk/ippScripts/scripts/detrend_reject_imfile.pl	(revision 9097)
@@ -15,9 +15,9 @@
 use Pod::Usage qw( pod2usage );
 
-my ($det_id, $iter, $exp_id, $det_type, $no_update);
+my ($det_id, $iter, $exp_tag, $det_type, $no_update);
 GetOptions(
     'det_id|d=s'        => \$det_id,
     'iteration=s'       => \$iter,
-    'exp_id|e=s'        => \$exp_id,
+    'exp_tag|e=s'        => \$exp_tag,
     'det_type|t=s'      => \$det_type,
     'no-update'         => \$no_update
@@ -26,9 +26,9 @@
 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
 pod2usage(
-    -msg => "Required options: --det_id --iteration --exp_id --det_type",
+    -msg => "Required options: --det_id --iteration --exp_tag --det_type",
     -exitval => 3,
 ) unless defined $det_id
     and defined $iter
-    and defined $exp_id
+    and defined $exp_tag
     and defined $det_type;
 
@@ -87,5 +87,5 @@
 my $files;			# Array of component files
 {
-    my $command = "$dettool -residimfile -det_id $det_id -iteration $iter -exp_id $exp_id"; # Command to run
+    my $command = "$dettool -residimfile -det_id $det_id -iteration $iter -exp_tag $exp_tag"; # Command to run
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
 	run(command => $command, verbose => 1);
@@ -97,5 +97,5 @@
 
 # Generate the file list, and get the statistics
-my $outputRoot = $exp_id . '.detresid.' . $det_id . '.' . $iter; # Root output name
+my $outputRoot = $exp_tag . '.detresid.' . $det_id . '.' . $iter; # Root output name
 my $list1Name = $outputRoot . '.b1.list'; # Name for the input file list for binning 1
 my $list2Name = $outputRoot . '.b2.list'; # Name for the input file list for binning 2
@@ -195,5 +195,5 @@
 # Add the result into the database
 unless ($no_update) {
-    my $command = "$dettool -addresidexp -det_id $det_id -iteration $iter -exp_id $exp_id " .
+    my $command = "$dettool -addresidexp -det_id $det_id -iteration $iter -exp_tag $exp_tag " .
 	"-recip " . RECIPE1() . "," . RECIPE2() . " -b1_uri $jpeg1Name -b2_uri $jpeg2Name " .
 	"-bg $mean -bg_stdev $stdev -bg_mean_stdev $meanStdev";	# Command to run
Index: trunk/ippScripts/scripts/detrend_resid.pl
===================================================================
--- trunk/ippScripts/scripts/detrend_resid.pl	(revision 9095)
+++ trunk/ippScripts/scripts/detrend_resid.pl	(revision 9097)
@@ -15,10 +15,10 @@
 use Pod::Usage qw( pod2usage );
 
-my ($det_id, $iter, $exp_id, $class_id, $det_type, $detrend,
+my ($det_id, $iter, $exp_tag, $class_id, $det_type, $detrend,
         $input_uri, $no_update);
 GetOptions(
     'det_id|d=s'        => \$det_id,
     'iteration=s'       => \$iter,
-    'exp_id|e=s'        => \$exp_id,
+    'exp_tag|e=s'        => \$exp_tag,
     'class_id|i=s'      => \$class_id,
     'det_type|t=s'      => \$det_type,
@@ -30,9 +30,9 @@
 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
 pod2usage(
-    -msg => "Required options: --det_id --iteration --exp_id --class_id --det_type --detrend --input_uri",
+    -msg => "Required options: --det_id --iteration --exp_tag --class_id --det_type --detrend --input_uri",
     -exitval => 3,
 ) unless defined $det_id
     and defined $iter
-    and defined $exp_id
+    and defined $exp_tag
     and defined $class_id
     and defined $det_type
@@ -71,5 +71,5 @@
 
 ### Output file names --- must match camera configuration!
-my $outputRoot = $exp_id . '.detresid.' . $det_id . '.' . $iter; # Root name
+my $outputRoot = $exp_tag . '.detresid.' . $det_id . '.' . $iter; # Root name
 my $outputName = $outputRoot . '.' . $class_id . '.fits'; # Name for 
 my $outputStats = $outputRoot . '.' . $class_id . '.stats';
@@ -106,5 +106,5 @@
 # Add the processed file to the database
 unless ($no_update) {
-    my $command = "$dettool -addresidimfile -det_id $det_id -iteration $iter -exp_id $exp_id " .
+    my $command = "$dettool -addresidimfile -det_id $det_id -iteration $iter -exp_tag $exp_tag " .
 	"-class_id $class_id -recip $recipe -uri $outputName -b1_uri $bin1Name " .
 	"-b2_uri $bin2Name"; # Command to run dettool
@@ -120,5 +120,5 @@
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
 	run(command => $command, verbose => 1);
-    die "Unable to perform dettool -addprocessed for $det_id/$exp_id/$class_id: $error_code\n"
+    die "Unable to perform dettool -addprocessed for $det_id/$exp_tag/$class_id: $error_code\n"
 	if not $success;
 }
Index: trunk/ippScripts/scripts/phase0exp.pl
===================================================================
--- trunk/ippScripts/scripts/phase0exp.pl	(revision 9095)
+++ trunk/ippScripts/scripts/phase0exp.pl	(revision 9097)
@@ -12,8 +12,8 @@
 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
 
-my ($expid, $no_update);
+my ($exptag, $no_update);
 
 GetOptions(
-    'exp_id|e=s'    => \$expid,
+    'exp_tag|e=s'    => \$exptag,
     'no-update'     => \$no_update
 ) or pod2usage( 2 );
@@ -21,7 +21,7 @@
 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
 pod2usage(
-    -msg => "Required options: --exp_id",
+    -msg => "Required options: --exp_tag",
     -exitval => 3,
-) unless defined $expid;
+) unless defined $exptag;
 
 # Define setup
@@ -73,8 +73,8 @@
 my $imfiles;
 {
-    my $command = "$p0tool -rawimfile -exp_id $expid";
+    my $command = "$p0tool -rawimfile -exp_tag $exptag";
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
         run(command => $command, verbose => 1);
-    die "Unable to perform p0tool on exposure id $expid: $error_code\n" if not $success;
+    die "Unable to perform p0tool on exposure id $exptag: $error_code\n" if not $success;
     my $metadata = $mdcParser->parse(join "", @$stdout_buf)
             or die "unable to parse metadata config doc";
@@ -117,5 +117,5 @@
 # Output results to the database
 unless ($no_update) {
-    my $command = "$p0tool -updateexp -exp_id $expid"; # Command to execute to update exposure parameters
+    my $command = "$p0tool -updateexp -exp_tag $exptag"; # Command to execute to update exposure parameters
     
     # Add the values of interest
@@ -157,5 +157,5 @@
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
         run(command => $command, verbose => 1);
-    die "Unable to run phase0 update for $expid: $error_code\n" if not $success;
+    die "Unable to run phase0 update for $exptag: $error_code\n" if not $success;
 }
 
Index: trunk/ippScripts/scripts/phase0imfile.pl
===================================================================
--- trunk/ippScripts/scripts/phase0imfile.pl	(revision 9095)
+++ trunk/ippScripts/scripts/phase0imfile.pl	(revision 9097)
@@ -15,8 +15,8 @@
 use Pod::Usage qw( pod2usage );
 
-my ($exp_id, $class_id, $uri, $no_update);
+my ($exp_tag, $class_id, $uri, $no_update);
 
 GetOptions(
-    'exp_id|e=s'    => \$exp_id,
+    'exp_tag|e=s'    => \$exp_tag,
     'class_id|i=s'  => \$class_id,
     'uri|u=s'       => \$uri,
@@ -26,7 +26,7 @@
 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
 pod2usage(
-    -msg => "Required options: --exp_id --class_id --uri",
+    -msg => "Required options: --exp_tag --class_id --uri",
     -exitval => 3,
-) unless defined $exp_id 
+) unless defined $exp_tag 
     and defined $class_id 
     and defined $uri;
@@ -60,5 +60,5 @@
 # Switches for p0tool
 use constant P0TOOL_MODE => '-updateimfile'; # Mode for p0tool
-use constant P0TOOL_EXPID => '-exp_id'; # Switch to specify the exposure id
+use constant P0TOOL_EXPTAG => '-exp_tag'; # Switch to specify the exposure id
 use constant P0TOOL_CLASSID => '-class_id'; # Switch to specify the class id
 use constant P0TOOL_BG_MEAN => '-bg'; # Switch to add the background
@@ -78,5 +78,5 @@
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
         run(command => $command, verbose => 1);
-    die "Unable to perform ppStats on exposure id $exp_id: $error_code\n" if not $success;
+    die "Unable to perform ppStats on exposure id $exp_tag: $error_code\n" if not $success;
     
     # Parse the output
@@ -92,5 +92,5 @@
 # Push the results into the database
 unless ($no_update) {
-    my $command = $p0tool . " " . P0TOOL_MODE() . " " . P0TOOL_EXPID() . " " . $exp_id . " " .
+    my $command = $p0tool . " " . P0TOOL_MODE() . " " . P0TOOL_EXPTAG() . " " . $exp_tag . " " .
         P0TOOL_CLASSID() . " " . $class_id; # Command to run p0tool
     
Index: trunk/ippScripts/scripts/phase2.pl
===================================================================
--- trunk/ippScripts/scripts/phase2.pl	(revision 9095)
+++ trunk/ippScripts/scripts/phase2.pl	(revision 9097)
@@ -18,5 +18,5 @@
 	"Usage: $0 EXP_ID CLASS_ID INPUT.fits OUTPUT_ROOT\n\n";
 }
-my $expId = shift @ARGV;	# Exposure ID
+my $expTag = shift @ARGV;	# Exposure ID
 my $classId = shift @ARGV;	# Class ID
 my $input = shift @ARGV;	# Input FITS file
@@ -65,5 +65,5 @@
     # Command to run dettool
     my $command = "$p2tool -processed";
-    $command .= " -exp_id $expId";
+    $command .= " -exp_tag $expTag";
     $command .= " -class_id $classId";
     $command .= " -recip " . RECIPE;
@@ -77,5 +77,5 @@
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
 	run(command => $command, verbose => 1);
-    die "Unable to perform p2tool -processed for $expId/$classId: $error_code\n"
+    die "Unable to perform p2tool -processed for $expTag/$classId: $error_code\n"
 	if not $success;
 }
