home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 495421770

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/issues/2281#issuecomment-495421770 https://api.github.com/repos/pydata/xarray/issues/2281 495421770 MDEyOklzc3VlQ29tbWVudDQ5NTQyMTc3MA== 539688 2019-05-23T23:37:45Z 2019-05-23T23:53:33Z NONE

Great thread by @JiaweiZhuang! I just posted a question on stackoverflow about this exact problem. After hours navigating through the xarray documentation I finally found this opened issue... (since I'm new to xarray I thought the problem was my lack of understanding on how the package works)

It is surprising that a package targeting n-dimensional gridded datasets (particularly those from the geo/climate sciences) does not handle such a common task with spatial gridded data.

The problem on hand is this: I have two 3d arrays with different dimensions defined by 2d coordinates, all I want is to regrid the first cube onto the second. Is there a way to perform this operation with xarray?

This is what I've tried (which @JiaweiZhuang explained why it doesn't work):

``` da = xr.DataArray(cube, dims=['t', 'y', 'x'], coords={'t': time,
'xc': (['y', 'x'], X),
'yc': (['y', 'x'], Y)})

da_interp = da.interp(x=x_new, y=y_new).interp(t=t_new) ```

Here x_new/y_new should be mapped onto xc/yc (physical coordinates), not onto x/y (logical coordinates).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  340486433
Powered by Datasette · Queries took 1.537ms · About: xarray-datasette