Skip to content
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 calculating area slices for flipped projections #277

Merged
merged 5 commits into from
May 11, 2020

Conversation

pnuu
Copy link
Member

@pnuu pnuu commented May 8, 2020

This fixes a segmentation fault for Satpy data reduction when the source area is flipped and GEO data has space surrounding the full disk data. In this case pykdtree was passed coordinates that were inf which causes segmentation fault.

@pnuu pnuu added the bug label May 8, 2020
@pnuu pnuu self-assigned this May 8, 2020
@coveralls
Copy link

coveralls commented May 8, 2020

Coverage Status

Coverage increased (+0.0002%) to 91.947% when pulling a20b247 on pnuu:debug-kdtree-segfault into b7c769b on pytroll:master.

@codecov
Copy link

codecov bot commented May 8, 2020

Codecov Report

Merging #277 into master will increase coverage by 0.89%.
The diff coverage is 95.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #277      +/-   ##
==========================================
+ Coverage   91.94%   92.83%   +0.89%     
==========================================
  Files          42       42              
  Lines        8183     9427    +1244     
==========================================
+ Hits         7524     8752    +1228     
- Misses        659      675      +16     
Impacted Files Coverage Δ
pyresample/geometry.py 86.12% <93.33%> (+3.56%) ⬆️
pyresample/test/test_geometry.py 98.64% <100.00%> (+0.89%) ⬆️
pyresample/test/test_kd_tree.py 97.01% <100.00%> (-0.27%) ⬇️
pyresample/bucket/__init__.py 98.59% <0.00%> (-0.33%) ⬇️
pyresample/test/utils.py 71.07% <0.00%> (-0.21%) ⬇️
pyresample/test/test_grid.py 100.00% <0.00%> (ø)
pyresample/test/test_bucket.py 100.00% <0.00%> (ø)
pyresample/test/test_utils.py 97.89% <0.00%> (+0.51%) ⬆️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b7c769b...a20b247. Read the comment docs.

@gerritholl
Copy link
Collaborator

I tested this with my example and I no longer get a segmentation fault. It successfully generates this image:

ir_123

Using:

from satpy import Scene
from satpy.utils import debug_on
debug_on()
from glob import glob
sc = Scene(glob("/media/nas/x21308/2020_04_MTG_unofficial_Testdata/20130804_RC72/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+FCI-1C-RRAD-FDHSI-FD--CHK-BODY--L2P-NC4E_C_EU*.nc"), reader="fci_l1c_fdhsi")
sc.load(["ir_123"])
nsc = sc.resample("fci_0deg_2km")
nsc["ir_123"].compute()
nsc.save_dataset("ir_123", "/tmp/ir_123.png")

@@ -902,7 +902,7 @@ def test_nearest_area_2d_to_area_1n_no_roi(self):
self.assertIsInstance(res.data, da.Array)
res = res.values
cross_sum = np.nansum(res)
expected = 32114793.0
expected = 87281406.0
Copy link
Member

Choose a reason for hiding this comment

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

What happened here?

Copy link
Member

Choose a reason for hiding this comment

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

Oh this is my change from #265

@pnuu pnuu requested a review from mraspaud May 11, 2020 04:55
Copy link
Member

@mraspaud mraspaud left a comment

Choose a reason for hiding this comment

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

LGTM

@mraspaud mraspaud merged commit f661cf9 into pytroll:master May 11, 2020
@pnuu pnuu deleted the debug-kdtree-segfault branch May 11, 2020 07:48
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.

5 participants