home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 110979851

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
110979851 MDU6SXNzdWUxMTA5Nzk4NTE= 623 Circular longitude axis 3404817 closed 0     6 2015-10-12T13:56:45Z 2019-06-20T20:09:46Z 2016-12-24T00:11:45Z CONTRIBUTOR      

A common issue with global data or model output is that the zonal grid boundary might cut right through a region of interest. In that case, the field must be re-wrapped/shifted such that a region in the far east of the field is placed to the left of a region in the far west.

An way of achieving this when using xray (or netCDF4) I found was to use indices for isel that start somewhere in the east and then jump to 0 and continue from there.

But this works only on data that is already loaded into memory (e.g. with .load()), as illustrated in this gist. I assume that this constraint is due to the netCDF backend (in this case netCDF4) not supporting irregular slicing. Once loaded, the operation is performed on NumPy arrays, I guess?

Now the first thing is that it took me quite a while to figure out why this worked in some cases and not in others. Perhaps the IndexError that is thrown by the backend could be caught to give more hints on this? Or add a note in the Docs about this?

It would of course be great if xray had a nice high-level function to handle circular axes. Another item for the wish list...

(By the way, in Ferret this is called Modulo Axes.)

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

Links from other tables

  • 0 rows from issues_id in issues_labels
  • 6 rows from issue in issue_comments
Powered by Datasette · Queries took 0.983ms · About: xarray-datasette