IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27524


Ignore:
Timestamp:
Mar 30, 2010, 9:14:30 AM (16 years ago)
Author:
bills
Message:

catch invalid IMG_TYPE

File:
1 edited

Legend:

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

    r27356 r27524  
    233233    # user requested us to search all components. Set to ""
    234234    $search_component = "" if $search_component eq "all";
     235
     236    if (!check_image_type($stage)) {
     237        print STDERR "invalid IMG_TYPE for row $rownum\n" if $verbose;
     238        insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST);
     239        $num_jobs++;
     240        next;
     241    }
    235242
    236243    if ((($job_type eq "stamp") or ($req_type eq "bycoord")) and ! validROI($row)) {
     
    958965}
    959966
     967sub check_image_type
     968{
     969    my $img_type = shift;
     970    if (!$img_type) {
     971            print STDERR "NULL IMG_TYPE supplied\n";
     972            return 0;
     973    }
     974    if (($img_type eq "raw") or ($img_type eq "chip") or ($img_type eq "warp") or
     975        ($img_type eq "stack") or ($img_type eq "diff")) {
     976        return 1;
     977    } else {
     978        print STDERR "$img_type is not a valid IMG_TYPE\n";
     979        return 0;
     980    }
     981}
     982
    960983sub my_die
    961984{
Note: See TracChangeset for help on using the changeset viewer.