Changeset 37997 for trunk/pstamp/scripts/pstampparse.pl
- Timestamp:
- Mar 24, 2015, 9:32:28 AM (11 years ago)
- File:
-
- 1 edited
-
trunk/pstamp/scripts/pstampparse.pl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/scripts/pstampparse.pl
r37980 r37997 542 542 $error_code = $PSTAMP_NO_IMAGE_MATCH if !$error_code; 543 543 insertFakeJobForRow($row, ++$row->{job_num}, $error_code); 544 }545 546 return $num_jobs;547 }548 549 sub processRows {550 my $action = shift;551 my $rowList = shift;552 my $num_jobs = 0;553 554 if ($action eq 'LIST') {555 # LIST is not allowed by caller. Can't get here.556 return list_targets($rowList);557 }558 559 # all rows in the list are compatible560 my $row = $rowList->[0];561 562 my $project = $row->{PROJECT};563 564 # note: resolve_project avoids running pstamptool every time by remembering the565 # last project resolved566 my $proj_hash = resolve_project($ipprc, $project, $dbname, $dbserver);567 if (!$proj_hash) {568 foreach my $r (@$rowList) {569 insertFakeJobForRow($r, 1, $PSTAMP_UNKNOWN_PRODUCT);570 $num_jobs++;571 }572 return $num_jobs;573 }574 my $req_type = $row->{REQ_TYPE};575 my $stage = $row->{IMG_TYPE};576 my $id = $row->{ID};577 my $component = $row->{COMPONENT};578 my $tess_id = $row->{TESS_ID};579 580 my $filter = $row->{REQFILT};581 my $mjd_min = $row->{MJD_MIN};582 my $mjd_max = $row->{MJD_MAX};583 my $data_group = $row->{DATA_GROUP};584 585 my $rownum = $row->{ROWNUM};586 my $job_type = $row->{JOB_TYPE};587 my $option_mask= $row->{OPTION_MASK};588 589 my $image_db = $proj_hash->{dbname};590 my $camera = $proj_hash->{camera};591 my $need_magic = $proj_hash->{need_magic};592 # Since user can get unmagicked data "by coordinate" requests can go back in time593 # to dredge unusable data from the "dark days"...594 if ($req_type eq 'bycoord' and $mjd_min eq 0) {595 # ... so unless the user sets mjd_min clamp it to 2009-04-01596 # XXX: This value should live in the pstampProject table not be hardcoded here597 $mjd_min = 54922;598 }599 600 $need_magic = 0 if $stage eq 'stack';601 602 # XXX: magic is dead603 $need_magic = 0;604 605 my $numRows = scalar @$rowList;606 607 if (($req_type eq 'byskycell') or ($req_type eq 'bycoord')) {608 # avoid error from print below if $id isn't needed609 $id = "" if !$id;610 }611 print "Collected $numRows rows beginning with row $rownum. $req_type $stage $id $tess_id $component\n";612 613 # Call PS::IPP::PStamp::Job locate_images subroutine to get the images for this614 # request specification. An array reference is returned.615 my $start_locate = gettimeofday();616 617 # XXX: perhaps we should get rid of most of this argument list.618 # Now that we are passing down compatible rows all of the619 # information required is contained there620 621 my $imageList = locate_images($ipprc, $image_db, $rowList, $req_type, $stage, $id, $tess_id, $component,622 $option_mask, $need_magic, $mjd_min, $mjd_max, $filter, $data_group, $verbose);623 624 my $dtime_locate = gettimeofday() - $start_locate;625 print "Time to locate_images for row $rownum $dtime_locate\n";626 627 # handle this628 # XXX: what did I mean by that comment?629 $row->{need_magic} = $need_magic;630 631 $num_jobs += queueJobs($action, $rowList, $imageList);632 633 # if a row slipped through with no jobs add a faulted one634 foreach my $row (@$rowList) {635 if ($row->{job_num} == 0) {636 print "row $row->{ROWNUM} produced no jobs\n";637 print STDERR "row $row->{ROWNUM} produced no jobs\n";638 my $error_code = $row->{error_code};639 $error_code = $PSTAMP_NO_IMAGE_MATCH if !$error_code;640 insertFakeJobForRow($row, ++$row->{job_num}, $error_code);641 }642 544 } 643 545
Note:
See TracChangeset
for help on using the changeset viewer.
