zjf014 / hydro-gistools

GIS tools for hydro-data
MIT License
0 stars 1 forks source link

Errors when reading daymet data #2

Open Yalan-Song opened 10 months ago

Yalan-Song commented 10 months ago

Traceback (most recent call last): File "/usr/local/pycharm-community/plugins/python-ce/helpers/pydev/pydevd.py", line 1496, in _exec pydev_imports.execfile(file, globals, locals) # execute the script File "/usr/local/pycharm-community/plugins/python-ce/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "day_mean_huc10.py", line 24, in mean.mean_over_basin(watershed, shapeID_str, dataset, variable, lon="lon", lat="lat") File "mean.py", line 42, in mean_over_basin grid = grid_to_gdf(dataset, data_name, lon=lon, lat=lat) File "mean.py", line 90, in grid_to_gdf (HBLON - delta / 2, HBLAT - delta / 2), File "/lib/python3.7/site-packages/shapely/geometry/polygon.py", line 243, in init ret = geos_polygon_from_py(shell, holes) File "/lib/python3.7/site-packages/shapely/geometry/polygon.py", line 509, in geos_polygon_from_py ret = geos_linearring_from_py(shell) File "shapely/speedups/_speedups.pyx", line 348, in shapely.speedups._speedups.geos_linearring_from_py ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

Description

Hello, I got this error when reading daymet data

Can you help solve this issue?

zjf014 commented 10 months ago

Can you show the value of dataset? It should be a xarray.Dataset object. or more code of day_mean_huc10.py