IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27994


Ignore:
Timestamp:
May 18, 2010, 11:10:30 AM (16 years ago)
Author:
bills
Message:

Set correct error code when selectComponents finds no overlap with the requested images.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm

    r27991 r27994  
    170170
    171171# The subroutine lookup handles byexp, byid, and byskycell lookups including lookups that are
    172 # triggered by a bydiff request
    173 
    174 sub lookup
    175 {
     172# triggered by a bydiff or bycoord request
     173
     174sub lookup {
    176175    my $ipprc    = shift;
    177176    my $rowList    = shift;
     
    207206    my $class_id;
    208207    my $skycell_id;
     208    my $default_error = $PSTAMP_NO_IMAGE_MATCH;
    209209
    210210    # note $magic_arg may be cleared below depending on $req_type
     
    533533            if (($img_type ne "diff") and ($img_type ne "stack")) {
    534534                print STDERR "lookup_diff: cannot lookup IMG_TYPE $img_type bydiff from a stack stack diff run\n";
    535                 next;
     535                setErrorCodes($rowList, $PSTAMP_INVALID_REQUEST);
     536                # all images will be the same so we can stop
     537                last;
    536538            }
    537539            # stack-stack diff
     
    601603            } else {
    602604                # XXX this will only happen if the minuend is not a warp. See hack above
    603                 print STDERR "WARNING: cannot resolve camera so cannot get resolve file rules\n";
     605                print STDERR "WARNING: cannot resolve camera so cannot find file rules\n";
    604606                next;
    605607            }
     
    10851087        print $pointsList "$npoints $row->{CENTER_X} $row->{CENTER_Y}\n";
    10861088        $npoints++;
     1089        # this gets overwitten if an overlapping image is found
     1090        $row->{error_code} = $PSTAMP_NO_OVERLAP;
    10871091    }
    10881092    close $pointsList;
     
    11291133                }
    11301134                push @$ref, $ptnum;
     1135                my $row = $rowList->[$ptnum];
     1136                # this row found a match
     1137                $row->{error_code} = 0;
    11311138            }
    11321139            if ($verbose) {
     
    11601167                my $images = runToolAndParse($command, $verbose);
    11611168                if (!defined $images) {
    1162                     # XXX: need to get the set error_code to $PSTAMP_NO_OVERLAP
    11631169                    print "No components containing coordinates found for ${stage}_id $stage_id\n";
    11641170                    foreach my $row (@$rowList) {
     1171                        # XXX: This doesn't seem like the correct error code?
    11651172                        $row->{error_code} = $PSTAMP_NO_OVERLAP;
    11661173                    }
     
    13231330    }
    13241331}
     1332# set error_code for an array of rows to a given value
     1333sub setErrorCodes {
     1334    my $rowList = shift;
     1335    my $code = shift;
     1336    foreach my $row (@$rowList) {
     1337        $row->{error_code} = $code;
     1338    }
     1339}
    13251340
    13261341sub my_die
Note: See TracChangeset for help on using the changeset viewer.