geetools.composite#

Module holding tools for creating composites.

Module Contents#

Functions#

closestDate(col[, clip_to_first])

Make a composite in which masked pixels are filled with the.

compositeByMonth(collection[, composite_function, ...])

Make a composite at regular intervals parsing a composite.

compositeRegularIntervals(collection[, interval, ...])

Make a composite at regular intervals parsing a composite.

max(collection, band)

Make a max composite using the specified band.

medoid(collection[, bands, discard_zeros])

Medoid Composite. Adapted from https://www.mdpi.com/2072-4292/5/12/6481.

medoidScore(collection[, bands, discard_zeros, ...])

Compute a score to reflect 'how far' is from the medoid.

geetools.composite.closestDate(col, clip_to_first=False)[source]#

Make a composite in which masked pixels are filled with the.

last available pixel. Make sure all image bands are casted.

Parameters:

clip_to_first – whether to clip with the ‘first’ image geometry

geetools.composite.compositeByMonth(collection, composite_function=None, composite_args=None, composite_kwargs=None)[source]#

Make a composite at regular intervals parsing a composite.

function. This function MUST return an ImageCollection and its first argument must be the input collection. The default function (if the argument is None) is lambda col: col.median().

geetools.composite.compositeRegularIntervals(collection, interval=1, unit='month', date_range=(1, 0), date_range_unit='month', direction='backward', start=None, end=None, composite_function=None, composite_args=None, composite_kwargs=None)[source]#

Make a composite at regular intervals parsing a composite.

function. This function MUST return an ImageCollection and its first argument must be the input collection. The default function (if the argument is None) is lambda col: col.median().

geetools.composite.max(collection, band)[source]#

Make a max composite using the specified band.

geetools.composite.medoid(collection, bands=None, discard_zeros=False)[source]#

Medoid Composite. Adapted from https://www.mdpi.com/2072-4292/5/12/6481.

Parameters:
  • collection (ee.ImageCollection) – the collection to composite

  • bands (list) – the bands to use for computation. The composite will include all bands

  • discard_zeros (bool) – Masked and pixels with value zero will not be use for computation. Improves dark zones.

Returns:

the Medoid Composite

Return type:

ee.Image

geetools.composite.medoidScore(collection, bands=None, discard_zeros=False, bandname='sumdist', normalize=True)[source]#

Compute a score to reflect ‘how far’ is from the medoid.

Same params as medoid() .