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 AreaDefinition array index methods mishandling outer edge values #596

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

djhoese
Copy link
Member

@djhoese djhoese commented Apr 26, 2024

An attempt to fix ssec/polar2grid#691

Basically, current bounding operations via get_area_slices have trouble when the resulting lon/lat extents match almost exactly with the source area definition. This PR should fix a couple important bugs in the array index retrieval methods of the AreaDefinition:

  1. Floating point precision issues where a X coordinate that is just outside the area (a float precision different) can still be considered part of the area (not masked).
  2. Not including -0.5 to 0.0 pixel indexes as "0" (it is the left most part of the left most pixels.
  3. Including an extra 0.5 pixels on the right of the area.

Locally I see one failure where my particular approach has changed the underlying value for elements that are masked and this test specifically checks that that doesn't happen (they stay unchanged).

  • Closes #xxxx
  • Tests added
  • Tests passed
  • Passes git diff origin/main **/*py | flake8 --diff
  • Fully documented

@djhoese djhoese added the bug label Apr 26, 2024
@djhoese djhoese requested review from mraspaud and pnuu April 26, 2024 02:50
@djhoese djhoese self-assigned this Apr 26, 2024
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.

Problems running geo2grid.sh on RadM1 imagery from 08Apr2024?
1 participant