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 Scene.coarsest/finest_area not returning consistent results #2098
Conversation
…esolution is equal
…aths with equal shapes
Codecov Report
@@ Coverage Diff @@
## main #2098 +/- ##
=======================================
Coverage 93.89% 93.90%
=======================================
Files 283 283
Lines 42589 42615 +26
=======================================
+ Hits 39991 40017 +26
Misses 2598 2598
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for reorganising the tests too!
In rare cases some readers return multiple AreaDefinitions or SwathDefinitions of the same resolution, but with different coordinates. The case I ran into is the AMSR2 sensor with its A and B views. They have the same resolution (shape), but are slightly shifted from one another. Having Scene.coarsest_area and Scene.finest_area return either one of these is fine, but you run into issues if they are not consistent. In my case I was using the result to freeze a
DynamicAreaDefinition
and then compare my final geotiffs against expected results. Currently the Scene's choice between the A and B geometries is based on the order that the DataArrays is sorted which is essentially random. My tests would sometimes match and sometimes not match depending on what order was ultimately used.This PR fixes this to include other properties of the geometry objects to decide which one should be returned. It isn't perfect, especially when it comes to SwathDefinitions, but it is a start.
AUTHORS.md
if not there already