ipygee.ee_image_collection ========================== .. py:module:: ipygee.ee_image_collection .. autoapi-nested-parse:: Toolbox for the :py:class:`ee.ImageCollection` class. Attributes ---------- .. autoapisummary:: ipygee.ee_image_collection.EE_DATE_FORMAT ipygee.ee_image_collection.PY_DATE_FORMAT Classes ------- .. autoapisummary:: ipygee.ee_image_collection.ImageCollectionAccessor Module Contents --------------- .. py:class:: ImageCollectionAccessor(obj) Initialize the ImageCollectionAccessor class. .. py:method:: plot_dates_by_bands(region, reducer = 'mean', dateProperty = 'system:time_start', bands = None, labels = None, colors = None, figure = None, scale = 10000, crs = None, crsTransform = None, bestEffort = False, maxPixels = 10**7, tileScale = 1) Plot the reduced data for each image in the collection by bands on a specific region. This method is plotting the reduced data for each image in the collection by bands on a specific region. :param region: The region to reduce the data on. :param reducer: The name of the reducer or a reducer object to use. Default is ``"mean"``. :param dateProperty: The property to use as date for each image. Default is ``"system:time_start"``. :param bands: The bands to reduce. If empty, all bands are reduced. :param labels: The labels to use for the bands. If empty, the bands names are used. :param colors: The colors to use for the bands. If empty, the default colors are used. :param figure: The bokeh figure to plot the data on. If None, a new figure is created. :param scale: The scale in meters to use for the reduction. default is 10000m :param crs: 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. :param crsTransform: 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. :param bestEffort: 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. :param maxPixels: The maximum number of pixels to reduce. Defaults to 1e7. :param tileScale: A scaling factor between 0.1 and 16 used to adjust aggregation tile size; setting a larger tileScale (e.g., 2 or 4) uses smaller tiles and may enable computations that run out of memory with the default. :returns: A bokeh figure with the reduced values for each band and each date. .. rubric:: Examples .. code-block:: python 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") ) region = ee.Geometry.Point(-122.262, 37.8719).buffer(10000) collection.geetools.plot_dates_by_bands(region, "mean", 10000, "system:time_start") .. py:method:: plot_dates_by_regions(band, regions, label = 'system:index', reducer = 'mean', dateProperty = 'system:time_start', colors = None, figure = None, scale = 10000, crs = None, crsTransform = None, tileScale = 1) Plot the reduced data for each image in the collection by regions for a single band. This method is plotting the reduced data for each image in the collection by regions for a single band. :param band: The band to reduce. :param regions: The regions to reduce the data on. :param label: The property to use as label for each region. Default is ``"system:index"``. :param reducer: The name of the reducer or a reducer object to use. Default is ``"mean"``. :param dateProperty: The property to use as date for each image. Default is ``"system:time_start"``. :param colors: The colors to use for the regions. If empty, the default colors are used. :param figure: The bokeh figure to plot the data on. If None, a new figure is created. :param scale: The scale in meters to use for the reduction. default is 10000m :param crs: 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. :param crsTransform: 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. :param tileScale: A scaling factor between 0.1 and 16 used to adjust aggregation tile size; setting a larger tileScale (e.g., 2 or 4) uses smaller tiles and may enable computations that run out of memory with the default. :returns: A bokeh figure with the reduced values for each region and each date. .. rubric:: Examples .. code-block:: python 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") ) regions = ee.FeatureCollection([ ee.Feature(ee.Geometry.Point(-122.262, 37.8719).buffer(10000), {"name": "region1"}), ee.Feature(ee.Geometry.Point(-122.262, 37.8719).buffer(20000), {"name": "region2"}) ]) collection.geetools.plot_dates_by_regions("B1", regions, "name", "mean", 10000, "system:time_start") .. py:method:: plot_doy_by_bands(region, spatialReducer = 'mean', timeReducer = 'mean', dateProperty = 'system:time_start', bands = None, labels = None, colors = None, figure = None, scale = 10000, crs = None, crsTransform = None, bestEffort = False, maxPixels = 10**7, tileScale = 1) Plot the reduced data for each image in the collection by bands on a specific region. This method is plotting the reduced data for each image in the collection by bands on a specific region. :param region: The region to reduce the data on. :param spatialReducer: The name of the reducer or a reducer object to use. Default is ``"mean"``. :param timeReducer: The name of the reducer or a reducer object to use. Default is ``"mean"``. :param dateProperty: The property to use as date for each image. Default is ``"system:time_start"``. :param bands: The bands to reduce. If empty, all bands are reduced. :param labels: The labels to use for the bands. If empty, the bands names are used. :param colors: The colors to use for the bands. If empty, the default colors are used. :param figure: The bokeh figure to plot the data on. If None, a new figure is created. :param scale: The scale in meters to use for the reduction. default is 10000m :param crs: 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. :param crsTransform: 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. :param bestEffort: 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. :param maxPixels: The maximum number of pixels to reduce. Defaults to 1e7. :param tileScale: A scaling factor between 0.1 and 16 used to adjust aggregation tile size; setting a larger tileScale (e.g., 2 or 4) uses smaller tiles and may enable computations that run out of memory with the default. :returns: A bokeh figure with the reduced values for each band and each day. .. rubric:: Examples .. code-block:: python 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") ) region = ee.Geometry.Point(-122.262, 37.8719).buffer(10000) collection.geetools.plot_doy_by_bands(region, "mean", "mean", 10000, "system:time_start") .. py:method:: plot_doy_by_regions(band, regions, label = 'system:index', spatialReducer = 'mean', timeReducer = 'mean', dateProperty = 'system:time_start', colors = None, figure = None, scale = 10000, crs = None, crsTransform = None, tileScale = 1) Plot the reduced data for each image in the collection by regions for a single band. This method is plotting the reduced data for each image in the collection by regions for a single band. :param band: The band to reduce. :param regions: The regions to reduce the data on. :param label: The property to use as label for each region. Default is ``"system:index"``. :param spatialReducer: The name of the reducer or a reducer object to use. Default is ``"mean"``. :param timeReducer: The name of the reducer or a reducer object to use. Default is ``"mean"``. :param dateProperty: The property to use as date for each image. Default is ``"system:time_start"``. :param colors: The colors to use for the regions. If empty, the default colors are used. :param figure: The bokeh figure to plot the data on. If None, a new figure is created. :param scale: The scale in meters to use for the reduction. default is 10000m :param crs: 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. :param crsTransform: 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. :param tileScale: A scaling factor between 0.1 and 16 used to adjust aggregation tile size; setting a larger tileScale (e.g., 2 or 4) uses smaller tiles and may enable computations that run out of memory with the default. :returns: A bokeh figure with the reduced values for each region and each day. .. rubric:: Examples .. code-block:: python 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") ) regions = ee.FeatureCollection([ ee.Feature(ee.Geometry.Point(-122.262, 37.8719).buffer(10000), {"name": "region1"}), ee.Feature(ee.Geometry.Point(-122.262, 37.8719).buffer(20000), {"name": "region2"}) ]) collection.geetools.plot_doy_by_regions("B1", regions, "name", "mean", "mean", 10000, "system:time_start") .. py:method:: plot_doy_by_seasons(band, region, seasonStart = 1, seasonEnd = 366, reducer = 'mean', dateProperty = 'system:time_start', colors = None, figure = None, scale = 10000, crs = None, crsTransform = None, bestEffort = False, maxPixels = 10**7, tileScale = 1) Plot the reduced data for each image in the collection by years for a single band. This method is plotting the reduced data for each image in the collection by years for a single band. To set the start and end of the season, use the :py:meth:`ee.Date.getRelative` or :py:class:`time.struct_time` method to get the day of the year. :param band: The band to reduce. :param region: The region to reduce the data on. :param seasonStart: The day of the year that marks the start of the season. :param seasonEnd: The day of the year that marks the end of the season. :param reducer: The name of the reducer or a reducer object to use. Default is ``"mean"``. :param dateProperty: The property to use as date for each image. Default is ``"system:time_start"``. :param colors: The colors to use for the regions. If empty, the default colors are used. :param figure: The bokeh figure to plot the data on. If None, a new figure is created. :param scale: The scale in meters to use for the reduction. default is 10000m :param crs: 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. :param crsTransform: 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. :param bestEffort: 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. :param maxPixels: The maximum number of pixels to reduce. Defaults to 1e7. :param tileScale: A scaling factor between 0.1 and 16 used to adjust aggregation tile size; setting a larger tileScale (e.g., 2 or 4) uses smaller tiles and may enable computations that run out of memory with the default. :returns: A bokeh figure with the reduced values for each year and each day. .. rubric:: Examples .. jupyter-execute:: import ee, geetools from geetools.utils import initialize_documentation initialize_documentation() collection = ( ee.ImageCollection("LANDSAT/LC08/C02/T1_TOA") .filterBounds(ee.Geometry.Point(-122.262, 37.8719)) .filter(ee.Filter.Or( ee.Filter.date("2022-01-01", "2022-12-31"), ee.Filter.date("2016-01-01", "2016-12-31"), )) .map(lambda i: ee.Image(i).addBands( ee.Image(i) .normalizedDifference(["B5", "B4"]) .rename("NDVI") )) ) collection.geetools.plot_doy_by_seasons( band = "NDVI", region = ee.Geometry.Point(-122.262, 37.8719).buffer(1000), seasonStart = ee.Date("2016-05-01").getRelative("day", "year"), seasonEnd = ee.Date("2016-10-31").getRelative("day", "year"), reducer = "mean", dateProperty = "system:time_start", scale = 10000 ) .. py:attribute:: _obj .. py:data:: EE_DATE_FORMAT :value: "YYYY-MM-dd'T'HH-mm-ss" The javascript format to use to burn date object in GEE. .. py:data:: PY_DATE_FORMAT :value: '%Y-%m-%dT%H-%M-%S' The python format to use to parse dates coming from GEE.