I'm calculating the Enhanced Vegetation Index (EVI) of Sentinel-2 data on Google Earth Engine's Python API, specifically in a Jupyter Notebook. I'd like to check that the calculations are producing reasonable numbers using something like the Inspector tab on Google Earth Engine's JavaScript API and UI, which allows the user to click areas on the map to view the pixel values. So far, I've tried using Folium, which does print interactive maps. However, it doesn't appear to have a built-in inspector functionality. My current code is:
#setting up earth engine
!pip install earthengine-api
import ee
ee.Authenticate()
ee.Initialize()
#evi calculation
def addEVI(image):
EVI = image.expression('2.5 * ((NIR - RED) / (NIR + 6 * RED - 7.5 * BLUE + 1))', {
'NIR' : image.select('B8').divide(10000),
'RED' : image.select('B4').divide(10000),
'BLUE': image.select('B2').divide(10000)}).rename('EVI')
return image.addBands(EVI)
#test variables
calctestimg = ee.Image('COPERNICUS/S2/20160718T165316_20160718T215633_T16UEG')
calctest = addEVI(calctestimg)
#setting up folium
# Import the Folium library.
import folium
# Define a method for displaying Earth Engine image tiles to folium map.
def add_ee_layer(self, ee_image_object, vis_params, name):
map_id_dict = ee.Image(ee_image_object).getMapId(vis_params)
folium.raster_layers.TileLayer(
tiles = map_id_dict['tile_fetcher'].url_format,
attr = 'Map Data © <a href="https://earthengine.google.com/">Google Earth Engine</a>',
name = name,
overlay = True,
control = True
).add_to(self)
# Add EE drawing method to folium.
folium.Map.add_ee_layer = add_ee_layer
# Set visualization parameters.
vis_params = {
'min': 0,
'max': 4000,
'palette': ['006633', 'E5FFCC', '662A00', 'D8D8D8', 'F5F5F5']}
# Create a folium map object.
my_map = folium.Map(location=[20, 0], zoom_start=3)
# Add the elevation model to the map object.
calctestevi = calctest.select('EVI')
my_map.add_ee_layer(calctestevi, vis_params, 'calctestevi')
# Add a layer control panel to the map.
my_map.add_child(folium.LayerControl())
# Display the map.
display(my_map)
Is there a way for me to check the values of calctestevi
?