eemont.image.maskClouds

eemont.image.maskClouds(self, method='cloud_prob', prob=60, maskCirrus=True, maskShadows=True, scaledImage=False, dark=0.15, cloudDist=1000, buffer=250, cdi=None)[source]

Masks clouds and shadows in an image (valid just for Surface Reflectance products).

Tip

Check more info about the supported platforms and clouds masking in the User Guide.

Parameters
  • self (ee.Image [this]) – Image to mask.

  • method (string, default = 'cloud_prob') –

    Method used to mask clouds.

    Available options:
    • ’cloud_prob’ : Use cloud probability.

    • ’qa’ : Use Quality Assessment band.

    This parameter is ignored for Landsat products.

  • prob (numeric [0, 100], default = 60) – Cloud probability threshold. Valid just for method = ‘prob’. This parameter is ignored for Landsat products.

  • maskCirrus (boolean, default = True) – Whether to mask cirrus clouds. Valid just for method = ‘qa’. This parameter is ignored for Landsat products.

  • maskShadows (boolean, default = True) – Whether to mask cloud shadows. For more info see ‘Braaten, J. 2020. Sentinel-2 Cloud Masking with s2cloudless. Google Earth Engine, Community Tutorials’.

  • scaledImage (boolean, default = False) – Whether the pixel values are scaled to the range [0,1] (reflectance values). This parameter is ignored for Landsat products.

  • dark (float [0,1], default = 0.15) – NIR threshold. NIR values below this threshold are potential cloud shadows. This parameter is ignored for Landsat products.

  • cloudDist (int, default = 1000) – Maximum distance in meters (m) to look for cloud shadows from cloud edges. This parameter is ignored for Landsat products.

  • buffer (int, default = 250) – Distance in meters (m) to dilate cloud and cloud shadows objects. This parameter is ignored for Landsat products.

  • cdi (float [-1,1], default = None) – Cloud Displacement Index threshold. Values below this threshold are considered potential clouds. A cdi = None means that the index is not used. For more info see ‘Frantz, D., HaS, E., Uhl, A., Stoffels, J., Hill, J. 2018. Improvement of the Fmask algorithm for Sentinel-2 images: Separating clouds from bright surfaces based on parallax effects. Remote Sensing of Environment 2015: 471-481’. This parameter is ignored for Landsat products.

Returns

Cloud-shadow masked image.

Return type

ee.Image

Notes

This method may mask water as well as clouds for the Sentinel-3 Radiance product.

Examples

>>> import ee, eemont
>>> ee.Authenticate()
>>> ee.Initialize()
>>> S2 = ee.ImageCollection('COPERNICUS/S2_SR').first().maskClouds(prob = 75,buffer = 300,cdi = -0.5)