Index: /trunk/ippScripts/scripts/phase0_exp.pl
===================================================================
--- /trunk/ippScripts/scripts/phase0_exp.pl	(revision 11048)
+++ /trunk/ippScripts/scripts/phase0_exp.pl	(revision 11049)
@@ -52,5 +52,5 @@
 # These values should be constant for all components
 use constant CONSTANTS => [
-			   "object", # Object
+                           "object", # Object
                            "exp_type", # Exposure type
                            "filter", # Filter used
@@ -98,12 +98,12 @@
         cache_run(command => $command, verbose => 1);
     unless ($success) {
-	warn ("Unable to perform p0tool on exposure id $exptag: $error_code");
-	&my_die ($exptag, $error_code);
+        warn ("Unable to perform p0tool on exposure id $exptag: $error_code");
+        &my_die ($exptag, $error_code);
     }
 
     my $metadata = $mdcParser->parse(join "", @$stdout_buf);
     unless ($metadata) {
-	warn ("Unable to parse metadata config doc");
-	&my_die ($exptag, $PS_EXIT_PROG_ERROR);
+        warn ("Unable to parse metadata config doc");
+        &my_die ($exptag, $PS_EXIT_PROG_ERROR);
     }
     $imfiles = parse_md_list($metadata); # Data for imfiles
@@ -125,7 +125,7 @@
             $values{$constant} = $value;
         }
-	if ($values{$constant} ne $value) {
+        if ($values{$constant} ne $value) {
             warn ("Value of $constant for $imfile->{PHASE0_CLASSID} doesn't match previous value");
-	    &my_die ($exptag, $PS_EXIT_PROG_ERROR);
+            &my_die ($exptag, $PS_EXIT_PROG_ERROR);
         }
     }
@@ -154,9 +154,9 @@
 unless ($no_update) {
     my @command;
-    push @command, $p0tool, '-updateexp', '-exp_tag', $exptag; # Command to execute to update exposure parameters
+    push @command, $p0tool, '-addprocessedexp', '-exp_tag', $exptag; # Command to execute to update exposure parameters
     
     # Add the values of interest
     foreach my $constant (@{CONSTANTS()}) {
-	push @command, ( '-' . $constant ), $values{$constant};
+        push @command, ( '-' . $constant ), $values{$constant};
     }
     foreach my $variable (@{VARIABLES()}) {
@@ -164,5 +164,5 @@
         my $stats = Statistics::Descriptive::Sparse->new; # Statistics calculator
         $stats->add_data(@$array);
-	push @command, ( '-' . $variable ), $stats->mean();
+        push @command, ( '-' . $variable ), $stats->mean();
     }
 
@@ -171,11 +171,11 @@
         my $stats = Statistics::Descriptive::Sparse->new; # Statistics calculator
         $stats->add_data(@backgrounds);
-	push @command, ( '-' . PHASE0_BG() ), $stats->mean();
-	push @command, ( '-' . PHASE0_BG_MEAN_STDEV() ), ( $stats->standard_deviation() || 0 )
+        push @command, ( '-' . PHASE0_BG() ), $stats->mean();
+        push @command, ( '-' . PHASE0_BG_MEAN_STDEV() ), ( $stats->standard_deviation() || 0 )
     }
     {
         my $stats = Statistics::Descriptive::Sparse->new; # Statistics calculator
         $stats->add_data(@variances);
-	push @command, ( '-' . PHASE0_BG_STDEV() ), sqrt( $stats->mean() );
+        push @command, ( '-' . PHASE0_BG_STDEV() ), sqrt( $stats->mean() );
     }
     
@@ -183,5 +183,5 @@
     foreach my $detrendType (@{DETRENDS()}) {
         if (lc($values{TYPE()}) =~ /$detrendType/) {
-	    push @command, DETREND_FLAG;
+            push @command, DETREND_FLAG;
             last;
         }
@@ -190,7 +190,7 @@
     # Quote arguments with whitespace
     for (my $i = 0; $i < scalar @command; $i++) {
-	if ($command[$i] =~ /\s/) {
-	    $command[$i] = "\'$command[$i]\'";
-	}
+        if ($command[$i] =~ /\s/) {
+            $command[$i] = "\'$command[$i]\'";
+        }
     }
 
@@ -198,6 +198,6 @@
         cache_run(command => \@command, verbose => 1);
     unless ($success) {
-	warn ("Unable to run phase0 update for $exptag: $error_code");
-	&my_die ($exptag, $error_code);
+        warn ("Unable to run phase0 update for $exptag: $error_code");
+        &my_die ($exptag, $error_code);
     }
 }
@@ -213,6 +213,6 @@
 
     unless (defined $imfile->{$name}) {
-	warn ("Couldn't find value of $name for class_id=$source");
-	&my_die ($exptag, $PS_EXIT_PROG_ERROR);
+        warn ("Couldn't find value of $name for class_id=$source");
+        &my_die ($exptag, $PS_EXIT_PROG_ERROR);
     }
     return $imfile->{$name};
@@ -238,5 +238,5 @@
     my $exit_code = $_[1];
     if ($exp_tag) {
-	system ("$p0tool -faultexp -exp_tag $exp_tag -code $exit_code");
+        system ("$p0tool -faultexp -exp_tag $exp_tag -code $exit_code");
     }
     exit $exit_code;
