## NAME

coords -- pixel coordinates in the pros spatial package

## USAGE

`This document describes the pixel coordinate system used in the pros`
`spatial package.`

## DESCRIPTION

1) PIXEL COORDINATESThe PROS package assumes IRAF file coordinates. The lower left corner pixel has the coordinate (1,1). In real terms the lower left pixel extends from 0.5 to 1.5 on both X and Y axes, with its center at (1.0,1.0). This differs from both ROSAT and Einstein files. In Einstein and ROSAT/HRI coordinates, the upper left pixel is (0,0); In ROSAT/PSPC coordinates, the upper left pixel is (1,1).

Thus, to get from ROSAT/HRI or Einstein coordinates to IRAF coordinates, the Y axis coordinates must be flipped (reverse ordered) and 0.5 must then be added to both coordinates. Also the Negative of the Einstein and ROSAT/HRI Roll Angle is stored to accomodate the Y-axis flip. To get from ROSAT/PSPC coordinates to IRAF coordinates, just the Y axis flip is necessary. ( PSPC roll angle is always zero. )

This means that pixel positions from HARDCOPY Einstein and ROSAT/PSPC results will NOT match the results from PROS, unless the following conversions are applied. The ROSAT/HRI shows both sets of coordinate systems - where L2 is appropriate for PROS. When looking at the <seq>_src.tab files for ROSAT, the x and y coordinates are in IRAF coordinates whereas the PSPC HARDCOPY from LEVEL 1 processing is not.

There is still an unresolved issue in IRAF/MWCS concerning fractional pixels which is yet to be resolved. Therefore there is still a small possible error in the conversion from pixels to celestial coordinates of order ~.5".

ROSAT/HRI and EINSTEIN The equations for coordinate conversion are (XRAY = ROSAT/HRI or EINSTEIN): integer x_IRAF = x_XRAY + 1 y_IRAF = = image_height - y_XRAY X_XRAY= x_IRAF - 1 y_XRAY= image_height - y_IRAF floating point x_IRAF = x_XRAY + 0.5 y_IRAF = image_height - y_XRAY + 0.5 X_XRAY = x_IRAF - 0.5 y_XRAY = image_height - y_IRAF + 0.5 roll_IRAF = - ( roll_XRAY ) roll_XRAY= - ( roll_IRAF ) ROSAT/PSPC The equations for coordinate conversions are (XRAY = ROSAT/PSPC): x_IRAF= x_XRAY y_IRAF= image_height - y_XRAY X_XRAY= x_IRAF y_XRAY= image_height - y_IRAF 2) PIXEL INCLUSION IN GEOMETRIC SHAPESPROS spatial tasks allow filtering by geometric regions with floating point coordinates. Pixels are counted as either entirely included or excluded, depending on whether the center of the pixel is included or excluded in the region. Pixel centers often fall exactly on the edge of regions which have been specified with integer values. Two different standards are used, one for regions with straight edges and one for regions with curved edges (circles and ellipses).

In the first case, the pixel will be included if the object extends BEFORE the center of the pixel. This means that right and top edges are included, while left and bottom edges are not. By this rule, regions which are perfectly adjacent in floating point coordinates will neither both miss, nor both claim any pixels on their common edge (no gaps or overlaps).

Take the case of a box with center at (10.0,10.0), width 2.0 and height 4.0. Pixel (8.0,10.0) is not included since the box extends BEYOND (from there toward higher coordinate values). Pixel (12.0, 10.0) is included since the box extends BEFORE (from lower coordinate values to this edge). Likewise, (10.0,8.0) is not included, while (10.0,12.0) is included.

Point regions follow a similar rule. The point is included in the pixel whose real coordinates include the point. If the point falls exactly on an edge between pixels, the point is counted in the pixel with the lower index.

The rule for circles and ellipses is that the pixel is included if it is on an inner edge (toward the center) and not included if it is on an outer edge (away from the center). This rule guarantees that: a) an annuli centered on a pixel center with inner radius 0 includes the center pixel, b) all pixels on the edge between concentric rings belong to one ring or the other but not both (no gaps or overlaps), c) small circular regions centered on a pixel will have symmetrical pixel distributions about the center.

When many regions are defined for the same mask, each region is "painted" onto the mask. Thus where regions overlap, the last painted region gets the overlapping pixels. Bad pixels are marked for exclusion after all regions have been painted.

## SEE ALSO

HELP regcoords - for coordinates in spatial region filtering HELP qpoe - for detector coordinates HELP filter - for detector coordinates