<jupyter_start><jupyter_text>Mask CoverPercentage of masked pixels<jupyter_code>import ee
ee.Initialize()
from geetools import algorithms, ui, cloud_mask, tools
from ipygee import *<jupyter_output><empty_output><jupyter_text>Area of Interest<jupyter_code>p = ee.Geometry.Point([-71.33972167968751, -42.737619925503054])
aoi = p.buffer(8000).bounds()<jupyter_output><empty_output><jupyter_text>Masked image<jupyter_code>i = ee.Image('COPERNICUS/S2/20181122T142749_20181122T143353_T18GYT')
masked = cloud_mask.sentinel2()(i)
masked = masked.clip(aoi)<jupyter_output><empty_output><jupyter_text>Compute Mask Cover<jupyter_code>cover = algorithms.maskCover(masked, aoi, 10)
eprint(cover.get('MASK_COVER'))<jupyter_output><empty_output><jupyter_text>Show Image on Map<jupyter_code>Map = Map()
Map.show()
vis = {'bands': ['B8', 'B11','B4'], 'min':0, 'max':5000}
Map.addLayer(masked, vis, 'Masked image')
Map.centerObject(aoi)<jupyter_output><empty_output><jupyter_text>Make it an image band<jupyter_code>metadata = cover.metadata('MASK_COVER')
tools.image.getValue(metadata, aoi.centroid(1), 10, side='client')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14638447971781304, 'fraction_numerical': 0.07319223985890652, 'mean_word_length': 11.204301075268818, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '160105', 'license': 'MIT', 'n_tokens_mistral': 507, 'n_tokens_neox': 454, 'n_words': 61, 'path': 'notebooks/algorithms/mask_cover.ipynb', 'repo_name': 'hubert-thieriot/gee_tools', 'size': '1134'}