issues: 444367776
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
444367776 | MDU6SXNzdWU0NDQzNjc3NzY= | 2962 | Is it possible to perform this interpolation with xarray? | 48764870 | closed | 0 | 5 | 2019-05-15T10:46:40Z | 2019-05-15T12:01:42Z | 2019-05-15T11:57:28Z | NONE | I'm trying to interpolate information from a 3D dataset (lon,lat,time) ussing directly xarray. When I made a simply interpolation with only one point I have no problem at all. lat = [44.25] lon = [-4.5] t = datetime.strptime('2000-02-28 01:00:00', '%Y-%m-%d %H:%M:%S') ds = xr.open_dataset('file.nc') vx = ds['uo_surface'].interp(longitude=lon, latitude=lat, time=t) But now I'm trying to interpolate in the same way several points and the result of this operation following the same syntax shows more results of what I will expected. lat = [44.25, 45.25] lon = [-4.5, -5] t = datetime.strptime('2000-02-28 01:00:00', '%Y-%m-%d %H:%M:%S') ds = xr.open_dataset('Currents\oceanTESEO.nc') vx = ds['uo_surface'].interp(longitude=lon, latitude=lat, time=[t, t]) The result is this array: array([[[0.01750018, 0.05349977], [0.03699994, 0.11299999]], [[0.01750018, 0.05349977], [0.03699994, 0.11299999]]]) However, I expect only 2 values, one for each (lon,lat,t) point. Do I have to implement a loop to do that? I suposse this feature is already included in xarray. Do you know other way to calculate this sort of point interpolation faster and with 4D datarrays (lon,lat,z,time)? Thank you in advance!!! https://stackoverflow.com/questions/56144678/interpolation-syntax |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/2962/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |