geetools.ImageCollectionAccessor.groupInterval#

geetools.ImageCollectionAccessor.groupInterval(unit='month', duration=1)#

Transform the ImageCollection into a list of smaller collection of the specified duration.

For example using unit as “month” and duration as 1, the ImageCollection will be transformed into a list of ImageCollection with each ImageCollection containing images for each month. Make sure the collection is filtered beforeend to reduce the number of images that needs to be processed.

Parameters:
  • 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.

Returns:

A list of imagecollection grouped by interval

Return type:

ee.List

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

split = collection.geetools.groupInterval("month", 1)
print(split.getInfo())