overlap_triplets

spizzle.overlap_triplets(corners, out_shape, region=None)

Overlap areas of input pixel quadrilaterals with output pixels.

Every input pixel with finite corners is visited, or only those in region; output pixels outside out_shape are left out. The triplets are in input pixel order (row by row) and, within an input pixel, in output pixel order, which is the order in which drizzle adds the contributions to each output pixel.

Parameters:
cornersndarray, shape (ny, nx, 4, 2)

From corners.

out_shapetuple of int

(ny_out, nx_out).

regiontuple of slice, optional

(slice(y0, y1), slice(x0, x1)), the input pixels to visit, as drizzle’s xmin to xmax and ymin to ymax with x1 = xmax + 1 and y1 = ymax + 1; by default all of them.

Returns:
in_idxndarray of int64, shape (n,)

Flat index of the input pixel, y * nx + x.

out_idxndarray of int64, shape (n,)

Flat index of the output pixel, y * nx_out + x.

areandarray of float64, shape (n,)

Overlap area in output pixels, non-zero; negative when the quadrilateral is counterclockwise.