pytroll / pyresample

Geospatial image resampling in Python
http://pyresample.readthedocs.org
GNU Lesser General Public License v3.0
344 stars 95 forks source link

Fix derivation of correct radius of influence when data layout is not standard #555

Open adybbroe opened 9 months ago

adybbroe commented 9 months ago

This is supposed to solve #554

Make use of the fact that longitudes are an xarray data array and use 'y' dimension for rows/scanlines

This makes the code resilient towards any other (awkward) data layout than the standard (where first dimension is usually the rows).

adybbroe commented 9 months ago

It looks like I can assume that self.lons is an Xarray DataArray, and never (just) a numpy array, correct?

djhoese commented 9 months ago

It looks like I can assume that self.lons is an Xarray DataArray, and never (just) a numpy array, correct?

For Satpy, yes, but we can't (and shouldn't) make that assumption for pyresample.

adybbroe commented 9 months ago

It looks like I can assume that self.lons is an Xarray DataArray, and never (just) a numpy array, correct?

For Satpy, yes, but we can't (and shouldn't) make that assumption for pyresample.

Ok, got me there then! I was looking for tests on that, but found only with xarray, but possible that I just overlooked such tests...

codecov[bot] commented 9 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (6a8afc0) 94.11% compared to head (a7650f4) 94.14%. Report is 11 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #555 +/- ## ========================================== + Coverage 94.11% 94.14% +0.03% ========================================== Files 82 84 +2 Lines 13078 13199 +121 ========================================== + Hits 12308 12426 +118 - Misses 770 773 +3 ``` | [Flag](https://app.codecov.io/gh/pytroll/pyresample/pull/555/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pytroll) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/pytroll/pyresample/pull/555/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pytroll) | `94.14% <100.00%> (+0.03%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pytroll#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

coveralls commented 9 months ago

Coverage Status

coverage: 93.725% (+0.04%) from 93.69% when pulling a7650f4c5725ccb3557ea381b3e8eb396d149259 on adybbroe:finding-geocentric-resolution-resilient-to-data-layout into 6a8afc0085e0b4269f00991ab79fe1b3766bb817 on pytroll:main.

adybbroe commented 9 months ago

@djhoese I made a comment in the issue: https://github.com/pytroll/pyresample/issues/554#issuecomment-1820556077

Which solution do you propose I pursue? And does @gerritholl and @mraspaud have opinions as well?