Index: trunk/ippScripts/scripts/register_exp.pl
===================================================================
--- trunk/ippScripts/scripts/register_exp.pl	(revision 17671)
+++ trunk/ippScripts/scripts/register_exp.pl	(revision 17803)
@@ -30,5 +30,5 @@
     'exp_id|e=s'    => \$exp_id,
     'exp_tag|t=s'   => \$exp_tag,
-    'dbname|d=s'    => \$dbname, # Database name    
+    'dbname|d=s'    => \$dbname, # Database name
     'verbose'       => \$verbose,   # Print to stdout
     'no-update'     => \$no_update,
@@ -38,5 +38,5 @@
 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
 pod2usage( -msg => "Required options: --exp_id --exp_tag",
-	   -exitval => 3) unless
+           -exitval => 3) unless
     defined $exp_id and
     defined $exp_tag;
@@ -47,5 +47,5 @@
 
 # values to extract from output metadata and the stats to calculate
-my $STATS = 
+my $STATS =
    [   #          register imfile
        #          label             STATISTIC          CHIPTOOL FLAG
@@ -83,10 +83,10 @@
        { name => "env_wind_dir",    type => "constant",   flag => "-env_wind_dir",    dtype => "float"  }, # external wind direction
 
-       { name => "-teltemp_m1",     type => "constant",   flag => "-teltemp_m1",      dtype => "float"  }, # Primary mirror temps (C) 		
-       { name => "-teltemp_m1cell", type => "constant",   flag => "-teltemp_m1cell",  dtype => "float"  }, # Primary mirror support temps (C)   
-       { name => "-teltemp_m2",     type => "constant",   flag => "-teltemp_m2",      dtype => "float"  }, # Secondary mirror temps (C		
-       { name => "-teltemp_spider", type => "constant",   flag => "-teltemp_spider",  dtype => "float"  }, # Spider temperatures (C)  		
-       { name => "-teltemp_truss",  type => "constant",   flag => "-teltemp_truss",   dtype => "float"  }, # Mid truss temperatures (C		
-       { name => "-teltemp_extra",  type => "constant",   flag => "-teltemp_extra",   dtype => "float"  }, # Miscellaneous temperatures (C)     
+       { name => "-teltemp_m1",     type => "constant",   flag => "-teltemp_m1",      dtype => "float"  }, # Primary mirror temps (C)
+       { name => "-teltemp_m1cell", type => "constant",   flag => "-teltemp_m1cell",  dtype => "float"  }, # Primary mirror support temps (C)
+       { name => "-teltemp_m2",     type => "constant",   flag => "-teltemp_m2",      dtype => "float"  }, # Secondary mirror temps (C
+       { name => "-teltemp_spider", type => "constant",   flag => "-teltemp_spider",  dtype => "float"  }, # Spider temperatures (C)
+       { name => "-teltemp_truss",  type => "constant",   flag => "-teltemp_truss",   dtype => "float"  }, # Mid truss temperatures (C
+       { name => "-teltemp_extra",  type => "constant",   flag => "-teltemp_extra",   dtype => "float"  }, # Miscellaneous temperatures (C)
 
        { name => "pon_time",        type => "mean",       flag => "-pon_time",        dtype => "float"  }, # time since last power on
@@ -102,7 +102,7 @@
     or (warn "can't find regtool" and $missing_tools = 1);
 
-if ($missing_tools) { 
+if ($missing_tools) {
     warn ("Can't find required tools");
-    exit($PS_EXIT_CONFIG_ERROR); 
+    exit($PS_EXIT_CONFIG_ERROR);
 }
 
@@ -120,5 +120,5 @@
         cache_run(command => $command, verbose => $verbose);
     unless ($success) {
-	$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
         warn ("Unable to perform regtool -processedimfile on exposure id $exp_id: $error_code");
         exit ($error_code);
@@ -148,4 +148,5 @@
 $command .= " -exp_id $exp_id";
 $command .= " -exp_tag $exp_tag";
+$command .= " -hostname $host" if defined $host;
 $command .= " -dbname $dbname" if defined $dbname;
 $command .= $stats->cmdflags();
@@ -155,10 +156,10 @@
 # Add the detrend flag, if needed
 {
-    my $object = 0;		# Is it an object exposure?
+    my $object = 0;             # Is it an object exposure?
     foreach my $scienceType (@SCIENCE) {
-	if (lc($exp_type) =~ /$scienceType/) {
-	    $object = 1;
-	    last;
-	}
+        if (lc($exp_type) =~ /$scienceType/) {
+            $object = 1;
+            last;
+        }
     }
     $command .= " $DETREND_FLAG" unless $object;
@@ -170,5 +171,5 @@
         cache_run(command => $command, verbose => $verbose);
     unless ($success) {
-	$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
         warn ("Unable to run regtool -addprocessedexp for $exp_id: $error_code");
         exit($error_code);
@@ -202,6 +203,7 @@
     carp($msg);
     if (defined $exp_id and not $no_update) {
-	my $command = "$regtool -addprocessedexp -exp_id $exp_id -code $exit_code";
-	$command .= " -dbname $dbname" if defined $dbname;
+        my $command = "$regtool -addprocessedexp -exp_id $exp_id -code $exit_code";
+        $command .= " -hostname $host" if defined $host;
+        $command .= " -dbname $dbname" if defined $dbname;
         system($command);
     }
