issues: 882105903
This data as json
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at | closed_at | author_association | active_lock_reason | draft | pull_request | body | reactions | performed_via_github_app | state_reason | repo | type |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
882105903 | MDU6SXNzdWU4ODIxMDU5MDM= | 5281 | 'Parallelized' apply_ufunc for scripy.interpolate.griddata | 74414841 | open | 0 | 4 | 2021-05-09T10:08:46Z | 2022-04-09T01:39:13Z | NONE | Hi, I'm working with large files from an ocean model with an unstructered grid. For instance, variable flow velocity For smaller computational domains (smaller nFlowElement dimension) I ám still able to load the dataarray in my work memory. Then, the following code gives me the wanted result: ``` def interp_to_grid(u,xc,yc,xint,yint): print(u.shape,xc.shape,xint.shape) ug = griddata((xc,yc),u,(xint,yint), method='nearest', fill_value=np.nan) return ug uxg = xr.apply_ufunc(interp_to_grid,
ux, xc, yc, xint, yint,
dask = 'allowed',
input_core_dims=[['nFlowElem','time','laydim'],['nFlowElem'],['nFlowElem'],['dim_0','dim_1'],['dim_0','dim_1']],
output_core_dims=[['dim_0','dim_1','time','laydim']],
output_dtypes = [xr.DataArray]
)
However, for much larger spatial domains it is required to work with dask = 'parallelized', because these input dataarrays can nolonger be loaded into my working memory. I have tried to apply chunks over the time dimension, but also over the nFlowElement dimension. I am aware that it is not possible to chunk over core dimensions. This is one of my "parallel" attempts (with chunks along the time dim): Input ux:
File "interpnd.pyx", line 192, in scipy.interpolate.interpnd._check_init_shape ValueError: different number of values and points
Any advice is very welcome! Best Wishes, Luka |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/5281/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
13221727 | issue |