geetools.Image.ImageAccessor.interpolateBands#

geetools.Image.ImageAccessor.interpolateBands(src, to)#

Interpolate bands from the “src” value range to the “to” value range.

The Interpolation is performed linearly using the “extrapolate” option of the “interpolate” method.

Parameters:
  • src (geetools.types.ee_list) – The source value range

  • to (geetools.types.ee_list) – The target value range

Returns:

The image with the interpolated bands

Return type:

ee.Image

Examples

import ee, geetools

ee.Initialize()

vatican = ee.Geometry.Point([12.4534, 41.9033]).buffer(1)
image = ee.ImageCollection('COPERNICUS/S2_SR_HARMONIZED').filterBounds(vatican).first()
image = image.select(["B4", "B3", "B2"]).geetools.interpolateBands([0, 3000], [0, 30])
values = image.reduceRegion(ee.Reducer.mean(), vatican, 1)
print(values.getInfo())