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_imfile.pl

    r17671 r17803  
    5252
    5353# values to extract from output metadata and the stats to calculate
    54 my $STATS = 
    55    [   
     54my $STATS =
     55   [
    5656       #          PPSTATS KEYWORD         STATISTIC          CHIPTOOL FLAG
    5757       { name => "FILE.LEVEL",     type => "constant", flag => "-filelevel",       dtype => "string" }, # File level
     
    6969       { name => "FPA.TIME",       type => "constant", flag => "-dateobs",         dtype => "string" }, # Date of observation (UTC)
    7070       { name => "FPA.TELESCOPE",  type => "constant", flag => "-telescope",       dtype => "string" }, # Telescope
    71        { name => "FPA.INSTRUMENT", type => "constant", flag => "-inst",            dtype => "string" }, # Instrument 
     71       { name => "FPA.INSTRUMENT", type => "constant", flag => "-inst",            dtype => "string" }, # Instrument
    7272       { name => "FPA.M1X",        type => "constant", flag => "-m1_x",            dtype => "float"  }, # M1X
    7373       { name => "FPA.M1Y",        type => "constant", flag => "-m1_y",            dtype => "float"  }, # M1Y
     
    8585       { name => "FPA.ENV.DIR",    type => "constant", flag => "-env_wind_dir",    dtype => "float"  }, # external wind direction
    8686
    87        { name => "FPA.TELTEMP.M1",     type => "constant", flag => "-teltemp_m1",     dtype => "float"  }, # Primary mirror temps (C)           
    88        { name => "FPA.TELTEMP.M1CELL", type => "constant", flag => "-teltemp_m1cell", dtype => "float"  }, # Primary mirror support temps (C)   
    89        { name => "FPA.TELTEMP.M2",     type => "constant", flag => "-teltemp_m2",     dtype => "float"  }, # Secondary mirror temps (C         
    90        { name => "FPA.TELTEMP.SPIDER", type => "constant", flag => "-teltemp_spider", dtype => "float"  }, # Spider temperatures (C)           
    91        { name => "FPA.TELTEMP.TRUSS",  type => "constant", flag => "-teltemp_truss",  dtype => "float"  }, # Mid truss temperatures (C         
    92        { name => "FPA.TELTEMP.EXTRA",  type => "constant", flag => "-teltemp_extra",  dtype => "float"  }, # Miscellaneous temperatures (C)     
     87       { name => "FPA.TELTEMP.M1",     type => "constant", flag => "-teltemp_m1",     dtype => "float"  }, # Primary mirror temps (C)
     88       { name => "FPA.TELTEMP.M1CELL", type => "constant", flag => "-teltemp_m1cell", dtype => "float"  }, # Primary mirror support temps (C)
     89       { name => "FPA.TELTEMP.M2",     type => "constant", flag => "-teltemp_m2",     dtype => "float"  }, # Secondary mirror temps (C
     90       { name => "FPA.TELTEMP.SPIDER", type => "constant", flag => "-teltemp_spider", dtype => "float"  }, # Spider temperatures (C)
     91       { name => "FPA.TELTEMP.TRUSS",  type => "constant", flag => "-teltemp_truss",  dtype => "float"  }, # Mid truss temperatures (C
     92       { name => "FPA.TELTEMP.EXTRA",  type => "constant", flag => "-teltemp_extra",  dtype => "float"  }, # Miscellaneous temperatures (C)
    9393
    9494       { name => "FPA.PON.TIME",   type => "constant", flag => "-pon_time",        dtype => "float"  }, # time since last power on
     
    109109    or (warn "Can't find ppStats" and $missing_tools = 1);
    110110
    111 if ($missing_tools) { 
     111if ($missing_tools) {
    112112    warn ("Can't find required tools");
    113     exit($PS_EXIT_CONFIG_ERROR); 
     113    exit($PS_EXIT_CONFIG_ERROR);
    114114}
    115115
     
    130130    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    131131        cache_run(command => $command, verbose => $verbose);
    132     unless ($success) { 
     132    unless ($success) {
    133133        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    134134        &my_die ("Unable to perform ppStats on exposure id $exp_id: $error_code", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $error_code);
    135135    }
    136    
     136
    137137    # Parse the output
    138138    my $mdcParser = PS::IPP::Metadata::Config->new;        # Parser for metadata config files
     
    163163$command .= " -tmp_class_id $tmp_class_id"; # the original class_id supplied by the user, replace by ppStats CLASS.ID
    164164$command .= " -uri $uri ";
     165$command .= " -hostname $host" if defined $host;
    165166$command .= " -dbname $dbname" if defined $dbname;
    166167$command .= $stats->cmdflags();
     
    216217        $command .= " -exp_name $exp_name";
    217218        $command .= " -tmp_class_id $tmp_class_id";
    218         $command .= " -uri $uri ";
     219        $command .= " -uri $uri ";
    219220        $command .= " -telescope UNKNOWN";
    220221        $command .= " -inst UNKNOWN";
    221222        $command .= " -class_id $tmp_class_id";
    222223        $command .= " -code $exit_code";
     224        $command .= " -hostname $host" if defined $host;
    223225        $command .= " -dbname $dbname" if defined $dbname;
    224226        system ($command);
Note: See TracChangeset for help on using the changeset viewer.