Fix bbox creation for SwathDefinitions with NaNs #479
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
git diff origin/main **/*py | flake8 --diff