Changeset 28211
- Timestamp:
- Jun 3, 2010, 7:11:23 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
-
ippScripts/scripts/addstar_run.pl (modified) (4 diffs)
-
ippScripts/scripts/minidvodb_merge.pl (modified) (8 diffs)
-
ippTasks/addstar.pro (modified) (1 diff)
-
ippTasks/minidvodb.pro (modified) (5 diffs)
-
ippTasks/survey.pro (modified) (1 diff)
-
ippTools/src/addtool.c (modified) (3 diffs)
-
ippTools/src/addtoolConfig.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/addstar_run.pl
r28181 r28211 48 48 'reduction=s' => \$reduction, # Reduction class 49 49 'dvodb|w=s' => \$dvodb, # output DVO database 50 'minidvodb' => \$minidvodb, # use minidvodb?51 50 'minidvodb_name|w=s'=> \$minidvodb_name, # miniDVO database name 52 51 'minidvodb_group|w=s' => \$minidvodb_group, # miniDVO database group 52 'minidvodb' => \$minidvodb, # use minidvodb? 53 53 'image-only' => \$image_only, # Print to stdout 54 54 'verbose' => \$verbose, # Print to stdout … … 104 104 if (defined $dvodb) { 105 105 $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 108 111 109 112 my $dtime_addstar = 0; … … 179 182 $fpaCommand .= " -path_base $outroot"; 180 183 $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; 182 186 $fpaCommand .= " -dbname $dbname" if defined $dbname; 183 187 print $fpaCommand; … … 212 216 $command .= " -path_base $outroot" if defined $outroot; 213 217 $command .= (" -dtime_addstar " . ((DateTime->now->mjd - $mjd_start) * 86400)); 218 $fpaCommand .= " -minidvodb_name $minidvodb_name" if defined $minidvodb_name; 214 219 $command .= " -dbname $dbname" if defined $dbname; 215 220 system ($command); -
trunk/ippScripts/scripts/minidvodb_merge.pl
r28181 r28211 4 4 use strict; 5 5 use Carp; 6 6 7 7 ## report the program and machine 8 8 use Sys::Hostname; … … 90 90 my $command = "$addstar -resort"; 91 91 $command .= " -D CAMERA $camera"; 92 $command .= " -D CATDIR $m ergedvodbReal";92 $command .= " -D CATDIR $minidvodb"; 93 93 94 94 my $mjd_addstar_start = DateTime->now->mjd; # MJD of starting script 95 95 print "\n$command\n"; 96 96 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 97 97 run(command => $command, verbose => $verbose); … … 102 102 $dtime_addstar = 86400.0*(DateTime->now->mjd - $mjd_addstar_start); $dtime_resort = $dtime_addstar; 103 103 # MJD of starting script 104 $dtime_resort = $dtime_addstar; 104 105 print "addstar -resort time $dtime_addstar\n"; 105 106 } … … 110 111 my $command = "$relphot -averages -update"; 111 112 $command .= " -D CAMERA $relphot_camera"; 112 $command .= " -D CATDIR $m ergedvodbReal";113 113 $command .= " -D CATDIR $minidvodb"; 114 print "$command\n"; 114 115 my $mjd_relphot_start = DateTime->now->mjd; # MJD of starting script 115 116 … … 129 130 my $mdcParser = PS::IPP::Metadata::Config->new; 130 131 131 my $command = "$addtool -listminidvodbrun -state merged sdfsad-minidvodb_group " . $minidvodb_group;132 my $command = "$addtool -listminidvodbrun -state merged -minidvodb_group " . $minidvodb_group; 132 133 $command .= " -dbname $dbname" if defined $dbname; 133 134 … … 152 153 } 153 154 } 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 } 154 162 155 163 { 156 164 my $merge_command; 165 my $mjd_merge_start = DateTime->now->mjd; # MJD of starting script 157 166 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 script173 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 { 178 187 my $command = "addtool -minidvodb_id $minidvodb_id"; 179 188 $command .= " -addminidvodbprocessed"; … … 181 190 $command .= " -minidvodb_group $minidvodb_group"; 182 191 $command .= " -dtime_relphot $dtime_relphot" if defined $dtime_relphot; 183 $command .= " -dtime_re lphot $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; 185 194 $command .= " -dbname $dbname" if defined $dbname; 186 195 #print $command; … … 220 229 $command .= " -minidvodb_group $minidvodb_group"; 221 230 $command .= " -dtime_relphot $dtime_relphot" if defined $dtime_relphot; 222 $command .= " -dtime_re lphot $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; 224 233 $command .= " -dbname $dbname" if defined $dbname; 225 234 -
trunk/ippTasks/addstar.pro
r28181 r28211 171 171 if ("$MINIDVODB" == "T") 172 172 $run = $run --minidvodb 173 $run = $run --minidvodb_group 173 $run = $run --minidvodb_group $MINIDVODB_GROUP 174 174 if (("$MINIDVODB_NAME" != "NULL") && ("$MINIDVODB_NAME" != "(null)")) 175 $run = $run --minidvodb_name #have addstar_run.pl grab the 'active' name if it is NULL175 $run = $run --minidvodb_name $MINIDVODB_NAME #have addstar_run.pl grab the 'active' name if it is NULL 176 176 end 177 177 end -
trunk/ippTasks/minidvodb.pro
r28181 r28211 227 227 end 228 228 #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 229 230 $run = addtool -checkminidvodbrunaddrun -state waiting 230 231 $run = $run -minidvodb_group $minidvodb_group … … 369 370 if ($MINIDVODB_DB >= $DB:n) set MINIDVODB_DB = 0 370 371 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 373 375 $run = $run -minidvodb_group $minidvodb_group 374 376 if ($DB:n == 0) … … 418 420 periods -poll $RUNPOLL 419 421 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 421 428 422 429 task.exec … … 447 454 # save the DB name for the exit tasks 448 455 option $DB:$MINIDVODB_DB 449 $run = $run - dbname $DB:$MINIDVODB_DB456 $run = $run --dbname $DB:$MINIDVODB_DB 450 457 $MINIDVODB_DB ++ 451 458 if ($MINIDVODB_DB >= $DB:n) set MINIDVODB_DB = 0 … … 605 612 end 606 613 book getpage MINIDVODB_ACTIVE 0 -var minidvodb_group -key STATE NEW 607 614 608 615 # Select different database 609 616 $MINIDVODB_DB ++ 610 617 if ($MINIDVODB_DB >= $DB:n) set MINIDVODB_DB = 0 611 618 end 612 619 book setword MINIDVODB_ACTIVE $minidvodb_group STATE DONE 613 620 614 621 $run = addtool -listminidvodbrun -state new -
trunk/ippTasks/survey.pro
r28181 r28211 650 650 end 651 651 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 653 653 echo $run 654 654 command $run -
trunk/ippTools/src/addtool.c
r28193 r28211 136 136 PXOPT_LOOKUP_STR(reduction, config->args, "-set_reduction", false, false); 137 137 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); 140 140 PXOPT_LOOKUP_BOOL(image_only, config->args, "-image_only", false); 141 141 PXOPT_LOOKUP_BOOL(minidvodb, config->args, "-set_minidvodb", false); … … 405 405 PXOPT_LOOKUP_F32(dtime_addstar, config->args, "-dtime_addstar", false, false); 406 406 PXOPT_LOOKUP_STR(dvodb_path, config->args, "-dvodb_path", false, false); 407 PXOPT_LOOKUP_STR(minidvodb_name, config->args, "-minidvodb_name", false, false); 407 408 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 408 409 … … 470 471 return false; 471 472 } 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 472 491 473 492 // since there is only one exp per 'new' set addRun.state = 'full' -
trunk/ippTools/src/addtoolConfig.c
r28181 r28211 102 102 psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-path_base", 0, "define base output location", NULL); 103 103 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); 104 105 psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-dtime_addstar", 0, "define elapsed time for DVO insertion (seconds)", NAN); 105 106 psMetadataAddS16(addprocessedexpArgs, PS_LIST_TAIL, "-fault", 0, "set fault code", 0);
Note:
See TracChangeset
for help on using the changeset viewer.
