Commit cf46de6c authored by POLCHER Jan's avatar POLCHER Jan 🚴🏾
Browse files

Still some issues with the SphericalGeometry package.

parent 12647416
......@@ -157,10 +157,14 @@ class compweights :
if len(inter.polygons) > 0 :
inside = inter.polygons[0]._inside
if hydrocell.contains_point(inside) and cell.contains_point(inside):
area_in[index[0],index[1]] = inter.area()*(EarthRadius**2)
area_in[index[0],index[1]] = min(inter.area(), hydrocell.area())*(EarthRadius**2)
else:
area_in[index[0],index[1]] = (4*np.pi-inter.area())*(EarthRadius**2)
if 4*np.pi-inter.area() > inter.area() :
ERROR("Point inside intersection polygone is outside of both gridboxes but no solution !")
area_in[index[0],index[1]] = 0.0
else :
area_in[index[0],index[1]] = (4*np.pi-inter.area())*(EarthRadius**2)
##############
# Output of Overlap areas for each grid point
#
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment