IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 23, 2008, 5:10:21 PM (18 years ago)
Author:
Paul Price
Message:

Adding hostname to database values.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/register_exp.pl

    r17671 r17803  
    3030    'exp_id|e=s'    => \$exp_id,
    3131    'exp_tag|t=s'   => \$exp_tag,
    32     'dbname|d=s'    => \$dbname, # Database name   
     32    'dbname|d=s'    => \$dbname, # Database name
    3333    'verbose'       => \$verbose,   # Print to stdout
    3434    'no-update'     => \$no_update,
     
    3838pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    3939pod2usage( -msg => "Required options: --exp_id --exp_tag",
    40            -exitval => 3) unless
     40           -exitval => 3) unless
    4141    defined $exp_id and
    4242    defined $exp_tag;
     
    4747
    4848# values to extract from output metadata and the stats to calculate
    49 my $STATS = 
     49my $STATS =
    5050   [   #          register imfile
    5151       #          label             STATISTIC          CHIPTOOL FLAG
     
    8383       { name => "env_wind_dir",    type => "constant",   flag => "-env_wind_dir",    dtype => "float"  }, # external wind direction
    8484
    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)
    9191
    9292       { name => "pon_time",        type => "mean",       flag => "-pon_time",        dtype => "float"  }, # time since last power on
     
    102102    or (warn "can't find regtool" and $missing_tools = 1);
    103103
    104 if ($missing_tools) { 
     104if ($missing_tools) {
    105105    warn ("Can't find required tools");
    106     exit($PS_EXIT_CONFIG_ERROR); 
     106    exit($PS_EXIT_CONFIG_ERROR);
    107107}
    108108
     
    120120        cache_run(command => $command, verbose => $verbose);
    121121    unless ($success) {
    122         $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     122        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    123123        warn ("Unable to perform regtool -processedimfile on exposure id $exp_id: $error_code");
    124124        exit ($error_code);
     
    148148$command .= " -exp_id $exp_id";
    149149$command .= " -exp_tag $exp_tag";
     150$command .= " -hostname $host" if defined $host;
    150151$command .= " -dbname $dbname" if defined $dbname;
    151152$command .= $stats->cmdflags();
     
    155156# Add the detrend flag, if needed
    156157{
    157     my $object = 0;             # Is it an object exposure?
     158    my $object = 0;             # Is it an object exposure?
    158159    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        }
    163164    }
    164165    $command .= " $DETREND_FLAG" unless $object;
     
    170171        cache_run(command => $command, verbose => $verbose);
    171172    unless ($success) {
    172         $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     173        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    173174        warn ("Unable to run regtool -addprocessedexp for $exp_id: $error_code");
    174175        exit($error_code);
     
    202203    carp($msg);
    203204    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;
    206208        system($command);
    207209    }
Note: See TracChangeset for help on using the changeset viewer.