eemont.imagecollection.getTimeSeriesByRegion

eemont.imagecollection.getTimeSeriesByRegion(self, reducer, bands=None, geometry=None, scale=None, crs=None, crsTransform=None, bestEffort=False, maxPixels=1000000000000.0, tileScale=1, dateColumn='date', dateFormat='ISO', naValue=- 9999)[source]

Gets the time series by region for the given image collection and geometry (feature or feature collection are also supported) according to the specified reducer (or reducers).

Tip

Check more info about time series in the User Guide.

Parameters
  • self (ee.ImageCollection (this)) – Image collection to get the time series from.

  • reducer (ee.Reducer | list[ee.Reducer]) – Reducer or list of reducers to use for region reduction.

  • bands (str | list[str], default = None) – Selection of bands to get the time series from. Defaults to all bands in the image collection.

  • geometry (ee.Geometry | ee.Feature | ee.FeatureCollection, default = None) – Geometry to perform the region reduction. If ee.Feature or ee.FeatureCollection, the geometry() method is called. In order to get reductions by each feature please see the getTimeSeriesByRegions() method. Defaults to the footprint of the first band for each image in the collection.

  • scale (numeric, default = None) – Nomical scale in meters.

  • crs (Projection, default = None) – The projection to work in. If unspecified, the projection of the image’s first band is used. If specified in addition to scale, rescaled to the specified scale.

  • crsTransform (list, default = None) – The list of CRS transform values. This is a row-major ordering of the 3x2 transform matrix. This option is mutually exclusive with ‘scale’, and replaces any transform already set on the projection.

  • bestEffort (boolean, default = False) – If the polygon would contain too many pixels at the given scale, compute and use a larger scale which would allow the operation to succeed.

  • maxPixels (numeric, default = 1e12) – The maximum number of pixels to reduce.

  • tileScale (numeric, default = 1) – A scaling factor used to reduce aggregation tile size; using a larger tileScale (e.g. 2 or 4) may enable computations that run out of memory with the default.

  • dateColumn (str, default = 'date') – Output name of the date column.

  • dateFormat (str, default = 'ISO') – Output format of the date column. Defaults to ISO. Available options: ‘ms’ (for milliseconds), ‘ISO’ (for ISO Standard Format) or a custom format pattern.

  • naValue (numeric, default = -9999) – Value to use as NA when the region reduction doesn’t retrieve a value due to masked pixels.

Returns

Time series by region retrieved as a Feature Collection.

Return type

ee.FeatureCollection

See also

getTimeSeriesByRegions

Gets the time series by regions for the given image collection and feature collection according to the specified reducer (or reducers).

Examples

>>> import ee, eemont
>>> ee.Initialize()
>>> f1 = ee.Feature(ee.Geometry.Point([3.984770,48.767221]).buffer(50),{'ID':'A'})
>>> f2 = ee.Feature(ee.Geometry.Point([4.101367,48.748076]).buffer(50),{'ID':'B'})
>>> fc = ee.FeatureCollection([f1,f2])
>>> S2 = (ee.ImageCollection('COPERNICUS/S2_SR')
...      .filterBounds(fc)
...      .filterDate('2020-01-01','2021-01-01')
...      .maskClouds()
...      .scaleAndOffset()
...      .spectralIndices(['EVI','NDVI']))
>>> ts = S2.getTimeSeriesByRegion(reducer = [ee.Reducer.mean(),ee.Reducer.median()],
...                               geometry = fc,
...                               bands = ['EVI','NDVI'],
...                               scale = 10)