In [1]:
import ee
ee.Initialize()
In [3]:
from geetools import tools, utils
import geedatasets
In [4]:
import ipygee as ui
In [5]:
l8 = geedatasets.landsat.Landsat8SR()
In [6]:
p = ee.Geometry.Point([-72,-42])
In [7]:
col = l8.collection().filterBounds(p)
In [8]:
i = ee.Image(col.first())
In [9]:
ndvi = l8.ndvi.apply(i)
In [10]:
points = ndvi.sample(scale=10000, geometries=True)
In [15]:
d = tools.image.linearFunction(ndvi, 'NDVI', mean=0.3, range_min=0, range_max=1, min=2, max=5)
result = ndvi.addBands(d)
In [17]:
chart = ui.chart.Image.bandsByRegion(result, points.limit(100), xProperty='NDVI')
In [18]:
gauss = tools.image.gaussFunction(ndvi, 'NDVI', 0, 1, mean=0.3, output_min=0, output_max=1, stretch=2)
gauss = ndvi.addBands(gauss)
In [19]:
chart_gauss = ui.chart.Image.bandsByRegion(gauss, points.limit(100), xProperty='NDVI', bands=['gauss'])
In [20]:
chart_gauss.renderWidget(width=800)
In [22]:
normal = tools.image.normalDistribution(ndvi, 'NDVI', scale=30, maxPixels=1e13)
result_n = ndvi.addBands(normal)
In [23]:
chart_normal = ui.chart.Image.bandsByRegion(result_n, points.limit(100), xProperty='NDVI', bands=['normal_distribution'])
In [24]:
charts = chart.cat(chart_gauss, chart_normal)
In [25]:
charts.renderWidget(width=800)
In [26]:
charts.dataframe
Out[26]:
In [ ]: