davemlz / eemont

A python package that extends Google Earth Engine.
https://eemont.readthedocs.io/
MIT License
407 stars 69 forks source link

index() function not working #71

Closed REvilo-code closed 2 years ago

REvilo-code commented 2 years ago

Describe the bug First of all I want to thank you for your work , this library is very helpful!
But I get the error 'Pattern NDVI did not match any bands'. I been trying to get this function to work but it doesn't. I had a notebook with a project I was working on and it didn't work so I tried using a new notebook with examples right out of the documentation. But still doesn't work.

To Reproduce

import ee,geemap,eemont
import matplotlib.pyplot as plt
ee.Initialize()
Map = geemap.Map()

point = ee.Geometry.Point([-76.21, 3.45])
L8 = (ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
    .filterBounds(point)
    .filterDate('2021-01-01','2021-01-31')
    .maskClouds()
    .scale()
    .index(['NDVI','NDWI','BAI','NDSI']))

image = L8.first()
ndvi = image.select('NDVI')
vis = {'min':0.0,'max':0.5,'palette':['white','blue','green']}
Map.addLayer(ndvi,vis,'NDVI')
Map

Screenshots screenshot

Setup (please complete the following information):

Additional context Is kind of odd because the other functions as mask() and scale() seem to work just fine. I tried to retrieve the band names and as expected 'NDVI' isn't there.

REvilo-code commented 2 years ago

I just realized the function is deprecated ! I'm using spectralIndices() instead. Very sorry for the inconvenience. Keep up the good work!