salem.DatasetAccessor.roi

DatasetAccessor.roi(self, shape=None, geometry=None, grid=None, corners=None, crs=wgs84, roi=None)

Make a region of interest (ROI) for the dataset.

All grid points outside the ROI will be masked out.

Parameters:

shape : str

path to a shapefile

geometry : geometry

a shapely geometry (don’t forget the crs keyword)

grid : Grid

a Grid object which extent will form the ROI

corners : tuple

a ((x0, y0), (x1, y1)) tuple of the corners of the square to subset the dataset to (don’t forget the crs keyword)

crs : crs, default wgs84

coordinate reference system of the geometry and corners

roi : ndarray

if you have a mask ready, you can give it here