IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35432


Ignore:
Timestamp:
Apr 24, 2013, 3:06:53 PM (13 years ago)
Author:
bills
Message:

if width and height are both zero create a "whole file" job

File:
1 edited

Legend:

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

    r35398 r35432  
    360360
    361361    my $wholefile = 0;
    362     if (!$skycenter && $row->{CENTER_X} == 0 && $row->{CENTER_Y} == 0) {
     362    if (($row->{WIDTH} == 0 && $row->{HEIGHT} == 0) ||
     363       (!$skycenter && $row->{CENTER_X} == 0 && $row->{CENTER_Y} == 0)) {
    363364        # Secret code for returning the whole file
    364365        $wholefile = 1;
     
    628629    my $h = $row->{HEIGHT};
    629630    my $coord_mask = $row->{COORD_MASK};
     631
    630632    my $wholeFile = 0;
    631     if ($coord_mask & $PSTAMP_CENTER_IN_PIXELS) {
    632         # Center of 0, 0 in pixel coordinates is interpreted to mean
    633         # return the entire file
    634         if ($x == 0 && $y == 0) {
    635             $roi_string = "-wholefile";
    636             $wholeFile = 1;
     633    # For historical reasons there are two ways to specify that the entire file be returned
     634    # rather than a postage stamp ...
     635    if ($w == 0 and $h == 0) {
     636        # ... The right way: width and height both zero ...
     637        $wholeFile = 1;
     638    } else {
     639        if ($coord_mask & $PSTAMP_CENTER_IN_PIXELS) {
     640            if ($x == 0 && $y == 0) {
     641                # ... and pixel coordinate center of 0, 0
     642                # I made this one up without thinking through the API clearly.
     643                # allowing width and height to do it works much better
     644                $wholeFile = 1;
     645            } else {
     646                $roi_string = "-pixcenter $x $y";
     647            }
    637648        } else {
    638             $roi_string = "-pixcenter $x $y";
    639         }
     649            $roi_string = "-skycenter $x $y";
     650        }
     651    }
     652
     653    if ($wholeFile) {
     654        $roi_string = "-wholefile";
     655    } elsif ($coord_mask & $PSTAMP_RANGE_IN_PIXELS) {
     656            $roi_string .= " -pixrange $w $h";
    640657    } else {
    641         $roi_string = "-skycenter $x $y";
    642     }
    643     if (!$wholeFile) {
    644         if ($coord_mask & $PSTAMP_RANGE_IN_PIXELS) {
    645             $roi_string .= " -pixrange $w $h";
    646         } else {
    647658            $roi_string .= " -arcrange $w $h";
    648         }
    649659    }
    650660
Note: See TracChangeset for help on using the changeset viewer.