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

feat: improve maskCover #349

Merged
merged 7 commits into from
Oct 24, 2024
Merged

feat: improve maskCover #349

merged 7 commits into from
Oct 24, 2024

Conversation

fitoprincipe
Copy link
Member

Originally, this function was designed to compute the percentage of masked pixels inside a geometry. This allows the user to compute a similar value to "CLOUD_COVER" property in Landsat scenes or "CLOUD_COVERAGE_ASSESSMENT" in Sentinel 2 scenes, but in a specific region instead of the whole scene. When creating composites we could discard "good" pixels if we filter the collection using the cloud cover property of the scene, but using this method we can discard pixels of regions with high percentage of masked pixels.

The method has been divided in two methods:

  • maskCoverRegion: computes the value using a ee.Geometry
  • maskCoverRegions: computes the value in each ee.Feature of a ee.FeatureCollection

This method can also be helpful in the creation of composites using unbounded images, like MODIS.

The param scale is to avoid using too much resources to compute this value when a rough computation is enough.

… a geometry. maskCoverRegions does the same but inside a FeatureCollection.
@fitoprincipe fitoprincipe requested a review from 12rambau October 22, 2024 03:20
geetools/Image.py Outdated Show resolved Hide resolved
geetools/Image.py Outdated Show resolved Hide resolved
geetools/Image.py Outdated Show resolved Hide resolved
geetools/Image.py Outdated Show resolved Hide resolved
tests/test_Image.py Show resolved Hide resolved
geetools/Image.py Show resolved Hide resolved
geetools/Image.py Show resolved Hide resolved
geetools/Image.py Show resolved Hide resolved
Copy link

codecov bot commented Oct 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.10%. Comparing base (86eb511) to head (84388f1).
Report is 45 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #349      +/-   ##
==========================================
- Coverage   91.16%   91.10%   -0.07%     
==========================================
  Files          26       27       +1     
  Lines        1415     1641     +226     
  Branches       68       75       +7     
==========================================
+ Hits         1290     1495     +205     
- Misses        108      127      +19     
- Partials       17       19       +2     

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

@12rambau 12rambau changed the title improve maskCover feeat,;:improve maskCover Oct 24, 2024
@12rambau 12rambau changed the title feeat,;:improve maskCover feat:improve maskCover Oct 24, 2024
@12rambau 12rambau changed the title feat:improve maskCover feat: improve maskCover Oct 24, 2024
@12rambau 12rambau merged commit 434cd40 into main Oct 24, 2024
11 of 12 checks passed
@12rambau 12rambau deleted the fix-mask-cover branch October 24, 2024 21:10
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.

2 participants