:py:mod:`statgis.gee.sentinel_functions` ======================================== .. py:module:: statgis.gee.sentinel_functions .. autoapi-nested-parse:: Function to process Sentinel-2 images. Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: statgis.gee.sentinel_functions.scaler statgis.gee.sentinel_functions.cloud_mask .. py:function:: scaler(image: ee.Image) -> ee.Image Scale bands from Sentinel-2 image. :param image: Sentinel-2 image to scale. :type image: ee.Image :returns: **image** -- Image with bands scaled. :rtype: ee.Image .. rubric:: Example Scale an image: >>> import ee >>> from statgis.gee import sentinel_functions >>> ee.Initialize() >>> poi = ee.Geometry.Point(-75.6636142, 6.2443677) >>> image = ( ... ee.ImageCollection("COPERNICUS/S2_SR_HARMONIZED") ... .filterBounds(poi) ... .first() ... ) >>> image = sentinel_functions.scaler(image) Scale all image from a collection: >>> import ee >>> from statgis.gee import sentinel_functions >>> ee.Initialize() >>> poi = ee.Geometry.Point(-75.6636142, 6.2443677) >>> image_collection = ( ... ee.ImageCollection("COPERNICUS/S2_SR_HARMONIZED") ... .filterBounds(poi) ... .map(sentinel_functions.scaler) ... ) .. py:function:: cloud_mask(image: ee.Image) -> ee.Image Mask clouds from Sentinel-2 image using QA60 band. :param Image: Image to mask. :type Image: ee.Image :returns: **Image** -- Masked image. :rtype: ee.Image .. rubric:: Example Mask clouds in an image: >>> import ee >>> from statgis.gee import sentinel_functions >>> ee.Initialize() >>> poi = ee.Geometry.Point(-75.6636142, 6.2443677) >>> image = ( ... ee.ImageCollection("COPERNICUS/S2_SR_HARMONIZED") ... .filterBounds(poi) ... .first() ... ) >>> image = sentinel_functions.cloud_mask(image) Mask all clouds in an image collection: >>> import ee >>> from statgis.gee import sentinel_functions >>> ee.Initialize() >>> poi = ee.Geometry.Point(-75.6636142, 6.2443677) >>> image_collection = ( ... ee.ImageCollection("COPERNICUS/S2_SR_HARMONIZED") ... .filterBounds(poi) ... .map(sentinel_functions.cloud_mask) ... )