diff --git a/geedim/image.py b/geedim/image.py index 18ea0d4..2ffd62d 100644 --- a/geedim/image.py +++ b/geedim/image.py @@ -608,10 +608,15 @@ def _get_image_masks(self, ee_image): shadow_azimuth = ee.Number(-90).add(ee.Number(ee_image.get("MEAN_SOLAR_AZIMUTH_ANGLE"))) min_scale = get_projection(ee_image).nominalScale() - # project the the cloud mask in the direction of sun's rays + # remove small clouds + cloud_mask_open = ( + cloud_mask.focal_min(self._buffer, "circle", "meters").focal_max(self._buffer, "circle", "meters") + ) + + # project the opened cloud mask in the direction of sun's rays (i.e. shadows) proj_dist_pix = ee.Number(self._cloud_proj_dist * 1000).divide(min_scale) # projection distance in pixels proj_cloud_mask = ( - cloud_mask.directionalDistanceTransform(shadow_azimuth, proj_dist_pix) + cloud_mask_open.directionalDistanceTransform(shadow_azimuth, proj_dist_pix) .select("distance") .mask() .rename("PROJ_CLOUD_MASK") diff --git a/geedim/version.py b/geedim/version.py index 0404d81..e1424ed 100644 --- a/geedim/version.py +++ b/geedim/version.py @@ -1 +1 @@ -__version__ = '0.3.0' +__version__ = '0.3.1'