geetools.ImageCollection.ImageCollectionAccessor.reduceInterval#
- geetools.ImageCollection.ImageCollectionAccessor.reduceInterval(reducer='mean', unit='month', duration=1, qualityBand='')#
Reduce the images included in the same duration interval using the provided reducer.
For example using unit as “month” and duration as 1, the ImageCollection will be reduced into a new ImageCollection with each image containing the reduced values for each month. Make sure the collection is filtered beforeend to reduce the number of images that needs to be processed.
- Parameters:
reducer (str) – The reducer to use. Default is “mean”. Available reducers: “mean”, “median”, “max”, “min”, “sum”, “stdDev”, “count”, “product”, “first”, “mosaic”, “qualityMosaic” or “last”.
unit (str) – The unit of time to split the collection. Available units: ‘year’, ‘month’, ‘week’, ‘day’, ‘hour’, ‘minute’ or ‘second’.
duration (int) – The duration of each split.
qualityBand (str) – The band to use as quality band. Only available for “qualityMosaic” reducer.
- Returns:
A new ImageCollection with the reduced images.
- Return type:
ee.ImageCollection
Examples
import ee, geetools ee.Initialize() collection = ( ee.ImageCollection("LANDSAT/LC08/C01/T1_TOA") .filterBounds(ee.Geometry.Point(-122.262, 37.8719)) .filterDate("2014-01-01", "2014-12-31") ) reduced = collection.geetools.reduceInterval("mean", "month", 1) print(reduced.getInfo())