home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 340486433

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
340486433 MDU6SXNzdWUzNDA0ODY0MzM= 2281 Does interp() work on curvilinear grids (2D coordinates) ? 25473287 open 0     28 2018-07-12T04:36:43Z 2020-09-04T19:24:32Z   NONE      

I am evaluating interp() against xESMF. Here's how xESMF would regrid the built-in 'rasm' data to a regular lat-lon grid.

Seems like interp() can convert rectilinear grids (1D coordinates) to curvilinear grids (2D coordinates), according to the last example. How about the reverse? Can it convert 2D coordinate to 1D, or to another 2D coordinate?

That's the test data: dr = xr.tutorial.load_dataset('rasm')['Tair'] ... Coordinates: * time (time) datetime64[ns] 1980-09-16T12:00:00 1980-10-17 ... xc (y, x) float64 189.2 189.4 189.6 189.7 189.9 190.1 190.2 190.4 ... yc (y, x) float64 16.53 16.78 17.02 17.27 17.51 17.76 18.0 18.25 ...

That's a simple destination grid: lon = xr.DataArray(np.linspace(-180, 180, 120), dims=['lon']) lat = xr.DataArray(np.linspace(-90, 90, 60), dims=['lat'])

I would expect a syntax like: dr_out = dr.interp(xc=lon, yc=lat)

But I got ValueError: dimensions ['xc', 'yc'] do not exist, becauseinterp() only accepts dimensions (which must be 1D), not coordinates.

dr.interp(x=lon, y=lat) runs but the result is not correct. This is expected because x does not mean longitude in the original data.

@crusaderky @fujiisoup

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/2281/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    13221727 issue

Links from other tables

  • 1 row from issues_id in issues_labels
  • 28 rows from issue in issue_comments
Powered by Datasette · Queries took 0.734ms · About: xarray-datasette