eemont

ee.Image

eemont.image.index(self, index='NDVI', G=2.5, C1=6.0, C2=7.5, L=1.0)[source]

Computes one or more spectral indices (indices are added as bands) for an image.

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

    Image to compute indices on. Must be scaled to [0,1].

    Supported platforms:
    • Sentinel-2

    • Landsat 8

    • Landsat 7

    • Landsat 5

    • Landsat 4

  • index (string | list[string], default = 'NDVI') –

    Index or list of indices to compute.

    Available options:
    • ’vegetation’ : Compute all vegetation indices.

    • ’burn’ : Compute all burn indices.

    • ’water’ : Compute all water indices.

    • ’all’ : Compute all indices listed below.

    Vegetation indices:
    • ’BNDVI’ : Blue Normalized Difference Vegetation Index.

    • ’CIG’ : Chlorophyll Index - Green.

    • ’CVI’ : Chlorophyll Vegetation Index.

    • ’EVI’ : Enhanced Vegetation Index.

    • ’GNDVI’ : Green Normalized Difference Vegetation Index.

    • ’NDVI’ : Normalized Difference Vegetation Index.

    • ’NGRDI’ : Normalized Green Red Difference Index.

    • ’SAVI’ : Soil-Adjusted Vegetation Index.

    • ’SR’ : Simple Ratio.

    Burn and fire indices:
    • ’BAI’ : Burned Area Index.

    • ’BAIS2’ : Burned Area Index for Sentinel 2.

    • ’NBR’ : Normalized Burn Ratio.

    Water indices:
    • ’MNDWI’ : Modified Normalized Difference Water Index.

    • ’NDWI’ : Normalized Difference Water Index.

  • G (float, default = 2.5) – Gain factor. Used just for index = ‘EVI’.

  • C1 (float, default = 6.0) – Coefficient 1 for the aerosol resistance term. Used just for index = ‘EVI’.

  • C2 (float, default = 7.5) – Coefficient 2 for the aerosol resistance term. Used just for index = ‘EVI’.

  • L (float, default = 1.0) – Canopy background adjustment. Used just for index = [‘EVI’,’SAVI’].

Returns

Image with the computed spectral index, or indices, as new bands.

Return type

ee.Image

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).

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

    Image to mask.

    Supported platforms:
    • Sentinel-2

    • Landsat 8

    • Landsat 7

    • Landsat 5

    • Landsat 4

  • 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

eemont.image.scale(self)[source]

Scales bands on an image.

Parameters

self (ee.Image [this]) – Image to scale. Supported platforms: ‘COPERNICUS/S3’, ‘COPERNICUS/S2’, ‘COPERNICUS/S2_SR’, ‘LANDSAT/LC08’, ‘LANDSAT/LC08_SR’, ‘LANDSAT/LE07’, ‘LANDSAT/LE07_SR’, ‘LANDSAT/LT05’, ‘LANDSAT/LT05_SR’, ‘LANDSAT/LT04’, ‘LANDSAT/LT04_SR’, ‘MODIS/006/MCD43A4’, ‘MODIS/006/MCD43A3’, ‘MODIS/006/MOD09GQ’, ‘MODIS/006/MOD10A1’, ‘MODIS/006/MOD11A1’, ‘MODIS/006/MOD09GA’, ‘MODIS/006/MODOCGA’, ‘MODIS/006/MOD14A1’, ‘MODIS/006/MCD43A1’, ‘MODIS/006/MCD15A3H’, ‘MODIS/006/MOD09Q1’, ‘MODIS/006/MOD09A1’, ‘MODIS/006/MOD11A2’, ‘MODIS/006/MOD17A2H’, ‘MODIS/006/MOD16A2’, ‘MODIS/006/MOD13Q1’, ‘MODIS/006/MOD13A1’, ‘MODIS/006/MOD13A2’, ‘MODIS/061/MOD08_M3’, ‘MODIS/006/MOD17A3HGF’.

Returns

Scaled image.

Return type

ee.Image

ee.ImageCollection

eemont.imagecollection.closest(self, date)[source]

Gets the closest image (or set of images if the collection intersects a region that requires multiple scenes) closest to the specified date.

Parameters
  • self (ee.ImageCollection [this]) – Image Collection from which to get the closest image to the specified date.

  • date (ee.Date | string) – Date of interest. The method will look for images closest to this date.

Returns

Closest images to the specified date.

Return type

ee.ImageCollection

eemont.imagecollection.index(self, index='NDVI', G=2.5, C1=6.0, C2=7.5, L=1.0)[source]

Computes one or more spectral indices (indices are added as bands) for an image collection.

Parameters
  • self (ee.ImageCollection) –

    Image collection to compute indices on. Must be scaled to [0,1].

    Supported platforms:
    • Sentinel-2

    • Landsat 8

    • Landsat 7

    • Landsat 5

    • Landsat 4

  • index (string | list[string], default = 'NDVI') –

    Index or list of indices to compute.

    Available options:
    • ’vegetation’ : Compute all vegetation indices.

    • ’burn’ : Compute all burn indices.

    • ’water’ : Compute all water indices.

    • ’all’ : Compute all indices listed below.

    Vegetation indices:
    • ’BNDVI’ : Blue Normalized Difference Vegetation Index.

    • ’CIG’ : Chlorophyll Index - Green.

    • ’CVI’ : Chlorophyll Vegetation Index.

    • ’EVI’ : Enhanced Vegetation Index.

    • ’GNDVI’ : Green Normalized Difference Vegetation Index.

    • ’NDVI’ : Normalized Difference Vegetation Index.

    • ’NGRDI’ : Normalized Green Red Difference Index.

    • ’SR’ : Simple Ratio.

    • ’SAVI’ : Soil-Adjusted Vegetation Index.

    Burn and fire indices:
    • ’BAI’ : Burned Area Index.

    • ’BAIS2’ : Burned Area Index for Sentinel 2.

    • ’NBR’ : Normalized Burn Ratio.

    Water indices:
    • ’MNDWI’ : Modified Normalized Difference Water Index.

    • ’NDWI’ : Normalized Difference Water Index.

  • G (float, default = 2.5) – Gain factor. Used just for index = ‘EVI’.

  • C1 (float, default = 6.0) – Coefficient 1 for the aerosol resistance term. Used just for index = ‘EVI’.

  • C2 (float, default = 7.5) – Coefficient 2 for the aerosol resistance term. Used just for index = ‘EVI’.

  • L (float, default = 1.0) – Canopy background adjustment. Used just for index = [‘EVI’,’SAVI’].

Returns

Image collection with the computed spectral index, or indices, as new bands.

Return type

ee.ImageCollection

eemont.imagecollection.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 collection (valid just for Surface Reflectance products).

Parameters
  • self (ee.ImageCollection [this]) –

    Image collection to mask.

    Supported platforms:
    • Sentinel-2

    • Landsat 8

    • Landsat 7

    • Landsat 5

    • Landsat 4

  • 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 collection.

Return type

ee.ImageCollection

eemont.imagecollection.scale(self)[source]

Scales bands on an image collection.

Parameters

self (ee.ImageCollection (this)) – Image collection to scale. Supported platforms: ‘COPERNICUS/S3’, ‘COPERNICUS/S2’, ‘COPERNICUS/S2_SR’, ‘LANDSAT/LC08’, ‘LANDSAT/LC08_SR’, ‘LANDSAT/LE07’, ‘LANDSAT/LE07_SR’, ‘LANDSAT/LT05’, ‘LANDSAT/LT05_SR’, ‘LANDSAT/LT04’, ‘LANDSAT/LT04_SR’, ‘MODIS/006/MCD43A4’, ‘MODIS/006/MCD43A3’, ‘MODIS/006/MOD09GQ’, ‘MODIS/006/MOD10A1’, ‘MODIS/006/MOD11A1’, ‘MODIS/006/MOD09GA’, ‘MODIS/006/MODOCGA’, ‘MODIS/006/MOD14A1’, ‘MODIS/006/MCD43A1’, ‘MODIS/006/MCD15A3H’, ‘MODIS/006/MOD09Q1’, ‘MODIS/006/MOD09A1’, ‘MODIS/006/MOD11A2’, ‘MODIS/006/MOD17A2H’, ‘MODIS/006/MOD16A2’, ‘MODIS/006/MOD13Q1’, ‘MODIS/006/MOD13A1’, ‘MODIS/006/MOD13A2’, ‘MODIS/061/MOD08_M3’, ‘MODIS/006/MOD17A3HGF’.

Returns

Scaled image collection.

Return type

ee.ImageCollection

pd.DataFrame

eemont.dataframe.toFeatureCollection(self, latitude=None, longitude=None)[source]

Converts a pd.DataFrame object into an ee.FeatureCollection object. If lat/lon coordinates are available, the Data Frame can be converted into a Feature Collection with an associated geometry.

Parameters
  • self (pd.DataFrame [this]) – Data Frame to convert into a Feature Collection.

  • latitude (string) – Name of a latitude column, if available. Coupled with a longitude column, an ee.Geometry.Point is created and associated to each Feature.

  • longitude (string) – Name of a longitude column, if available. Coupled with a latitude column, an ee.Geometry.Point is created and associated to each Feature.

Returns

Data Frame converted into a Feature Collection.

Return type

ee.FeatureCollection