-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add Level-3 and Level-4 bands for Land Cover product. #161
Conversation
…rrestrial vegetation
…rrestrial vegetation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…t tests to dask arrays
for more information, see https://pre-commit.ci
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #161 +/- ##
===========================================
+ Coverage 80.02% 82.38% +2.35%
===========================================
Files 49 67 +18
Lines 4361 4951 +590
===========================================
+ Hits 3490 4079 +589
- Misses 871 872 +1 ☔ View full report in Codecov by Sentry. |
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.
as in individual comment
dtype="uint8", | ||
**{ | ||
"watseas_trh": water_seasonality_threshold, | ||
"watersea_nodata": WATER_FREQ_NODATA, |
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.
the correct nodata=255
from the raster, also it won't work as water_season_mask
has been converted to uint8
from last step, -999
was lost had it been the effective nodata
.
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.
Good point, refactored the code to effectively replace "nodata"
**{"_u": 210}, | ||
) | ||
|
||
intertidal_mask = expr_eval( |
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 mask is redundant.
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 mask is used in level4 water classification.
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.
I mean it's redundant in a sense that l3 and l4 doesn't have to be generated in that order. The water persistence and consequently l4 water classification can happen well ahead of l3 aggregation.
odc-stats/odc/stats/plugins/lc_level34.py
Line 92 in 40ab398
water_persistence = l4_water_persistence.water_persistence( |
odc-stats/odc/stats/plugins/lc_level34.py
Line 107 in 40ab398
level4 = l4_water.water_classification( |
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 is addressed now.
def bare_gradation(xx: xr.Dataset, bare_threshold, veg_cover): | ||
|
||
# Now add the bare gradation | ||
fcp_nodaata = -999 |
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.
is it a typo? I don't see anywhere changing the fcp nodata
value.
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.
I've removed the redundant statement.
) | ||
# Apply bare gradation expected output classes | ||
# Map bare gradation classes | ||
bs_mapping = {100: 10, 120: 12, 150: 15} |
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.
it might be easier to allocate a new array instead of the extra mapping, also reduce the confusion. It's bit hard to follow that it's essentially to avoid the mixing of small and big values in the original array.
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.
Agree. I've modified the code and deleted the mapping here and everywhere else.
|
||
# Define mapping from current output to expected a3 output | ||
# Map vegetation cover classes | ||
veg_mapping = {160: 16, 150: 15, 130: 13, 120: 12, 100: 10} |
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.
same as bare_gradition
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.
Deleted the mapping.
|
||
# Apply water persistence expcted classes | ||
# Map values to the classes expected in water persistence in land cover Level-4 output | ||
waterper_wat_mapping = {100: 1, 70: 7, 80: 8, 90: 9} |
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.
same as bare_gradition
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.
Deleted the mapping.
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
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.
let's roll see how it goes :)
This change will create the level4 and level3 land cover bands.
The fix_l3 will be applied on top of this PR which will fix the nodata issue. This fix will be applied to Level4 as well.
Links to definitions and thresholds used to generate level-4 bands:
https://bitbucket.org/au-eoed/livingearth_lccs/src/1e78111ead2feb1179bf9fb30f6e8744aed65886/colour_schemes/lccs_l4_colour_scheme_golden_dark_au.csv
https://knowledge.dea.ga.gov.au/data/product/dea-land-cover-landsat/?tab=details