rectangular_overlap_grid¶
- photutils.geometry.rectangular_overlap_grid(xmin, xmax, ymin, ymax, nx, ny, width, height, use_exact, subpixels)¶
Area of overlap between a rectangle and a pixel grid. The rectangle is centered on the origin.
- Parameters:
- xmin, xmax, ymin, ymaxfloat
Extent of the grid in the x and y direction.
- nx, nyint
Grid dimensions.
- widthfloat
The width of the rectangle
- heightfloat
The height of the rectangle
- thetafloat
The position angle of the rectangle in radians (counterclockwise).
- use_exact0 or 1
If set to 1, calculates the exact overlap, while if set to 0, uses a subpixel sampling method with
subpixel
subpixels in each direction.- subpixelsint
If
use_exact
is 0, each pixel is resampled by this factor in each dimension. Thus, each pixel is divided intosubpixels ** 2
subpixels.
- Returns:
- frac
ndarray
2-d array giving the fraction of the overlap.
- frac