Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat/bug: Wrap-around of chi coordinate #17

Open
pbeaucage opened this issue Oct 9, 2021 · 1 comment
Open

feat/bug: Wrap-around of chi coordinate #17

pbeaucage opened this issue Oct 9, 2021 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@pbeaucage
Copy link
Collaborator

Problem: slicing chi in cyclic space is somewhat non-trivial - xarray doesn't have built-in support for this, and adding it as a custom coordinate class is problematic.

The immediate solution, which is a bit gross, is to up the priority of #13 and use rsoxs.slice_chi to properly do the necessary (multi-) slicing.

Useful tests:

if array is np180:
slice(270) --> -90
slice(170,190) --> slice(170,180)+slice(-170,-179)

if array is 0360:
slice(-90) --> 270
slice(-10,10) --> slice(350,360)+slice(1,10)

@pbeaucage pbeaucage changed the title Wrap-around of chi coordinate feat/bug: Wrap-around of chi coordinate Oct 9, 2021
pbeaucage added a commit that referenced this issue Oct 9, 2021
Add rsoxs class as a dataarray accessor.  Rewrite rsoxs.slice_chi to
handle just about any kind of slice you can throw at it.  Add some unit
tests to rsoxs.slice_chi for kicks.
@pbeaucage
Copy link
Collaborator Author

This is now working, with some additional bugfixes lately. Needs documentation.

@pbeaucage pbeaucage added the documentation Improvements or additions to documentation label May 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant