geetools.ImageAccessor.rename#

geetools.ImageAccessor.rename(names)#

Rename the bands of the image based on a dictionary.

It’s the same function as the one from GEE but it takes a dictionary as input. Keys are the old names and values are the new names.

Parameters:

names (geetools.types.ee_dict) – The new names of the bands.

Returns:

The image with the new band names.

Return type:

ee.Image

Examples

import ee, geetools

ee.Initialize()

src = 'COPERNICUS/S2_SR_HARMONIZED/20200101T100319_20200101T100321_T32TQM'
image = ee.Image(src).select(['B1', 'B2', 'B3'])
image = image.geetools.rename({'B1': 'Aerosol', 'B2': 'Blue'})
print(image.bandNames().getInfo())