In [1]:
import ee
ee.Initialize()
In [2]:
from geetools import tools
In [3]:
import ipygee as ui
In [4]:
p = ee.Geometry.Point([0, 0])
In [5]:
# values = ee.List([0, 2, 5, 8, 10, 12, 15, 18, 22, 25, 28, 31, 35, 39, 42, 48, 51, 55])
# values = ee.List([-10, -8, -7, -1, -2, 0, 1, 5, 7, 8, 10, 12, 14, 16, 18, 20, 22, 24]) # With negative values
values = ee.List([-20, -32, -15, -8, -5, 0, 2, 4, 6, 8, 9, 10, 12, 14, 16, 18, 20, 23])
In [6]:
def build_collection(n):
n = ee.Number(n)
return ee.Image.constant(n).rename('test').set('test', n).toFloat()
images = values.map(build_collection)
In [7]:
collection = ee.ImageCollection.fromImages(images)
In [8]:
help(tools.imagecollection.linearFunctionBand)
In [9]:
linear_band1 = tools.imagecollection.linearFunctionBand(collection, 'test')
In [10]:
linear_band1_chart = ui.chart.Image.series(linear_band1, p, scale=1000, xProperty='test', bands=['linear_function'], label_bands=['default values'])
In [11]:
linear_band2 = tools.imagecollection.linearFunctionBand(collection, 'test', mean=10)
In [12]:
linear_band2_chart = ui.chart.Image.series(linear_band2, p, scale=1000, xProperty='test', bands=['linear_function'], label_bands=['mean=10'])
In [13]:
linear_band3 = tools.imagecollection.linearFunctionBand(collection, 'test', mean=10, output_min=0)
In [14]:
linear_band3_chart = ui.chart.Image.series(linear_band3, p, scale=1000, xProperty='test', bands=['linear_function'], label_bands=['mean=10 min=0'])
In [15]:
linear_band4 = tools.imagecollection.linearFunctionBand(collection, 'test', mean=10, output_min=10, output_max=20)
In [16]:
linear_band4_chart = ui.chart.Image.series(linear_band4, p, scale=1000, xProperty='test', bands=['linear_function'], label_bands=['mean=10 min=0 max=12'])
In [17]:
linear_chart = linear_band1_chart.cat(linear_band2_chart, linear_band3_chart, linear_band4_chart)
linear_chart.renderWidget(width=800)
In [18]:
linear_prop1 = tools.imagecollection.linearFunctionProperty(collection, 'test')
In [19]:
linear_prop1_chart = ui.chart.Image.series(linear_prop1, p, scale=1000, xProperty='test', properties=['LINEAR_FUNCTION'], label_properties=['default values'])
In [20]:
linear_prop2 = tools.imagecollection.linearFunctionProperty(collection, 'test', mean=10)
In [21]:
linear_prop2_chart = ui.chart.Image.series(linear_prop2, p, scale=1000, xProperty='test', properties=['LINEAR_FUNCTION'], label_properties=['mean=10'])
In [22]:
linear_prop3 = tools.imagecollection.linearFunctionProperty(collection, 'test', mean=10, output_min=0)
In [23]:
linear_prop3_chart = ui.chart.Image.series(linear_prop3, p, scale=1000, xProperty='test', properties=['LINEAR_FUNCTION'], label_properties=['mean=10 min=0'])
In [24]:
linear_prop4 = tools.imagecollection.linearFunctionProperty(collection, 'test', mean=10, output_min=0, output_max=10)
In [25]:
linear_prop4_chart = ui.chart.Image.series(linear_prop4, p, scale=1000, xProperty='test', properties=['LINEAR_FUNCTION'], label_properties=['mean=10 min=0 max=10'])
In [26]:
linear_prop5 = tools.imagecollection.linearFunctionProperty(collection, 'test', mean=10, output_min=5, output_max=20)
In [27]:
linear_prop5_chart = ui.chart.Image.series(linear_prop5, p, scale=1000, xProperty='test', properties=['LINEAR_FUNCTION'], label_properties=['mean=10 min=5 max=20'])
In [28]:
linear_chart_prop = linear_prop1_chart.cat(linear_prop2_chart, linear_prop3_chart, linear_prop4_chart, linear_prop5_chart)
linear_chart_prop.renderWidget(width=800)
In [29]:
linear_chart_prop.dataframe
Out[29]:
In [30]:
gauss_band1 = tools.imagecollection.gaussFunctionBand(collection, 'test')
In [31]:
gauss_band1_chart = ui.chart.Image.series(gauss_band1, ee.Geometry.Point([0, 0]), scale=1000, xProperty='test', bands=['gauss'], label_bands=['defualt'])
In [32]:
gauss_band2 = tools.imagecollection.gaussFunctionBand(collection, 'test', mean=10)
In [33]:
gauss_band2_chart = ui.chart.Image.series(gauss_band2, ee.Geometry.Point([0, 0]), scale=1000, xProperty='test', bands=['gauss'], label_bands=['mean=10'])
In [34]:
gauss_band3 = tools.imagecollection.gaussFunctionBand(collection, 'test', mean=10, output_min=0.5)
In [35]:
gauss_band3_chart = ui.chart.Image.series(gauss_band3, ee.Geometry.Point([0, 0]), scale=1000, xProperty='test', bands=['gauss'], label_bands=['mean=10 min=0.5'])
In [36]:
gauss_band4 = tools.imagecollection.gaussFunctionBand(collection, 'test', mean=23, output_min=0.5)
In [37]:
gauss_band4_chart = ui.chart.Image.series(gauss_band4, ee.Geometry.Point([0, 0]), scale=1000, xProperty='test', bands=['gauss'], label_bands=['Exponential'])
In [38]:
gauss_band_chart = gauss_band1_chart.cat(gauss_band2_chart, gauss_band3_chart, gauss_band4_chart)
gauss_band_chart.renderWidget(width=800)
In [39]:
gauss_band_chart.dataframe
Out[39]:
In [40]:
gauss_prop1 = tools.imagecollection.gaussFunctionProperty(collection, 'test')
In [41]:
gauss_prop1_chart = ui.chart.Image.series(gauss_prop1, ee.Geometry.Point([0, 0]), scale=1000, xProperty='test', properties=['GAUSS'], label_properties=['defualt'])
In [42]:
gauss_prop2 = tools.imagecollection.gaussFunctionProperty(collection, 'test', mean=10)
In [43]:
gauss_prop2_chart = ui.chart.Image.series(gauss_prop2, ee.Geometry.Point([0, 0]), scale=1000, xProperty='test', properties=['GAUSS'], label_properties=['mean=10'])
In [44]:
gauss_prop3 = tools.imagecollection.gaussFunctionProperty(collection, 'test', mean=10, output_min=0.5)
In [45]:
gauss_prop3_chart = ui.chart.Image.series(gauss_prop3, ee.Geometry.Point([0, 0]), scale=1000, xProperty='test', properties=['GAUSS'], label_properties=['mean=10 min=0.5'])
In [46]:
gauss_prop = gauss_prop1_chart.cat(gauss_prop2_chart, gauss_prop3_chart)
In [47]:
gauss_prop.renderWidget(width=800)
In [48]:
gauss_prop.dataframe
Out[48]:
In [49]:
normal_prop = tools.imagecollection.normalDistributionProperty(collection, 'test')
In [50]:
normal_prop_chart = ui.chart.Image.series(normal_prop, ee.Geometry.Point([0, 0]), scale=1000, xProperty='test', properties=['NORMAL_DISTRIBUTION'], label_properties=['defualt'])
In [51]:
normal_prop_chart.renderWidget(width=800)
In [52]:
normal_prop_chart.dataframe
Out[52]:
In [53]:
normal_band = tools.imagecollection.normalDistributionBand(collection, 'test')
In [54]:
normal_band_chart = ui.chart.Image.series(normal_band, ee.Geometry.Point([0, 0]), scale=1000, xProperty='test', bands=['normal_distribution'], label_bands=['defualt'])
In [55]:
normal_band_chart.renderWidget(width=800)
In [56]:
normal_band_chart.dataframe
Out[56]:
In [ ]: