I am new to the Google Earth Engine Python API, and I am trying to create functions that when mapped over a collection will print some metadata (e.g. time stamp, band names) but I always get the same error:
EEException: ValueNode is empty
Here is the code:
import ee
ee.Authenticate()
ee.Initialize()
# Getting the Sentinel 1 image over the study site
collection = ee.ImageCollection('COPERNICUS/S1_GRD').filterBounds(ee.Geometry.Point(121.1737372,24)).filterDate('2019-01-01','2019-01-30')
collectionList = collection.toList(collection.size())
sentinel1 = ee.Image(collectionList.get(1)).select('VH')
##Function to print the dates of a collection
def printDate(image):
date = ee.Date(image.get('system:time_start'))
print('Time stamp:'+str(date.format('Y-M-d').getInfo()))
collection.map(printDate)
def collectionBands(img):
bands = img.bandNames()
print('band names:'+str(bands.getInfo()))
collection.map(collectionBands)