Changeset 17803 for trunk/ippScripts/scripts/register_exp.pl
- Timestamp:
- May 23, 2008, 5:10:21 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/register_exp.pl (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/register_exp.pl
r17671 r17803 30 30 'exp_id|e=s' => \$exp_id, 31 31 'exp_tag|t=s' => \$exp_tag, 32 'dbname|d=s' => \$dbname, # Database name 32 'dbname|d=s' => \$dbname, # Database name 33 33 'verbose' => \$verbose, # Print to stdout 34 34 'no-update' => \$no_update, … … 38 38 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 39 39 pod2usage( -msg => "Required options: --exp_id --exp_tag", 40 -exitval => 3) unless40 -exitval => 3) unless 41 41 defined $exp_id and 42 42 defined $exp_tag; … … 47 47 48 48 # values to extract from output metadata and the stats to calculate 49 my $STATS = 49 my $STATS = 50 50 [ # register imfile 51 51 # label STATISTIC CHIPTOOL FLAG … … 83 83 { name => "env_wind_dir", type => "constant", flag => "-env_wind_dir", dtype => "float" }, # external wind direction 84 84 85 { name => "-teltemp_m1", type => "constant", flag => "-teltemp_m1", dtype => "float" }, # Primary mirror temps (C) 86 { name => "-teltemp_m1cell", type => "constant", flag => "-teltemp_m1cell", dtype => "float" }, # Primary mirror support temps (C) 87 { name => "-teltemp_m2", type => "constant", flag => "-teltemp_m2", dtype => "float" }, # Secondary mirror temps (C 88 { name => "-teltemp_spider", type => "constant", flag => "-teltemp_spider", dtype => "float" }, # Spider temperatures (C) 89 { name => "-teltemp_truss", type => "constant", flag => "-teltemp_truss", dtype => "float" }, # Mid truss temperatures (C 90 { name => "-teltemp_extra", type => "constant", flag => "-teltemp_extra", dtype => "float" }, # Miscellaneous temperatures (C) 85 { name => "-teltemp_m1", type => "constant", flag => "-teltemp_m1", dtype => "float" }, # Primary mirror temps (C) 86 { name => "-teltemp_m1cell", type => "constant", flag => "-teltemp_m1cell", dtype => "float" }, # Primary mirror support temps (C) 87 { name => "-teltemp_m2", type => "constant", flag => "-teltemp_m2", dtype => "float" }, # Secondary mirror temps (C 88 { name => "-teltemp_spider", type => "constant", flag => "-teltemp_spider", dtype => "float" }, # Spider temperatures (C) 89 { name => "-teltemp_truss", type => "constant", flag => "-teltemp_truss", dtype => "float" }, # Mid truss temperatures (C 90 { name => "-teltemp_extra", type => "constant", flag => "-teltemp_extra", dtype => "float" }, # Miscellaneous temperatures (C) 91 91 92 92 { name => "pon_time", type => "mean", flag => "-pon_time", dtype => "float" }, # time since last power on … … 102 102 or (warn "can't find regtool" and $missing_tools = 1); 103 103 104 if ($missing_tools) { 104 if ($missing_tools) { 105 105 warn ("Can't find required tools"); 106 exit($PS_EXIT_CONFIG_ERROR); 106 exit($PS_EXIT_CONFIG_ERROR); 107 107 } 108 108 … … 120 120 cache_run(command => $command, verbose => $verbose); 121 121 unless ($success) { 122 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);122 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 123 123 warn ("Unable to perform regtool -processedimfile on exposure id $exp_id: $error_code"); 124 124 exit ($error_code); … … 148 148 $command .= " -exp_id $exp_id"; 149 149 $command .= " -exp_tag $exp_tag"; 150 $command .= " -hostname $host" if defined $host; 150 151 $command .= " -dbname $dbname" if defined $dbname; 151 152 $command .= $stats->cmdflags(); … … 155 156 # Add the detrend flag, if needed 156 157 { 157 my $object = 0; # Is it an object exposure?158 my $object = 0; # Is it an object exposure? 158 159 foreach my $scienceType (@SCIENCE) { 159 if (lc($exp_type) =~ /$scienceType/) {160 $object = 1;161 last;162 }160 if (lc($exp_type) =~ /$scienceType/) { 161 $object = 1; 162 last; 163 } 163 164 } 164 165 $command .= " $DETREND_FLAG" unless $object; … … 170 171 cache_run(command => $command, verbose => $verbose); 171 172 unless ($success) { 172 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);173 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 173 174 warn ("Unable to run regtool -addprocessedexp for $exp_id: $error_code"); 174 175 exit($error_code); … … 202 203 carp($msg); 203 204 if (defined $exp_id and not $no_update) { 204 my $command = "$regtool -addprocessedexp -exp_id $exp_id -code $exit_code"; 205 $command .= " -dbname $dbname" if defined $dbname; 205 my $command = "$regtool -addprocessedexp -exp_id $exp_id -code $exit_code"; 206 $command .= " -hostname $host" if defined $host; 207 $command .= " -dbname $dbname" if defined $dbname; 206 208 system($command); 207 209 }
Note:
See TracChangeset
for help on using the changeset viewer.
