- Timestamp:
- Mar 30, 2012, 2:49:37 PM (14 years ago)
- Location:
- branches/eam_branches/ipp-20111122/pstamp/scripts
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
pstampparse.pl (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20111122/pstamp/scripts
- Property svn:mergeinfo set to
-
branches/eam_branches/ipp-20111122/pstamp/scripts/pstampparse.pl
r32271 r33638 254 254 # If we encounter an error for a particular row add a job with the proper fault code. 255 255 256 my $stage = $row->{IMG_TYPE}; 257 256 258 my $rownum = $row->{ROWNUM}; 257 259 if (!validID($rownum)) { … … 275 277 } 276 278 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"; 279 281 insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST); 280 282 return 0; … … 331 333 my $skycenter = $row->{skycenter} = ! ($row->{COORD_MASK} & $PSTAMP_CENTER_IN_PIXELS); 332 334 333 if (!$skycenter and !$component ){335 if (!$skycenter and !$component and $stage ne 'stack' and !($option_mask & $PSTAMP_USE_IMFILE_ID)){ 334 336 print STDERR "COMPONENT must be specified for pixel coordinate ROI center\n"; 335 337 insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST); … … 337 339 } 338 340 339 my $stage = $row->{IMG_TYPE};340 341 if (!check_image_type($stage)) { 341 342 print STDERR "invalid IMG_TYPE for row $rownum\n"; … … 417 418 my $camera = $proj_hash->{camera}; 418 419 $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 } 419 427 420 428 $need_magic = 0 if $stage eq 'stack'; … … 430 438 # and this user's data store destination is allowed uncensored stamps, so accept the request 431 439 $need_magic = 0; 432 433 # Since user can get unmagicked data "by coordinate" requests can go back in time434 # 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-01437 # XXX: This value should live in the pstampProject table not be hardcoded here438 $mjd_min = 54922;439 }440 440 } else { 441 441 print STDERR "Error row $rownum: User not authorized to to request uncensored stamps.\n"; … … 463 463 my $numRows = scalar @$rowList; 464 464 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 } 465 469 print "Collected $numRows rows beginning with row $rownum. $req_type $stage $id $tess_id $component\n"; 466 470 … … 521 525 my $h = $row->{HEIGHT}; 522 526 my $coord_mask = $row->{COORD_MASK}; 527 my $wholeFile = 0; 523 528 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 } 525 537 } else { 526 538 $roi_string = "-skycenter $x $y"; 527 539 } 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 } 532 546 } 533 547 … … 566 580 $args .= " -class_id $component" if $component; 567 581 } 568 569 if (0) {570 # add astrometry file for raw and chip images if one is available571 if (($stage eq "chip") || ($stage eq "raw")) {572 $args .= " -astrom $image->{astrom}" if $image->{astrom};573 }574 }575 582 576 583 $image->{job_args} = $args;
Note:
See TracChangeset
for help on using the changeset viewer.
