polygon_weights

sofia_redux.toolkit.image.fill.polygon_weights(polygon, xrange=None, yrange=None, center=True)[source]

Get pixel weights - depreciated by polyfillaa

Parameters:
polygonarray_like of float

(N, 2) where the last dimension is in the numpy (y, x) format, i.e. polygon[:, 0] = y coordinates, polygon[:, 1] = x coordinates Each point specifies a vertex of the polygon. Must contain at least 3 vertices.

xrangearray_like of float, optional

(2,) Specifies the (minimum, maximum) allowable x values

yrangearray_like of float, optional

(2,) Specifies the (minimum, maximum) allowable y values

centerbool, optional

If True, integer (y,x) values define pixel centers, otherwise they define the lower-left corner of each pixel.

Returns:
list of tuple

Tuple of the form ((y, x), area) where y and x are the integer pixel locations and area are float fractions of pixel area within the polygon (0 -> 1).