pixel_polygon_mask

grizli.utils.pixel_polygon_mask(polygon, shape, wcs=None)[source]

Make a mask points in a 2D array inside a polygon

Parameters
polygonstr, (2,M) array

Something that grizli.utils.SRegion can parse as a polygon

shapetuple

2-tuple of image dimensions

wcsastropy.wcs.WCS

If specified, assume polygon is sky coordinates and transform to image.

Returns
maskarray

bool array with shape that is True inside polygon