Let us assume, for the moment, that you are interested in the diffuse cosmic X-ray background from an observation that has an extended source in the middle of it that you want to remove. For example, a galaxy at a certain (,) with semi-major axes (,) and a position angle (as usual, measured counter clockwise from North). You will need to convert those quantities into detector coordinates. The (,) can be converted to (,) with esky2det. The (,) can be converted to detector coordinates by scaling to pixels. The position angle is a bit trickier as that will depend upon the detector. The spacecraft “up” for which the roll is measured is the +Y axis (detector coordinates) for MOS1, the +X axis for MOS2, and the -X axis for the pn. This means that the rotation for the region needs to be:
Converting a region from sky to detector coordinates can also be done with convregion. However, convregion does not yet have the full functionality that may be required for more complex regions (i.e., regions other than circles and ellipses) and convregion does not calculate the rotation.