Compute a medoid score of 'how far is from medoid'

This is the previous step to compute the medoid composite

When normalize parameter is True, pixels with value 1 are the actual medoid, and 0 is the further


In [1]:
import ee
ee.Initialize()

In [2]:
from geetools import composite, tools, cloud_mask, indices

In [3]:
import ipygee as ui

In [4]:
p = ee.Geometry.Point(-72, -42)

In [5]:
col = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')\
        .filterBounds(p).filterDate('2017-01-01', '2017-12-01')\
        .map(cloud_mask.landsat8SRPixelQA())\
        .map(lambda img: img.addBands(indices.ndvi(img, 'B5', 'B4')))\
        .limit(7)

Bands for medoid


In [6]:
bands = ['B2', 'B3', 'B4', 'B5', 'B6', 'B7']

Medoid score including zero values


In [7]:
medscore = composite.medoidScore(col, bands, False)

In [8]:
values = tools.imagecollection.getValues(medscore, p, scale=30)

In [9]:
ui.eprint(values)



In [ ]: