IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 28211


Ignore:
Timestamp:
Jun 3, 2010, 7:11:23 PM (16 years ago)
Author:
heather
Message:

minidvodb tested. trying itout on MD05, 04 and 07 now.

Location:
trunk
Files:
7 edited

Legend:

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

    r28181 r28211  
    4848    'reduction=s'       => \$reduction, # Reduction class
    4949    'dvodb|w=s'         => \$dvodb,  # output DVO database
    50     'minidvodb'         => \$minidvodb,  # use minidvodb?
    5150    'minidvodb_name|w=s'=> \$minidvodb_name,  # miniDVO database name
    5251    'minidvodb_group|w=s' => \$minidvodb_group, # miniDVO database group
     52    'minidvodb'         => \$minidvodb,  # use minidvodb?
    5353    'image-only'        => \$image_only,   # Print to stdout
    5454    'verbose'           => \$verbose,   # Print to stdout
     
    104104if (defined $dvodb) {
    105105    $dvodbReal = $ipprc->dvo_catdir( $dvodb ); # catdir for DVO
    106     $dvodbReal = $ipprc->convert_filename_absolute( $dvodbReal );
    107 }
     106    $dvodbReal = $ipprc->convert_filename_absolute( $dvodbReal ) or &my_die("can't get path for dvodb", $add_id, $PS_EXIT_CONFIG_ERROR);
     107}
     108
     109
     110
    108111
    109112my $dtime_addstar = 0;
     
    179182$fpaCommand .= " -path_base $outroot";
    180183$fpaCommand .= " -dtime_addstar $dtime_addstar";
    181 $fpaCommand .= " -dvodb_path $dvodbReal";
     184$fpaCommand .= " -dvodb_path $dvodbReal" if defined $dvodbReal;
     185$fpaCommand .= " -minidvodb_name $minidvodb_name" if defined $minidvodb_name;
    182186$fpaCommand .= " -dbname $dbname" if defined $dbname;
    183187print $fpaCommand;
     
    212216        $command .= " -path_base $outroot" if defined $outroot;
    213217        $command .= (" -dtime_addstar " . ((DateTime->now->mjd - $mjd_start) * 86400));
     218        $fpaCommand .= " -minidvodb_name $minidvodb_name" if defined $minidvodb_name;
    214219        $command .= " -dbname $dbname" if defined $dbname;
    215220        system ($command);
  • trunk/ippScripts/scripts/minidvodb_merge.pl

    r28181 r28211  
    44use strict;
    55use Carp;
    6 
     6 
    77## report the program and machine
    88use Sys::Hostname;
     
    9090            my $command  = "$addstar -resort";
    9191            $command .= " -D CAMERA $camera";
    92             $command .= " -D CATDIR $mergedvodbReal";
     92            $command .= " -D CATDIR $minidvodb";
    9393
    9494            my $mjd_addstar_start = DateTime->now->mjd;   # MJD of starting script
    95 
     95            print "\n$command\n";
    9696            my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    9797                run(command => $command, verbose => $verbose);
     
    102102            $dtime_addstar = 86400.0*(DateTime->now->mjd - $mjd_addstar_start);  $dtime_resort = $dtime_addstar;
    103103            # MJD of starting script
     104            $dtime_resort = $dtime_addstar;
    104105            print "addstar -resort time $dtime_addstar\n";
    105106        }
     
    110111            my $command  = "$relphot -averages -update";
    111112            $command .= " -D CAMERA $relphot_camera";
    112             $command .= " -D CATDIR $mergedvodbReal";
    113 
     113            $command .= " -D CATDIR $minidvodb";
     114            print "$command\n";
    114115            my $mjd_relphot_start = DateTime->now->mjd;   # MJD of starting script
    115116
     
    129130            my $mdcParser = PS::IPP::Metadata::Config->new;
    130131
    131             my $command = "$addtool -listminidvodbrun -state mergedsdfsad -minidvodb_group " . $minidvodb_group;
     132            my $command = "$addtool -listminidvodbrun -state merged -minidvodb_group " . $minidvodb_group;
    132133            $command .= " -dbname $dbname" if defined $dbname;
    133134
     
    152153            }
    153154        }
     155        {
     156            if (!-e "$mergedvodb/Image.dat") {
     157                $this_is_the_first = 1; #the first time it copied maybe it failed? we want it to copy this time
     158       
     159            }
     160
     161        }
    154162
    155163        {
    156164            my $merge_command;
     165            my $mjd_merge_start = DateTime->now->mjd;   # MJD of starting script
    157166            if ($this_is_the_first) {
    158                 $merge_command = "cp -rp $minidvodb $mergedvodb"
    159             } else {
    160                 $merge_command = "$dvomerge $minidvodb into $mergedvodb"
    161             }
    162 
    163             my $mjd_merge_start = DateTime->now->mjd;   # MJD of starting script
    164 
    165             my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    166                 run(command => $merge_command, verbose => $verbose);
    167             unless ($success) {
    168                 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    169                 &my_die("Unable to merge: $error_code", $mergedvodb, $error_code);
    170             }
    171 
    172             $dtime_merge = 86400.0*(DateTime->now->mjd - $mjd_merge_start);   # MJD of starting script
    173             print "merge time $dtime_merge\n";
    174         }
    175 
    176 
    177         {
     167                $merge_command = "cp -rp $minidvodb/* $mergedvodb";
     168                print "$merge_command\n";
     169            } else {
     170                $merge_command = "$dvomerge $minidvodb into $mergedvodb";
     171            }
     172           
     173            print "\n$merge_command\n";
     174            my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     175                run(command => $merge_command, verbose => $verbose);
     176            unless ($success) {
     177                    $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     178                    &my_die("Unable to merge: $error_code", $mergedvodb, $error_code);
     179            }
     180               
     181            $dtime_merge = 86400.0*(DateTime->now->mjd - $mjd_merge_start);   # MJD of starting script
     182            print "merge time $dtime_merge\n";
     183#       }
     184        }
     185
     186        {
    178187            my $command = "addtool -minidvodb_id $minidvodb_id";
    179188            $command .= " -addminidvodbprocessed";
     
    181190            $command .= " -minidvodb_group $minidvodb_group";
    182191            $command .= " -dtime_relphot $dtime_relphot"  if defined $dtime_relphot;
    183             $command .= " -dtime_relphot $dtime_resort" if defined $dtime_resort;
    184             $command .= " -dtime_relphot $dtime_merge" if defined $dtime_merge;
     192            $command .= " -dtime_resort $dtime_resort" if defined $dtime_resort;
     193            $command .= " -dtime_merge $dtime_merge" if defined $dtime_merge;
    185194            $command .= " -dbname $dbname" if defined $dbname;
    186195            #print $command;
     
    220229        $command .= " -minidvodb_group $minidvodb_group";
    221230        $command .= " -dtime_relphot $dtime_relphot" if defined $dtime_relphot;
    222         $command .= " -dtime_relphot $dtime_resort" if defined $dtime_resort;
    223         $command .= " -dtime_relphot $dtime_merge" if defined $dtime_merge;
     231        $command .= " -dtime_resort $dtime_resort" if defined $dtime_resort;
     232        $command .= " -dtime_merge $dtime_merge" if defined $dtime_merge;
    224233        $command .= " -dbname $dbname" if defined $dbname;
    225234
  • trunk/ippTasks/addstar.pro

    r28181 r28211  
    171171    if ("$MINIDVODB" == "T")
    172172    $run = $run --minidvodb
    173     $run = $run --minidvodb_group
     173    $run = $run --minidvodb_group $MINIDVODB_GROUP
    174174        if (("$MINIDVODB_NAME" != "NULL") && ("$MINIDVODB_NAME" != "(null)"))
    175            $run = $run --minidvodb_name #have addstar_run.pl grab the 'active' name if it is NULL
     175           $run = $run --minidvodb_name $MINIDVODB_NAME #have addstar_run.pl grab the 'active' name if it is NULL
    176176        end
    177177    end
  • trunk/ippTasks/minidvodb.pro

    r28181 r28211  
    227227    end
    228228#using check as opposed to list because it sees if it is done with the addRun state yet. 
     229    book setword MINIDVODB $minidvodb_group STATE DONE
    229230    $run = addtool -checkminidvodbrunaddrun -state waiting
    230231    $run = $run -minidvodb_group $minidvodb_group
     
    369370      if ($MINIDVODB_DB >= $DB:n) set MINIDVODB_DB = 0
    370371    end
    371     #finds the minidvodbs in a state of 'to_be_merged'   
    372     $run = addtool -listminidvodbrun -state to_be_merged
     372    #finds the minidvodbs in a state of 'to_be_merged'
     373    book setword MINIDVODB_MERGE $minidvodb_group STATE DONE
     374    $run = addtool -listminidvodbrun -state to_be_merged -limit 1
    373375    $run = $run -minidvodb_group $minidvodb_group
    374376    if ($DB:n == 0)
     
    418420  periods      -poll $RUNPOLL
    419421  periods      -exec $RUNEXEC
    420   periods      -timeout 60
     422  periods      -timeout 20000
     423 
     424  #we only want one running at a time
     425
     426  host         local
     427  npending     1
    421428
    422429  task.exec
     
    447454      # save the DB name for the exit tasks
    448455      option $DB:$MINIDVODB_DB
    449       $run = $run -dbname $DB:$MINIDVODB_DB
     456      $run = $run --dbname $DB:$MINIDVODB_DB
    450457      $MINIDVODB_DB ++
    451458      if ($MINIDVODB_DB >= $DB:n) set MINIDVODB_DB = 0
     
    605612      end
    606613      book getpage MINIDVODB_ACTIVE 0 -var minidvodb_group -key STATE NEW
    607 
     614     
    608615      # Select different database
    609616      $MINIDVODB_DB ++
    610617      if ($MINIDVODB_DB >= $DB:n) set MINIDVODB_DB = 0
    611618    end
    612 
     619    book setword MINIDVODB_ACTIVE $minidvodb_group STATE DONE
    613620   
    614621    $run = addtool -listminidvodbrun -state new
  • trunk/ippTasks/survey.pro

    r28181 r28211  
    650650    end
    651651   
    652     $run = $run -definebyquery -destreaked -label $label -set_dvodb $dvodb -set_minidvodb_group $minidvodb_group
     652    $run = $run -definebyquery -destreaked -label $label -set_dvodb $dvodb -set_minidvodb_group $minidvodb_group -set_minidvodb -set_label $minidvodb_group
    653653    echo $run
    654654    command $run
  • trunk/ippTools/src/addtool.c

    r28193 r28211  
    136136    PXOPT_LOOKUP_STR(reduction,   config->args, "-set_reduction", false, false);
    137137    PXOPT_LOOKUP_STR(note,        config->args, "-set_note", false, false);
    138     PXOPT_LOOKUP_STR(minidvodb_name,        config->args, "-set_minidvodb_name", false, false);
    139     PXOPT_LOOKUP_STR(minidvodb_group,        config->args, "-set_minidvodb_group", false, false);
     138    PXOPT_LOOKUP_STR(minidvodb_name,  config->args, "-set_minidvodb_name", false, false);
     139    PXOPT_LOOKUP_STR(minidvodb_group, config->args, "-set_minidvodb_group", false, false);
    140140    PXOPT_LOOKUP_BOOL(image_only, config->args, "-image_only", false);
    141141    PXOPT_LOOKUP_BOOL(minidvodb,  config->args, "-set_minidvodb", false);
     
    405405    PXOPT_LOOKUP_F32(dtime_addstar, config->args, "-dtime_addstar", false, false);
    406406    PXOPT_LOOKUP_STR(dvodb_path, config->args, "-dvodb_path", false, false);
     407    PXOPT_LOOKUP_STR(minidvodb_name, config->args, "-minidvodb_name", false, false);
    407408    PXOPT_LOOKUP_S16(fault,         config->args, "-fault", false, false);
    408409
     
    470471        return false;
    471472    }
     473
     474    //if there is a minidvodb_name, set it in addRun (it's not known until it is processed)
     475    if (minidvodb_name) {
     476      psString setName = NULL;
     477      psStringAppend (&setName, "UPDATE addRun set minidvodb_name = '%s' where add_id = %" PRId64, minidvodb_name, row->add_id);
     478      if (!p_psDBRunQuery(config->dbh, setName)) {
     479        if (!psDBRollback(config->dbh)) {
     480          psError(PS_ERR_UNKNOWN, false, "database error");
     481        }
     482        psError(PS_ERR_UNKNOWN, false, "database error");
     483       
     484        return false;
     485      }
     486    }
     487
     488
     489
     490
    472491
    473492    // since there is only one exp per 'new' set addRun.state = 'full'
  • trunk/ippTools/src/addtoolConfig.c

    r28181 r28211  
    102102    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-path_base", 0,            "define base output location", NULL);
    103103     psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-dvodb_path", 0,            "define base output location", NULL);
     104      psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-minidvodb_name", 0,            "define minidvodb_name", NULL);
    104105    psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-dtime_addstar", 0, "define elapsed time for DVO insertion (seconds)", NAN);
    105106    psMetadataAddS16(addprocessedexpArgs, PS_LIST_TAIL, "-fault",  0,            "set fault code", 0);
Note: See TracChangeset for help on using the changeset viewer.