-
Notifications
You must be signed in to change notification settings - Fork 0
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: address masking issues identified in #44 #45
Conversation
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.
This looks great! I really like the additional tests. I have only 1 completely ignorable comment that's perhaps a bit pedantic (not pydantic). Feel free to skip it.
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.
Fantastic!
Description
This PR is intended to address issues raised in #44, specifically,
-19_999
as a nodata value instead of-9999
because-9999
inside the valid range of normalized differenced indexes (which when scaled ranged from[-10_000, 10_000]
. This-19_999
was picked for consistency with the Landsat on-demand vegetation index products (e.g., Landsat NDVI)float64 -> int16
, specifically overflows that create a "wrap around" when downcasting.How I did it
masked_outside
tomasked_less_equal
and set<= 0
masked_outside
tomasked_less_equal
, which no longer masks >100% reflectancefill_value
perIndex
enum member, set this fill value when calculating the index, and write the GeoTIFF with the fill value (-19_999
)For the issue with wraparound when downcasting, the example in test data was for EVI which can exceed
[-10,000, 10,000]
because it is not normalized. Consider this example from one of the granules in the test dataset,How you can test it