IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30912


Ignore:
Timestamp:
Mar 15, 2011, 4:50:08 PM (15 years ago)
Author:
heather
Message:

addtool minidvodb verification added

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/dbconfig/changes.txt

    r30314 r30912  
    19981998
    19991999ALTER TABLE pstampDataStore ADD COLUMN need_magic INT;
     2000
     2001
     2002--Version 1.1.67
     2003
     2004ALTER TABLE minidvodbProcessed add column dtime_verify FLOAT AFTER dtime_relphot;
     2005ALTER TABLE minidvodbProcessed add column dtime_script FLOAT AFTER dtime_merge;
  • trunk/dbconfig/minidvodb.md

    r29527 r30912  
    1414    dtime_resort    F32    0.0
    1515    dtime_relphot   F32    0.0
     16    dtime_verify    F32    0.0
    1617    dtime_merge     F32    0.0
     18    dtime_script    F32    0.0
    1719    epoch           UTC    0001-01-01T00:00:00Z
    1820    mergedvodb_path STR    255
  • trunk/ippScripts/scripts/minidvodb_merge.pl

    r28311 r30912  
    1616my $dtime_relphot;
    1717my $dtime_merge;
     18my $dtime_verify;
     19my $dtime_script;
    1820
    1921use vars qw( $VERSION );
     
    3638my $relphot = can_run('relphot') or (warn "Can't find relphot" and $missing_tools = 1);
    3739my $relastro = can_run('relastro') or (warn "Can't find relastro" and $missing_tools = 1);
     40my $dvoverify = can_run('dvoverify') or (warn "Can't find dvoverify" and $missing_tools = 1);
     41
     42
    3843if ($missing_tools) {
    3944    warn("Can't find required tools.");
     
    8792unless ($no_op) {
    8893    if (defined $mergedvodbReal) {
     94
     95        #this is chopped into several parts:  addstar, relphot, dvoverify, merge
     96
     97
     98        #addstar
    8999        {
    90100            my $command  = "$addstar -resort";
     
    105115            print "addstar -resort time $dtime_addstar\n";
    106116        }
     117
     118        #relphot
    107119
    108120        {
     
    124136            print "relphot time $dtime_relphot\n";
    125137        }
     138        #dvoverify
     139        {
     140            my $command  = "$dvoverify -s $minidvodb";
     141            print "$command\n";
     142            my $mjd_dvoverify_start = DateTime->now->mjd;   # MJD of starting script
     143
     144            my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     145                run(command => $command, verbose => $verbose);
     146            unless ($success) {
     147                $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     148                &my_die("Unable to perform dvoverify: $error_code", $mergedvodb, $error_code);
     149            }
     150            $dtime_dvoverify = 86400.0*(DateTime->now->mjd - $mjd_dvoverify_start);   # MJD of starting script
     151            print "dvoverify time $dtime_dvoverify\n";
     152        }
     153
     154
     155        #Merge
    126156
    127157        my $this_is_the_first;
     
    190220
    191221        {
     222
     223            $dtime_script = 86400.0*(DateTime->now->mjd - $mjd_start);
     224
     225
    192226            my $command = "addtool -minidvodb_id $minidvodb_id";
    193227            $command .= " -addminidvodbprocessed";
     
    197231            $command .= " -dtime_resort $dtime_resort" if defined $dtime_resort;
    198232            $command .= " -dtime_merge $dtime_merge" if defined $dtime_merge;
    199             $command .= " -dbname $dbname" if defined $dbname;
     233            $command .= " -dtime_script $dtime_script" if defined $dtime_script;
     234            $command .= " -dtime_verify $dtime_dvoverify" if defined $dtime_dvoverify;
     235            $command .= " -dbname $dbname" if defined $dbname;
    200236            #print $command;
    201237
     
    236272        $command .= " -dtime_resort $dtime_resort" if defined $dtime_resort;
    237273        $command .= " -dtime_merge $dtime_merge" if defined $dtime_merge;
     274    $command .= " -dtime_script $dtime_script" if defined $dtime_script;
     275    $command .= " -dtime_verify $dtime_dvoverify" if defined $dtime_dvoverify;
    238276        $command .= " -dbname $dbname" if defined $dbname;
    239277
  • trunk/ippTools/src/addtool.c

    r30907 r30912  
    11791179  PXOPT_LOOKUP_F32(dtime_resort, config->args, "-dtime_resort", false, false);
    11801180  PXOPT_LOOKUP_F32(dtime_merge, config->args, "-dtime_merge", false, false);
     1181  PXOPT_LOOKUP_F32(dtime_verify, config->args, "-dtime_verify", false, false);
     1182  PXOPT_LOOKUP_F32(dtime_script, config->args, "-dtime_script", false, false);
     1183 
    11811184  PXOPT_LOOKUP_TIME(epoch, config->args, "-epoch", false, false);
    11821185  PXOPT_LOOKUP_S16(fault,         config->args, "-fault", false, false);
     
    12301233               dtime_resort,
    12311234               dtime_relphot,
     1235               dtime_verify,
    12321236               dtime_merge,
     1237               dtime_script,
    12331238               epoch,
    12341239               mergedvodb_path,
     
    12931298  psStringAppend(&query4, "update minidvodbProcessed set merge_order = %"PRIu64,m_order);
    12941299  psStringAppend(&query4," where minidvodb_id = %" PRIu64,  minidvodb_id);
    1295   printf("%s", query4);
     1300  //printf("%s", query4);
    12961301  if (!p_psDBRunQuery(config->dbh, query4)) {
    12971302    // rollback
     
    15111516  PXOPT_LOOKUP_F32(dtime_resort,  config->args, "-set_dtime_resort", false, false);
    15121517  PXOPT_LOOKUP_F32(dtime_merge,  config->args, "-set_dtime_merge", false, false);
    1513 
     1518PXOPT_LOOKUP_F32(dtime_verify,  config->args, "-set_dtime_verify", false, false);
     1519PXOPT_LOOKUP_F32(dtime_script,  config->args, "-set_dtime_script", false, false);
    15141520  PXOPT_COPY_S64(config->args, where, "-minidvodb_id",     "minidvodbProcessed.minidvodb_id", "==");
    15151521  PXOPT_COPY_STR(config->args, where, "-minidvodb_name",     "minidvodbRun.minidvodb_name", "==");
     
    15621568    cnt++;
    15631569 }
     1570if (dtime_verify) {
     1571    if (cnt) {
     1572      psStringAppend(&query, "%s", comma);
     1573    }
     1574    psStringAppend(&query, " dtime_verify = %f", dtime_verify);
     1575    cnt++;
     1576 }
     1577if (dtime_script) {
     1578    if (cnt) {
     1579      psStringAppend(&query, "%s", comma);
     1580    }
     1581    psStringAppend(&query, " dtime_script = %f", dtime_script);
     1582    cnt++;
     1583 }
    15641584
    15651585  psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
     
    15671587
    15681588  if (!p_psDBRunQuery(config->dbh, query)) {
    1569    psError(PS_ERR_UNKNOWN, false, "database error");
     1589    psError(PS_ERR_UNKNOWN, false, "database error \n%s\n",query );
    15701590   psFree(query);
    15711591   return false;
  • trunk/ippTools/src/addtoolConfig.c

    r28211 r30912  
    195195    psMetadataAddF32(addminidvodbprocessedArgs, PS_LIST_TAIL, "-dtime_relphot",  0,    "define elapsed time for relphot (seconds)", NAN);
    196196    psMetadataAddF32(addminidvodbprocessedArgs, PS_LIST_TAIL, "-dtime_resort", 0,    "define elapsed time for resort (seconds)", NAN);
     197    psMetadataAddF32(addminidvodbprocessedArgs, PS_LIST_TAIL, "-dtime_verify",    0,    "define elapsed time for DVO verify (seconds)", NAN);
    197198    psMetadataAddF32(addminidvodbprocessedArgs, PS_LIST_TAIL, "-dtime_merge",    0,    "define elapsed time for DVO merge (seconds)", NAN);
     199    psMetadataAddF32(addminidvodbprocessedArgs, PS_LIST_TAIL, "-dtime_script",    0,    "define elapsed time for script (seconds)", NAN);
    198200    psMetadataAddTime(addminidvodbprocessedArgs, PS_LIST_TAIL, "-epoch",         0,    "time merge is finished", NULL);
    199201    psMetadataAddStr(addminidvodbprocessedArgs, PS_LIST_TAIL, "-mergedvodb_path",0,    "path of merged dvodb", NULL);
     
    220222    psMetadataAddF32(updateminidvodbprocessedArgs, PS_LIST_TAIL, "-set_dtime_relphot",  0,    "define elapsed time for relphot (seconds)", 0);
    221223    psMetadataAddF32(updateminidvodbprocessedArgs, PS_LIST_TAIL, "-set_dtime_resort", 0,    "define elapsed time for resort (seconds)", 0);
     224    psMetadataAddF32(updateminidvodbprocessedArgs, PS_LIST_TAIL, "-set_dtime_verify",    0,    "define elapsed time for DVO verify (seconds)", 0);
    222225    psMetadataAddF32(updateminidvodbprocessedArgs, PS_LIST_TAIL, "-set_dtime_merge",    0,    "define elapsed time for DVO merge (seconds)", 0);
    223    
     226    psMetadataAddF32(updateminidvodbprocessedArgs, PS_LIST_TAIL, "-set_dtime_script",    0,    "define elapsed time for script (seconds)", 0);
    224227    psMetadata *argSets = psMetadataAlloc();
    225228    psMetadata *modes = psMetadataAlloc();
Note: See TracChangeset for help on using the changeset viewer.