#509 closed defect (fixed)
psRegionFromString and psRegionToString need to do +/- 1
| Reported by: | Paul Price | Owned by: | |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | mathtypes | Version: | unspecified |
| Severity: | normal | Keywords: | |
| Cc: |
Description
These functions must convert between the psLib convention and FITS standard.
I've clarified the spec:
All functions which use a \code{psRegion} must interpret the
definition of $(x0,y0)$ and $(x1,y1)$ in the same way. The coordinate
$(x0,y0)$ defines the starting pixel in the region. The coordinate
$(x1,y1)$ defines the outer bound of the region, and are NOT included
in the region. The size of the region is $(x1-x0,y1-y1)$. If either
$x1$ or $y1$ is less than or equal to 0, the value is added to the
image dimensions (e.g., $Nx + x1$). Thus a region \code{[0:0,0:0]}
refers to the full image array, while \code{[0:-10,0:-20]} refers to
the entire image, minus the last 10 columns and the last 20 rows.
...
{\bf Note that regions specified by strings are in the FITS standard.}
It is the responsibility of \code{psRegionFromString} and
\code{psRegionToString} to convert between the PS standard (0 means
first pixel; upper value is not included, but lower is) and the FITS
standard (1 means first pixel; lower and upper values are included),
which simply involves subtracting one from \code{x0} and \code{y0}
when going from a string representation to a \code{psRegion}.
Change History (4)
comment:1 by , 21 years ago
| Owner: | changed from to |
|---|
comment:2 by , 21 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:3 by , 20 years ago
| Keywords: | VERIFIED added |
|---|

Bug has been resolved.... closing.