Index: /branches/eam_branch_20080618/ippScripts/scripts/detrend_norm_calc.pl
===================================================================
--- /branches/eam_branch_20080618/ippScripts/scripts/detrend_norm_calc.pl	(revision 18191)
+++ /branches/eam_branch_20080618/ippScripts/scripts/detrend_norm_calc.pl	(revision 18192)
@@ -81,5 +81,7 @@
 my @files;			# The input files
 {
-    my $command = "$dettool -processedimfile -det_id $det_id"; # Command to run
+    my $command = "$dettool -processedimfile";
+    $command .= " -det_id $det_id"; # Command to run
+    $command .= " -included"; # only use the inputs for this detrend run to calculate the norm
     $command .= " -dbname $dbname" if defined $dbname;
     my @command = split /\s+/, $command;
@@ -198,4 +200,15 @@
 } else {
     print "skipping command: $commandBase\n";
+    foreach my $normItem (@$norms) {
+
+	my $className = $normItem->{name}; # Name of component
+	my $normalisation = $normItem->{value}; # Normalisation for component
+
+	if ($normalisation == 0.0 or lc($normalisation) eq 'nan') {
+	    warn("Class $className has bad normalisation: $normalisation");
+	    exit($PS_EXIT_SYS_ERROR);
+	}
+	print "$className : $normalisation\n";
+    }
 }
 
