API Reference

gee_python_tools.landsat_composite

Collect annual composite Landsat Imagery.

gee_python_tools.landsat_composite.get_composite(aoi, foldername, filename, startdate, enddate)[source]

Create Landsat composite between specific dates.

Function to set up a Google Earth Engine task to generate a composite image for a specified timeframe within a year of the Landsat mission given some area of interest (aoi) and save the results in a Google Drive folder. The Landsat mission is automatically chosen to match the year specified, for overlapping years, the later mission data is used except in the case of Landsat7 which is avoided when possible.

Parameters
  • aoi (ee.Geometry.Polygon) – An earth engine polygon geometry defined for a given area of interest

  • foldername (str) – The name for the folder to generate in Google Drive

  • filename (str) – Name for the file in addition to the year which will be appeneded

  • startdate (str) – Start date for the composite time window. Format is YYYY-MM-DD. Min year is 1983 (Landsat4) max is 2020 (Landsat8).

  • enddate (str) – End date for the composite time window. Format is YYYY-MM-DD. enddate must be in the same year as startdate. Min year is 1983 (Landsat4) max is 2020 (Landsat8).

gee_python_tools.landsat_composite.get_data(aoi, name, LandsatMission='8')[source]

Create a Landsat annual composite task on Google Earth Engine.

Function to set up a Google Earth Engine task to generate a composite image from each year of a Landsat mission given some area of interest (aoi) and save the results in a Google Drive folder.

Parameters
  • LandsatMission (str) – A string of the LandSat Mission number e.g. ‘4’, ‘5’, ‘7’, or ‘8’

  • aoi (ee.Geometry.Polygon) – An earth engine polygon geometry defined for a given area of interest

  • name (str) – The name for the folder to generate in Google Drive

gee_python_tools.landsat_composite.get_one_year(aoi, foldername, filename, yr=2000)[source]

Create job for single year Landsat composite image from GEE.

Function to set up a Google Earth Engine task to generate a composite image from a specified year from the Landsat mission given some area of interest (aoi) and save the results in a Google Drive folder. The Landsat mission is automatically chosen to match the year specified, for overlapping years, the later mission data is used except in the case of Landsat7 which is avoided when possible.

Parameters
  • aoi (ee.Geometry.Polygon) – An earth engine polygon geometry defined for a given area of interest

  • foldername (str) – The name for the folder to generate in Google Drive

  • filename (str) – Name for the file in addition to the year which will be appeneded

  • yr (str) – Target year to acquire Landsat composite image. Default = year 2000. Min year is 1983 (Landsat4) max is 2020 (Landsat8).

gee_python_tools.cloudmask

These are cloud masking functions for surface reflectance (SR) data from qgis-earthengine-examples.

cloud masking function for surface reflectance (SR) data.

gee_python_tools.cloudmask.maskL457(image)[source]

Masking clouds from a Landsat 4,5, or 7 image.

Function for masking clouds from a Landsat 4,5, or 7 image.

Parameters

image (Landsat Image Object) – Input Landsat Image Object with the clouds. Should be from a Landsat Surface Reflectance dataset.

Returns

image – The same image with the clouds masked out.

Return type

Landsat Image Object

Example

collection = ee.ImageCollection(‘LANDSAT/LT05/C01/T1_SR’) .filterDate(‘2010-04-01’, ‘2010-07-30’)

composite = collection .map(maskL457) .median()

Maps the maskL457 function over a collection of Landsat 5 data and takes the median

gee_python_tools.cloudmask.maskL8(image)[source]

Masking clouds from a Landsat 8 image.

Function for masking clouds from a Landsat 8 image.

Parameters

image (Landsat Image Object) – Input Landsat Image Object with the clouds. Should be from a Landsat Surface Reflectance dataset.

Returns

image – The same image with the clouds masked out.

Return type

Landsat Image Object

Example

collection = ee.ImageCollection(‘LANDSAT/LC08/C01/T1_SR’) .filterDate(‘2016-01-01’, ‘2016-12-31’) .map(maskL8)

Maps the maskL8 function over a collection of Landsat 8 data and takes the median