Index: trunk/ippScripts/scripts/phase0exp.pl
===================================================================
--- trunk/ippScripts/scripts/phase0exp.pl	(revision 8309)
+++ trunk/ippScripts/scripts/phase0exp.pl	(revision 8327)
@@ -10,6 +10,6 @@
 use Data::Dumper;
 
-use constant TYPE => "OBSTYPE";	# Observation type keyword
-use constant DETRENDS => ( "bias", "dark", "flat", "fringe" ); # Observation types to mark as detrend
+use constant TYPE => "exp_type"; # Observation type keyword
+use constant DETRENDS => [ "bias", "dark", "flat", "fringe" ]; # Observation types to mark as detrend
 use constant DETREND_FLAG => "-detrend"; # Flag to use to mark detrend exposure
 
@@ -84,5 +84,5 @@
 	if (not defined $values{$constant}) {
 	    $values{$constant} = $value;
-	} elsif ($values{$constant} != $value) {
+	} elsif ($values{$constant} ne $value) {
 	    die "Value of $constant for " . $imfile->{PHASE0_CLASSID} .
 		" doesn't match previous value.\n";
@@ -120,5 +120,5 @@
     foreach my $variable (@{VARIABLES()}) {
 	my $array = $values{$variable};	# Array of values
-	my $stats = Statistics::Descriptive->new; # Statistics calculator
+	my $stats = Statistics::Descriptive::Sparse->new; # Statistics calculator
 	$stats->add_data(@$array);
 	$command .= " -" . $variable . " " . $stats->mean();
@@ -127,5 +127,5 @@
     # Add the statistics
     {
-	my $stats = Statistics::Descriptive->new; # Statistics calculator
+	my $stats = Statistics::Descriptive::Sparse->new; # Statistics calculator
 	$stats->add_data(@backgrounds);
 	$command .= " -" . PHASE0_BG() . " " . $stats->mean();
@@ -133,5 +133,5 @@
     }
     {
-	my $stats = Statistics::Descriptive->new; # Statistics calculator
+	my $stats = Statistics::Descriptive::Sparse->new; # Statistics calculator
 	$stats->add_data(@stdevs);
 	$command .= " -" . PHASE0_BG_MEAN_STDEV() . " " . $stats->mean();
@@ -146,9 +146,7 @@
     }
  
-    print "$command\n";
-   
-#    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;
+    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;
 }
 
