home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 1249295769

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/7042#issuecomment-1249295769 https://api.github.com/repos/pydata/xarray/issues/7042 1249295769 IC_kwDOAMm_X85Kdr2Z 4160723 2022-09-16T12:19:48Z 2022-09-16T12:19:48Z MEMBER

Hi @rogomichael,

It is expected in your example that sel with your given values and method='nearest' returns coordinates with duplicate longitude & latitude values.

The resolution of the grid is too coarse compared to your ROI, which is why the two provided values for latitude (longitude) both select the same grid point.

If you want to use sel for extracting a range over the latitude and longitude dimensions, it is better to use slices. It better illustrates that your ROI is smaller than the grid resolution:

```python ds.sel( longitude=slice(49.294, 49.376), latitude=slice(10.971, 11.087) )

<xarray.Dataset>

Dimensions: (time: 365, longitude: 1, latitude: 0)

Coordinates:

* time (time) datetime64[ns] 2019-01-01 2019-01-02 ... 2019-12-31

* longitude (longitude) float64 49.38

* latitude (latitude) float64

Data variables:

tg (time, latitude, longitude) float32 ...

```

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