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

correct veg/non logic in landcover veg frequency #176

Merged
merged 2 commits into from
Dec 6, 2024
Merged

Conversation

emmaai
Copy link
Contributor

@emmaai emmaai commented Dec 5, 2024

As the title. It removed the "likely water" -> non-veg, introduced consecutive observations of non-veg < threshold(2) -> veg. The earlier caused bare soil along water edges, where wo summaries don't have clear enough data to tell for sure if it's water, consequently it'll be non-water, non-water + non-veg -> bare soil. The absence of later would cause similar problem, where a water - veg - water - veg sequence would cause a pixel to be bare soil. It's very rare to have soil - veg - soil - veg sequence after the sanity check on the results of first implementation, and intuitively. The condition was also used in c2, though back to the time, there didn't seem to make any statistical difference to classify dry pixels either way. Now the pro of having the condition clearly out-weighted con, decide to introduce it now.

@emmaai emmaai requested review from JM-GA and tebadi December 5, 2024 05:21
Copy link

codecov bot commented Dec 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.20%. Comparing base (d04b1c0) to head (b72dcb7).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #176      +/-   ##
===========================================
- Coverage    81.20%   81.20%   -0.01%     
===========================================
  Files           50       50              
  Lines         4528     4522       -6     
===========================================
- Hits          3677     3672       -5     
+ Misses         851      850       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

# implies any "wet" area potentially veg

max_count_veg = expr_eval(
"where((a<_v)&(b<_v), _v, b)",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this < or <=?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strictly less, it's specific for the pattern of non-veg - veg - non-veg - veg

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for confirming this


# consecutive observation of non-veg
non_veg_data = expr_eval(
"where(a<nodata, 1-a, nodata)",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why it's 1-a

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1: veg 0: non-veg. after flipping 1: non-veg, 0: veg, easier to use same function to calculate monthly median.

@emmaai emmaai merged commit 97df5ad into develop Dec 6, 2024
5 checks passed
@emmaai emmaai deleted the fix_veg_non branch December 6, 2024 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants