I've numpy meshgrid of lat and lon points with shape 1750 X 1750 and its corresponding data (rainfall) of same shape. I need to find the average of data points that falls inside a polygon,read from a shape file.
If my logic is right, I've to find out the index of lat and lon points that falls inside the polygon and then use that index to filter data and then do the average.
I've successfully implemented it in Matlab using Inpolygon function, but I want rewrite the code in Python. I've used matplotlib Path.contains_points function but it didn't work on numpy ND-array.
Could any one suggest a suitable method ? Your help will be highly appreciated.