Changeset 36192 for branches/eam_branches/ipp-20130904/pstamp/scripts
- Timestamp:
- Oct 9, 2013, 4:06:09 PM (13 years ago)
- Location:
- branches/eam_branches/ipp-20130904/pstamp/scripts
- Files:
-
- 5 edited
-
. (modified) (1 prop)
-
psmkreq (modified) (2 diffs)
-
pstamp_checkdependent.pl (modified) (2 diffs)
-
pstamp_job_run.pl (modified) (6 diffs)
-
pstampparse.pl (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130904/pstamp/scripts
- Property svn:mergeinfo changed
/trunk/pstamp/scripts (added) merged: 36104,36126,36135,36142-36143,36165-36166,36182
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20130904/pstamp/scripts/psmkreq
r35438 r36192 177 177 $id = 0 if !$id; 178 178 179 unless ($stage eq 'raw' or $stage eq 'chip' or $stage eq 'warp' or $stage eq 'diff' or $stage eq 'stack') { 179 unless ($stage eq 'raw' or $stage eq 'chip' or $stage eq 'warp' or $stage eq 'diff' or $stage eq 'stack' 180 or $stage eq 'stack_summary') { 180 181 die "$stage is not a valid value for stage\n"; 181 182 } … … 208 209 $option_mask |= $PSTAMP_SELECT_PSF if $psf; 209 210 $option_mask |= $PSTAMP_SELECT_BACKMDL if $backmdl; 211 $option_mask |= $PSTAMP_SELECT_UNCOMPRESSED if $uncompressed; 210 212 $option_mask |= $PSTAMP_SELECT_UNCONV if $unconvolved; 211 213 $option_mask |= $PSTAMP_USE_IMFILE_ID if $use_imfile_id; -
branches/eam_branches/ipp-20130904/pstamp/scripts/pstamp_checkdependent.pl
r35937 r36192 304 304 } 305 305 $queued_update = 1; 306 } elsif ($chip->{state} eq 'cleaned' and $chip->{data_state} eq 'update') { 307 # we've had a number of runs in this limbo state 308 309 my $command = "$chiptool -updaterun -set_state update -chip_id $chip_id"; 310 $command .= " -set_label $rlabel" if $rlabel; 311 312 if (!$no_update) { 313 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 314 run(command => $command, verbose => $verbose); 315 unless ($success) { 316 my_die("failed to change ${stage}Run $stage_id $component from goto_cleaned to update", $PS_EXIT_UNKNOWN_ERROR); 317 } 318 } else { 319 print "skipping $command\n"; 320 } 321 $queued_update = 1; 306 322 } elsif ($chip->{fault}) { 307 323 $fault_count++; … … 460 476 print "skipping $command\n"; 461 477 } 478 } elsif ($chips_ready and $skycell->{data_state} eq 'update' and $skycell->{state} ne 'update') { 479 my $command = "$warptool -updaterun -warp_id $warp_id -set_state update"; 480 $command .= " -set_label $rlabel" if $rlabel; 481 482 if (!$no_update) { 483 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 484 run(command => $command, verbose => $verbose); 485 unless ($success) { 486 my_die("failed to change state of ${stage}Run $stage_id to update", $PS_EXIT_UNKNOWN_ERROR); 487 } 488 } else { 489 print "skipping $command\n"; 490 } 491 462 492 } elsif (scalar @chipsToUpdate > 0) { 463 493 my $fault = check_states_chip($chip_id, \@chipsToUpdate, $rlabel, $need_magic); -
branches/eam_branches/ipp-20130904/pstamp/scripts/pstamp_job_run.pl
r36059 r36192 236 236 $PSTAMP_SELECT_JPEG => 'jpg', 237 237 $PSTAMP_SELECT_EXP => 'exp.fits', 238 $PSTAMP_SELECT_NUM => 'num.fits'); 238 $PSTAMP_SELECT_NUM => 'num.fits', 239 $PSTAMP_SELECT_EXPJPEG => 'exp.jpg', 240 $PSTAMP_SELECT_NUMJPEG => 'num.jpg'); 239 241 240 242 my $output_mask = $options & ($PSTAMP_SELECT_IMAGE | $PSTAMP_SELECT_MASK | $PSTAMP_SELECT_VARIANCE 241 | $PSTAMP_SELECT_JPEG | $PSTAMP_SELECT_SOURCES | $PSTAMP_SELECT_EXP | $PSTAMP_SELECT_NUM); 243 | $PSTAMP_SELECT_JPEG | $PSTAMP_SELECT_SOURCES 244 | $PSTAMP_SELECT_EXP | $PSTAMP_SELECT_NUM 245 | $PSTAMP_SELECT_EXPJPEG | $PSTAMP_SELECT_NUMJPEG); 246 242 247 243 248 foreach my $key (keys (%extensions)) { … … 261 266 close $F; 262 267 $jobStatus = $PS_EXIT_SUCCESS; 263 } elsif ($exitStatus == $PSTAMP_NO_OVERLAP ) {264 $jobStatus = $ PSTAMP_NO_OVERLAP;268 } elsif ($exitStatus == $PSTAMP_NO_OVERLAP || $exitStatus == $PSTAMP_NO_VALID_PIXELS) { 269 $jobStatus = $exitStatus; 265 270 } else { 266 271 my_die( "ppstamp failed with error code: $exitStatus", $job_id, $exitStatus); … … 382 387 my $backmdl_file = $params->{backmdl} if ($options & $PSTAMP_SELECT_BACKMDL); 383 388 my $pattern_file = $params->{pattern} if ($options & $PSTAMP_SELECT_BACKMDL); 389 my $filter = $params->{filter}; 390 $filter = ' ' if !$filter; 391 $filter = substr $filter, 0, 1; 384 392 my $cmf_file; 385 393 # if ($stage ne 'chip') { … … 394 402 if (!$therest or !$rownum or !$jobnum); 395 403 396 my $prefix = "${rownum}_${jobnum}_"; 404 # XXX: Here we are assuming the form of the output file names 405 # if we change this in pstampparse we'll need to remember .... 406 # (the last time I forgot) 407 my $prefix = "${rownum}_${jobnum}_${filter}_"; 397 408 398 409 if ($cmf_file) { … … 573 584 $params->{exp} = $path_base . ".exp.b1.fits"; 574 585 $params->{num} = $path_base . ".num.b1.fits"; 586 $params->{expjpeg} = $path_base . ".exp.0.b1.jpeg"; 587 $params->{numjpeg} = $path_base . ".num.0.b1.jpeg"; 575 588 } 576 589 … … 632 645 if (!myCopy("$outputBase.num.fits", $params->{num}, 'num', 0)) { 633 646 $options &= ~$PSTAMP_SELECT_NUM; 647 } 648 } 649 if ($options & $PSTAMP_SELECT_EXPJPEG) { 650 if (!myCopy("$outputBase.exp.jpg", $params->{expjpeg}, 'exp', 0)) { 651 $options &= ~$PSTAMP_SELECT_EXPJPEG; 652 } 653 } 654 if ($options & $PSTAMP_SELECT_NUMJPEG) { 655 if (!myCopy("$outputBase.num.jpg", $params->{numjpeg}, 'num', 0)) { 656 $options &= ~$PSTAMP_SELECT_NUMJPEG; 634 657 } 635 658 } -
branches/eam_branches/ipp-20130904/pstamp/scripts/pstampparse.pl
r36061 r36192 31 31 my $no_update; 32 32 my $dest_requires_magic; 33 my $dump_params = 0; 33 34 34 35 # set this to true to disable update processing … … 48 49 'save-temps'=> \$save_temps, 49 50 'no-update' => \$no_update, 51 'dump-params' => \$dump_params, 50 52 ); 51 53 … … 238 240 239 241 242 # if label is for one of the high priority channels, watch for big requests 243 my $watch_for_big_requests = (!($label =~ /BIG/) and ($label =~ /PSI/ or $label =~ /WEB/)); 244 245 my $big_limit = 100; # XXX: this should be in a configuration file somewhere not hard coded 246 247 if ($watch_for_big_requests and $nRows > $big_limit) { 248 $label = change_to_lower_priority_label($label); 249 $watch_for_big_requests = 0; 250 } 240 251 241 252 my $num_jobs = 0; 242 my $imageList; 243 my $stage; 244 my $big_limit = 100; # XXX: this should be in a configuration file some where 253 245 254 foreach my $row (@$rows) { 246 247 248 if (!($label =~ /BIG/) and ($label =~ /PSI/ or $label =~ /WEB/) and ($nRows > $big_limit or $num_jobs > $big_limit)249 and $req_id and !$no_update) {250 251 # This is a "big" request and it came from one of the "high priority" channels252 # and doesn't have a specific label assigned.253 # Change the label to a value that its jobs run with lower priority.254 255 my $old_label = $label;256 $label = ($label =~ /WEB/) ? 'WEB.BIG' : 'PSI.BIG';257 print "\nChanging label for big $old_label request to $label\n";258 259 my $command = "$pstamptool -updatereq -req_id $req_id -set_label $label";260 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =261 run(command => $command, verbose => $verbose);262 unless ($success) {263 my_die("$command failed", $PS_EXIT_UNKNOWN_ERROR);264 }265 }266 255 267 256 # validate the paramaters … … 276 265 277 266 $num_jobs += processRow($action, $row); 267 268 # see whether number of jobs limit for high priority request was exceeded 269 if ($watch_for_big_requests and $num_jobs > $big_limit) { 270 $label = change_to_lower_priority_label($label); 271 $watch_for_big_requests = 0; 272 } 278 273 } 279 274 … … 286 281 287 282 exit 0; 283 284 # end of main function 285 286 sub change_to_lower_priority_label { 287 my $label = shift; 288 my $old_label = $label; 289 $label = ($label =~ /WEB/) ? 'WEB.BIG' : 'PSI.BIG'; 290 print "\nChanging label for big $old_label request to $label\n"; 291 292 my $command = "$pstamptool -updatereq -req_id $req_id -set_label $label"; 293 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 294 run(command => $command, verbose => $verbose); 295 unless ($success) { 296 my_die("$command failed", $PS_EXIT_UNKNOWN_ERROR); 297 } 298 return $label; 299 } 288 300 289 301 sub checkRow { … … 494 506 print "\nCalling locate_images_for_row for row: $rownum\n"; 495 507 496 $imageList = locate_images_for_row($ipprc, $image_db, $camera, $row, $verbose);508 my $imageList = locate_images_for_row($ipprc, $image_db, $camera, $row, $verbose); 497 509 498 510 my $dtime_locate = gettimeofday() - $start_locate; … … 586 598 # information required is contained there 587 599 588 $imageList = locate_images($ipprc, $image_db, $rowList, $req_type, $stage, $id, $tess_id, $component,600 my $imageList = locate_images($ipprc, $image_db, $rowList, $req_type, $stage, $id, $tess_id, $component, 589 601 $option_mask, $need_magic, $mjd_min, $mjd_max, $filter, $data_group, $verbose); 590 602 … … 777 789 print "$image->{image}\n"; 778 790 ++$firstRow->{job_num}; 791 if ($dump_params) { 792 my $rownum = $firstRow->{ROWNUM}; 793 my $jobnum = $firstRow->{job_num}; 794 my $filter = substr $image->{filter}, 0, 1; 795 my $output_base = "${rownum}_${jobnum}_${filter}"; 796 write_params($output_base, $image); 797 } 779 798 } 780 799 } elsif ($job_type eq "get_image") {
Note:
See TracChangeset
for help on using the changeset viewer.
