IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 11, 2010, 12:09:05 PM (16 years ago)
Author:
bills
Message:

Fix error queuing update runs for get image jobs. Pass component = 'all' to locate_images if appropriate.
Several error messages had print if $verbose. Print unconditionally they are errors.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pstamp/scripts/pstampparse.pl

    r27899 r27914  
    224224    my $rownum   = $row->{ROWNUM};
    225225    if (!validID($rownum)) {
    226         print STDERR "$rownum is not a valid ROWNUM\n"  if $verbose;
     226        print STDERR "$rownum is not a valid ROWNUM\n";
    227227        insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST);
    228228        return 0;
     
    230230    my $job_type = $row->{JOB_TYPE};
    231231    if (($job_type ne "stamp") and ($job_type ne "get_image")) {
    232         print STDERR "$job_type is not a valid JOB_TYPE\n"  if $verbose;
     232        print STDERR "$job_type is not a valid JOB_TYPE\n";
    233233        insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST);
    234234        return 0;
     
    238238    if (($req_type ne "byid") and ($req_type ne "bycoord") and ($req_type ne "byexp") and
    239239        ($req_type ne "byskycell") and ($req_type ne "bydiff")) {
    240         print STDERR "$req_type is not a valid REQ_TYPE\n"  if $verbose;
     240        print STDERR "$req_type is not a valid REQ_TYPE\n";
    241241        insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST);
    242242        return 0;
    243243    }
     244    if ($job_type eq 'get_image') {
     245        unless ($req_type eq 'byid' or $req_type eq 'byexp') {
     246            print STDERR "REQ_TYPE must be 'byid' or 'byexp' for JOB_TYPE 'get_image'\n";
     247            insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST);
     248            return 0;
     249        }
     250    }
    244251
    245252
    246253    my $component = $row->{COMPONENT};
    247254    if (!defined $component or (lc($component) eq "null") or (lc($component) eq "all")) {
    248         $row->{COMPONENT} = $component = "";
     255        if ($job_type eq 'get_image') {
     256            $row->{COMPONENT} = 'all';
     257        } else {
     258            $row->{COMPONENT} = $component = "";
     259        }
    249260    }
    250261    $row->{TESS_ID} = "" if !defined $row->{TESS_ID};
     
    259270    my $mjd_min = $row->{MJD_MIN};
    260271    if (defined($mjd_min) and !validNumber($mjd_min)) {
    261         print STDERR "$mjd_min is not a valid MJD_MIN\n"  if $verbose;
     272        print STDERR "$mjd_min is not a valid MJD_MIN\n";
    262273        insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST);
    263274        return 0;
     
    265276    my $mjd_max = $row->{MJD_MAX};
    266277    if (defined($mjd_max) and !validNumber($mjd_max)) {
    267         print STDERR "$mjd_max is not a valid MJD_MAX\n"  if $verbose;
     278        print STDERR "$mjd_max is not a valid MJD_MAX\n";
    268279        insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST);
    269280        return 0;
     
    289300
    290301    if (!$skycenter and !$component) {
    291         print STDERR "COMPONENT must be specified for pixel coordinate ROI center\n" if $verbose;
     302        print STDERR "COMPONENT must be specified for pixel coordinate ROI center\n";
    292303        insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST);
    293304        return 0;
     
    296307    my $stage = $row->{IMG_TYPE};
    297308    if (!check_image_type($stage)) {
    298         print STDERR "invalid IMG_TYPE for row $rownum\n" if $verbose;
     309        print STDERR "invalid IMG_TYPE for row $rownum\n";
    299310        insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST);
    300311        return 0;
     
    302313
    303314    if ((($job_type eq "stamp") or ($req_type eq "bycoord")) and ! validROI($row)) {
    304         print STDERR "invalid ROI for row $rownum\n" if $verbose;
     315        print STDERR "invalid ROI for row $rownum\n";
    305316        insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST);
    306317        return 0;
     
    308319
    309320    if (($req_type eq "byexp") and ($stage eq "stack")) {
    310         print STDERR "byexp not implemented for stack stage. row: $rownum\n" if $verbose;
     321        print STDERR "byexp not implemented for stack stage. row: $rownum\n";
    311322        insertFakeJobForRow($row, 1, $PSTAMP_NOT_IMPLEMENTED);
    312323        return 0;
     
    320331    if ($req_type eq "bycoord") {
    321332        if (!$skycenter) {
    322             print STDERR "center must be specified in sky coordintes for bycoord" if $verbose;
     333            print STDERR "center must be specified in sky coordintes for bycoord";
    323334            insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST);
    324335            return 0;
     
    328339    if (($req_type eq "byid") or ($req_type eq "bydiff")) {
    329340        if (!validID($row->{ID})) {
    330             print STDERR "ID must be a positive integer for req_type $req_type\n" if $verbose;
     341            print STDERR "ID must be a positive integer for req_type $req_type\n";
    331342            insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST);
    332343            return 0
     
    350361    my $proj_hash = resolve_project($ipprc, $project, $dbname, $dbserver);
    351362    if (!$proj_hash) {
    352         print STDERR "project $project not found\n"  if $verbose;
     363        print STDERR "project $project not found\n" ;
    353364        foreach $row (@$rowList) {
    354365            insertFakeJobForRow($row, 1, $PSTAMP_UNKNOWN_PRODUCT);
     
    714725                    # cause the image to be re-made
    715726                    # set up to queue an update run
    716                     queue_update_run(\$newState, \$fault, \$dep_id, $image->{image_db},
     727                    queue_update_run(\$newState, \$fault, \$dep_id, $image->{imagedb},
    717728                        $run_state, $stage, $image->{stage_id}, $image->{component}, $need_magic);
    718729                }
Note: See TracChangeset for help on using the changeset viewer.