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 bbox creation for SwathDefinitions with NaNs #479

Merged
merged 1 commit into from
Nov 24, 2022

Conversation

djhoese
Copy link
Member

@djhoese djhoese commented Nov 19, 2022

I ran into this with some VIIRS data and some AVHRR data. In one case I had a couple rows/scans of data that had NaNs in them so some of the bbox coordinates were NaN. This resulted in bbox coordinates being returned, but being invalid (had NaNs). In another case the top couple scans of the swath were all NaNs so you'd get some hard to decipher error about NaN values. Sometimes these only made themselves obvious when you made a Boundary/Polygon and tried to do some calculation with them.

This PR fixes these cases or improves the error messages by removing any bbox points that have NaN for one of the coordinates.

CC @ghiggi

  • Tests added
  • Tests passed
  • Passes git diff origin/main **/*py | flake8 --diff

@djhoese djhoese added the bug label Nov 19, 2022
@djhoese djhoese self-assigned this Nov 19, 2022
@codecov
Copy link

codecov bot commented Nov 19, 2022

Codecov Report

Merging #479 (ac45d86) into main (80aeb8e) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #479      +/-   ##
==========================================
+ Coverage   94.31%   94.32%   +0.01%     
==========================================
  Files          74       74              
  Lines       12855    12890      +35     
==========================================
+ Hits        12124    12159      +35     
  Misses        731      731              
Flag Coverage Δ
unittests 94.32% <100.00%> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
pyresample/geometry.py 87.50% <100.00%> (+0.10%) ⬆️
pyresample/test/test_geometry.py 99.54% <100.00%> (+<0.01%) ⬆️

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

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 93.851% when pulling ac45d86 on djhoese:bugfix-swath-bbox-nans into 80aeb8e on pytroll:main.

Copy link
Member

@pnuu pnuu left a comment

Choose a reason for hiding this comment

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

LGTM

@djhoese djhoese merged commit 6dab372 into pytroll:main Nov 24, 2022
@djhoese djhoese deleted the bugfix-swath-bbox-nans branch November 24, 2022 15:28
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.

3 participants