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

BUG: Intersection bug revisited #1662

Closed
cpelley opened this issue May 13, 2015 · 1 comment
Closed

BUG: Intersection bug revisited #1662

cpelley opened this issue May 13, 2015 · 1 comment

Comments

@cpelley
Copy link

cpelley commented May 13, 2015

Currently intersection redefines the coordinates because the max bound is at base + period.
Since I need the extracted region to be unaltered from the original grid definition, this currently means that I cannot use intersection.

This issue revisits #1553 as that was dropped at that time and I was unable to spark much interest.

The gist still applies:
https://gist.github.com/cpelley/05cde98a251d467e9cd2

Coordinates and data are necessarily wrapped by intersection:

>>> print overlap.coord('longitude').bounds.min(), overlap.coord('longitude').bounds.max()
-270.0 90.0
>>> print source.coord('longitude').bounds.min(), source.coord('longitude').bounds.max()
-180.0 180.0

The data has been wrapped around because of the choice of changes to the coordinates:

>>> print source.data
[[ 0  1  2  3]
 [ 4  5  6  7]
 [ 8  9 10 11]
 [12 13 14 15]]
>>> print overlap.data
[[ 3  0  1  2]
 [ 7  4  5  6]
 [11  8  9 10]
 [15 12 13 14]]
@cpelley
Copy link
Author

cpelley commented May 13, 2015

Does anyone have an ideas on how to safely handle the specific case of not creating subsets when the points/bounds and are at the edges of the coordinate? (i.e. stop unnecessary transformations).

Trying to constrain it to this case is difficult.

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant