IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 30, 2012, 2:49:37 PM (14 years ago)
Author:
eugene
Message:

merge changes from trunk

Location:
branches/eam_branches/ipp-20111122/pstamp/scripts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20111122/pstamp/scripts

  • branches/eam_branches/ipp-20111122/pstamp/scripts/pstampparse.pl

    r32271 r33638  
    254254    # If we encounter an error for a particular row add a job with the proper fault code.
    255255
     256    my $stage = $row->{IMG_TYPE};
     257
    256258    my $rownum   = $row->{ROWNUM};
    257259    if (!validID($rownum)) {
     
    275277    }
    276278    if ($job_type eq 'get_image') {
    277         unless ($req_type eq 'byid' or $req_type eq 'byexp') {
    278             print STDERR "REQ_TYPE must be 'byid' or 'byexp' for JOB_TYPE 'get_image'\n";
     279        unless ($req_type eq 'byid' or $req_type eq 'byexp' or ($req_type eq 'byskycell' and $stage eq 'stack')) {
     280            print STDERR "REQ_TYPE must be 'byid' or 'byexp' or byskcyell for stacks for JOB_TYPE 'get_image'\n";
    279281            insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST);
    280282            return 0;
     
    331333    my $skycenter = $row->{skycenter} = ! ($row->{COORD_MASK} & $PSTAMP_CENTER_IN_PIXELS);
    332334
    333     if (!$skycenter and !$component) {
     335    if (!$skycenter and !$component and $stage ne 'stack' and !($option_mask & $PSTAMP_USE_IMFILE_ID)){
    334336        print STDERR "COMPONENT must be specified for pixel coordinate ROI center\n";
    335337        insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST);
     
    337339    }
    338340
    339     my $stage = $row->{IMG_TYPE};
    340341    if (!check_image_type($stage)) {
    341342        print STDERR "invalid IMG_TYPE for row $rownum\n";
     
    417418    my $camera     = $proj_hash->{camera};
    418419    $need_magic    = $proj_hash->{need_magic};
     420    # Since user can get unmagicked data "by coordinate" requests can go back in time
     421    # to dredge unusable data from the "dark days"...
     422    if ($req_type eq 'bycoord' and $mjd_min eq 0) {
     423            # ... so unless the user sets mjd_min clamp it to 2009-04-01
     424            # XXX: This value should live in the pstampProject table not be hardcoded here
     425            $mjd_min = 54922;
     426    }
    419427
    420428    $need_magic = 0 if $stage eq 'stack';
     
    430438                # and this user's data store destination is allowed uncensored stamps, so accept the request
    431439                $need_magic = 0;
    432 
    433                 # Since user can get unmagicked data "by coordinate" requests can go back in time
    434                 # to dredge unusable data from the "dark days"...
    435                 if ($req_type eq 'bycoord' and $mjd_min eq 0) {
    436                     # ... so unless the user sets mjd_min clamp it to 2009-04-01
    437                     # XXX: This value should live in the pstampProject table not be hardcoded here
    438                     $mjd_min = 54922;
    439                 }
    440440            } else {
    441441                print STDERR "Error row $rownum: User not authorized to to request uncensored stamps.\n";
     
    463463    my $numRows = scalar @$rowList;
    464464
     465    if (($req_type eq 'byskycell') or ($req_type eq 'bycoord')) {
     466        # avoid error from print below if $id isn't needed
     467        $id = "" if !$id;
     468    }
    465469    print "Collected $numRows rows beginning with row $rownum. $req_type $stage $id $tess_id $component\n";
    466470   
     
    521525    my $h = $row->{HEIGHT};
    522526    my $coord_mask = $row->{COORD_MASK};
     527    my $wholeFile = 0;
    523528    if ($coord_mask & $PSTAMP_CENTER_IN_PIXELS) {
    524         $roi_string = "-pixcenter $x $y";
     529        # Center of 0, 0 in pixel coordinates is interpreted to mean
     530        # return the entire file
     531        if ($x == 0 && $y == 0) {
     532            $roi_string = "-wholefile";
     533            $wholeFile = 1;
     534        } else {
     535            $roi_string = "-pixcenter $x $y";
     536        }
    525537    } else {
    526538        $roi_string = "-skycenter $x $y";
    527539    }
    528     if ($coord_mask & $PSTAMP_RANGE_IN_PIXELS) {
    529         $roi_string .= " -pixrange $w $h";
    530     } else {
    531         $roi_string .= " -arcrange $w $h";
     540    if (!$wholeFile) {
     541        if ($coord_mask & $PSTAMP_RANGE_IN_PIXELS) {
     542            $roi_string .= " -pixrange $w $h";
     543        } else {
     544            $roi_string .= " -arcrange $w $h";
     545        }
    532546    }
    533547
     
    566580        $args .= " -class_id $component" if $component;
    567581    }
    568 
    569 if (0) {
    570     # add astrometry file for raw and chip images if one is available
    571     if (($stage eq "chip") || ($stage eq "raw")) {
    572         $args .= " -astrom $image->{astrom}" if $image->{astrom};
    573     }
    574 }
    575582
    576583    $image->{job_args} = $args;
Note: See TracChangeset for help on using the changeset viewer.