Skip to content

Fix EWA ll2cr not handling non-C contiguous arrays#725

Merged
djhoese merged 3 commits into
pytroll:mainfrom
djhoese:bugfix-ll2cr-contig
May 21, 2026
Merged

Fix EWA ll2cr not handling non-C contiguous arrays#725
djhoese merged 3 commits into
pytroll:mainfrom
djhoese:bugfix-ll2cr-contig

Conversation

@djhoese
Copy link
Copy Markdown
Member

@djhoese djhoese commented May 20, 2026

CC @ameraner

In #723 it was pointed out that non-C contiguous lon/lat inputs to the EWA ll2cr function are not handled. This PR fixes this by specifying the order kwarg to astype as well as using numpy.require to force write-ability on the inputs. I think this preserves the existing functionality while handling more use cases.

The main complication here is that old ll2cr has an optimization if some users want to use it where results are written in-place on the lon/lat inputs to avoid making extra arrays. This of course completely overwrites the lon/lat data in the arrays and is why the default is to copy the data, but I'd still like to support this behavior if it can be used in the future.

@djhoese djhoese self-assigned this May 20, 2026
@djhoese djhoese added the bug label May 20, 2026
@djhoese djhoese changed the title Convert ll2cr tests to pytest Fix EWA ll2cr not handling non-C contiguous arrays May 20, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.68%. Comparing base (3b1287b) to head (6592fb9).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #725      +/-   ##
==========================================
+ Coverage   93.66%   93.68%   +0.02%     
==========================================
  Files          89       89              
  Lines       13707    13711       +4     
==========================================
+ Hits        12838    12845       +7     
+ Misses        869      866       -3     
Flag Coverage Δ
unittests 93.68% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

Copy link
Copy Markdown
Member

@ameraner ameraner left a comment

Choose a reason for hiding this comment

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

Thank you very much for the quick fix! It solves my issue.

Comment thread pyresample/ewa/ewa.py Outdated
@djhoese djhoese merged commit e0c6156 into pytroll:main May 21, 2026
26 checks passed
@djhoese djhoese deleted the bugfix-ll2cr-contig branch May 21, 2026 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EWA resampler fails (with METimage/VII data) with non-contiguous lonlat arrays

2 participants