home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 147727880

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/623#issuecomment-147727880 https://api.github.com/repos/pydata/xarray/issues/623 147727880 MDEyOklzc3VlQ29tbWVudDE0NzcyNzg4MA== 3404817 2015-10-13T14:17:08Z 2015-10-13T14:17:08Z CONTRIBUTOR

@jhamman You guys seem to be always ahead of me - which is great! (I just did not notice it this time before I raised the issue...)

But it would actually not be that hard to make selecting regions across the boundary of a circular dimension more convenient in xray.

It would of course be great if it worked with real coordinate (longitude) values:

ds.sel(lon=slice(-90, 15))

which, however, only works if the axis explicitly covers this range (e.g. has range -180E to 180E). If it ranges, say, from 0E to 360E, an empty DataArray is returned. There is no nice way of resolving this, I guess, because you would need to hard-code 360 or have it as a clumsy, non-CF-standard parameter and transform all values to some common range before trying to find the requested region.

But it should be less problematic with

ds.isel(lon=slice(-100, 200))

i.e. isel with negative slice start. As it is now, this also returns an empty DataArray for me (xray 0.6.0), which is in a way consistent with the sel behaviour. But asking for negative indices is actually a quite pythonic way of implying circular. So could this be implemented, now that netCDF4 supports non-contiguous indexing?

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