-
Notifications
You must be signed in to change notification settings - Fork 96
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
Fix bucket assignment #249
Conversation
Where are we on this ? |
- Compute bucket indices with respect to the edge of the corner pixel, not the center. - Don't round projection coordinates. This is already done by casting to integer. - That also means that we don't need the projection coordinates anymore. We can use the area extent instead.
Roughly one week later I finally managed to continue with this 😄 |
Codecov Report
@@ Coverage Diff @@
## master #249 +/- ##
==========================================
+ Coverage 91.94% 91.97% +0.02%
==========================================
Files 42 42
Lines 8098 8099 +1
==========================================
+ Hits 7446 7449 +3
+ Misses 652 650 -2
Continue to review full report at Codecov.
|
Observations less than one bucket beyond the left/top boundary of the target area are assigned to the buckets in the first row/col. Fix that by flooring projection coordinates before casting them to integer.
I found another little bug: Some observations outside the target area are assigned to the buckets in the first row/col. This happens if the observations are less than one bucket beyond the left/right boundary of the target area. In that case
so that |
Nice investigation work! tell us when you want us to review this :) |
I think it's ready for review now :) |
@ameraner Since you also started working with the bucket resampler, I'd be pleased if you could review this, too (if you have time) |
Looks good to me, as discussed in Slack :) |
Thanks for taking the time @ameraner ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The bucket assignment in the bucket resampler seems to be off by half a pixel. This PR provides a fix.
Example:
Output with current master:
Output with this PR:
Changes:
Compute bucket indices with respect to the edge of the corner
pixel, not the center.
Don't round projection coordinates. This is already done by
casting to integer.
That also means that we don't need the projection coordinates
anymore. We can use the area extent instead.
Tests added
Tests passed
Passes
git diff origin/master **/*py | flake8 --diff