reduceInterval#
- geetools.ImageCollectionAccessor.reduceInterval(reducer='mean', unit='month', duration=1, keep_original_names=True)#
Reduce the images included in the same duration interval using the provided reducer.
For example using unit as “month” and duration as 1, the
ee.ImageCollectionwill be reduced into a newee.ImageCollectionwith each image containing the reduced values for each month. Make sure the collection is filtered beforehand to reduce the number of images that needs to be processed.- Parameters:
reducer (str | ee.Reducer) – The name of the reducer to use or a Reducer object. Default is
"mean".unit (str) – The unit of time to split the collection. Available units:
year,month,week,day,hour,minuteorsecond.duration (int) – The duration of each split.
keep_original_names (bool) – Whether to keep the original band names or not. This is a workaround to preserve older behaviour, it should disappear in the future.
- Returns:
A new
ee.ImageCollectionwith the reduced images.- Return type:
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())