pytroll / pyresample

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

Fix for duplicate coordinates in bbox_lonlats for geostationary area #475

Closed ghiggi closed 1 year ago

ghiggi commented 1 year ago

This PR removes the presence of duplicate consecutive coordinates in the geostationary are bbox/polygon. This currently leads to the creation of SArcs that are actually points, and also leads to cross-product operations that lead to cartesian [0,0,0] and thus vector norm = 0 and thus division by 0 when normalizing.

Furthermore, it closes #474: when we retrieve 4 vertices we now get the 4 correct geos_area "extent" coordinates.

codecov[bot] commented 1 year ago

Codecov Report

Merging #475 (d22496f) into main (1268d90) will decrease coverage by 0.04%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #475      +/-   ##
==========================================
- Coverage   94.28%   94.24%   -0.05%     
==========================================
  Files          69       73       +4     
  Lines       12394    12703     +309     
==========================================
+ Hits        11686    11972     +286     
- Misses        708      731      +23     
Flag Coverage Δ
unittests 94.24% <100.00%> (-0.05%) :arrow_down:

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

Impacted Files Coverage Δ
pyresample/geometry.py 87.17% <100.00%> (ø)
pyresample/test/test_geometry.py 99.51% <100.00%> (ø)
pyresample/spherical.py 92.67% <0.00%> (-5.55%) :arrow_down:
pyresample/test/test_spherical.py 100.00% <0.00%> (ø)
pyresample/future/spherical/point.py 100.00% <0.00%> (ø)
pyresample/future/spherical/__init__.py 100.00% <0.00%> (ø)
pyresample/test/test_sgeom/__init__.py 100.00% <0.00%> (ø)
pyresample/test/test_sgeom/test_point.py 100.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

coveralls commented 1 year ago

Coverage Status

Coverage decreased (-0.03%) to 93.761% when pulling d22496f2d4bc98d8a60722f1ceec6948625a51e6 on ghiggi:bugfix-duplicate-geo-bbox-lonlats into 1268d904c9bcd01342173dcee73809da59cc79c1 on pytroll:main.

djhoese commented 1 year ago

Some of the uncovered lines that coveralls is complaining about are a little concerning, but I assume you'll be working with this in the upcoming PRs so I'm not too worried. Most of the missed lines are the matplotlib plotting code which is annoying to test anyway. The one concerning one is the vertices to xyz helper function. The branch with the .T is reported as uncovered. Let's merge this for now and have you work on covering that line in one of the other PRs.