-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
almost-equal grids #784
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
Comments
Hi @mathause, I actually just ran into a very similar problem to your second bullet point. I had some limited success by manually re-building the re-gridded dataset onto the CESM coordinate system, swapping out the not-exactly-but-actually-close-enough coordinates for the CESM reference data's coordinates. In my case, I was re-gridding with CDO, but even when I explicitly pull out the CESM grid definition it wouldn't match precisely. Since there was a lot of boilerplate code to do this in xarray (although I had a lot of success defining a callback to pass in with open_dataset), it was far easier just to use NCO to copy the correct coordinate variables into the re-gridded data. |
This doesn't work automatically, but you can use the
It would be nice for this to be able to work automatically, but the challenge is picking a heuristic that does not violate the principle of least surprise. A proposed a few ideas in a related issue in pandas (pandas-dev/pandas#9817 (comment)). |
I really like this. Explicit and self-documenting code. I would avoid making this automatic. |
That sounds good. Do you need both, What I do at the moment is probably not as elegant:
|
The |
@mathause - any reason to keep this open or did we sort this out? |
Sometimes it happens that you have two grids that are equal up to precision or "for practical purposes". xarray does not align them. Is there a possibility to still get them aligned (and not having to copy the coordinates from one to the other)?
Examples:
~1*10**-4
.The text was updated successfully, but these errors were encountered: