Skip to content

Fixed a half-pixel shift in affine transformation#20

Merged
konstntokas merged 7 commits into
mainfrom
konstntokas-xxx-make_rectification_faster
Jan 26, 2026
Merged

Fixed a half-pixel shift in affine transformation#20
konstntokas merged 7 commits into
mainfrom
konstntokas-xxx-make_rectification_faster

Conversation

@konstntokas

@konstntokas konstntokas commented Jan 12, 2026

Copy link
Copy Markdown
Collaborator
  • Bug fix in affine transformations.
    Fixed a half-pixel shift that occurred in xcube_resampling.affine_transform_dataset
    and xcube_resampling.resample_in_space when the source and target grid mappings
    shared the same CRS and were regular.

Little example

We create a coarse small dataset:

Screenshot from 2026-01-08 14-44-54

Now, we interpolate this dataset to a fine grid (affine transformation)

Old verson:
Screenshot from 2026-01-08 14-45-06

With the changes in this PR:
Screenshot from 2026-01-08 14-45-24

new_version.ipynb
old_version.ipynb

Checklist:

  • Add unit tests and/or doctests in docstrings
  • Add docstrings and API docs for any new/modified user-facing classes and functions
  • New/modified features documented in docs/
  • Changes documented in CHANGES.md
  • CI checks pass
  • Test coverage remains or increases (target 100%)

@codecov

codecov Bot commented Jan 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.85%. Comparing base (c429669) to head (edcee1b).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #20   +/-   ##
=======================================
  Coverage   98.85%   98.85%           
=======================================
  Files          22       22           
  Lines        2182     2183    +1     
=======================================
+ Hits         2157     2158    +1     
  Misses         25       25           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@konstntokas
konstntokas requested a review from b-yogesh January 12, 2026 10:55

@b-yogesh b-yogesh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Please look at my questions. Also, please change the title of this PR.

Comment thread xcube_resampling/gridmapping/base.py
Comment thread xcube_resampling/gridmapping/helpers.py Outdated
Comment thread xcube_resampling/reproject.py
Comment thread tests/gridmapping/test_dataset.py
@konstntokas konstntokas changed the title Konstntokas xxx make rectification faster Fixed a half-pixel shift in affine transformation Jan 19, 2026
@konstntokas
konstntokas requested a review from b-yogesh January 19, 2026 13:56
@konstntokas
konstntokas merged commit e5766f3 into main Jan 26, 2026
3 checks passed
@konstntokas
konstntokas deleted the konstntokas-xxx-make_rectification_faster branch January 26, 2026 11:30
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

Successfully merging this pull request may close these issues.

2 participants