geebap
geebap copied to clipboard
A question
when i import all the library in the sample code, errors occur as following:
AttributeError Traceback (most recent call last)
in () ----> 1 from geebap import bap, season, filters, masks, scores, satcol, functions 2 from geetools import tools 3 4 import pprint 5 pp = pprint.PrettyPrinter(indent=2) f:\Anaconda3\envs\GEE\lib\site-packages\geebap\bap.py in
() 10 if not ee.data._initialized: ee.Initialize() 11 ---> 12 import satcol 13 import season as temp 14 import functions f:\Anaconda3\envs\GEE\lib\site-packages\geebap\satcol.py in
() 901 902 --> 903 GROUPS = {'Landsat': [col.ID for col in ColGroup.Landsat().collections], 904 'MSS': [col.ID for col in ColGroup.MSS().collections], 905 'Landsat_Sentinel': [col.ID for col in ColGroup.Landsat_Sentinel().collections], f:\Anaconda3\envs\GEE\lib\site-packages\geebap\satcol.py in Landsat(cls) 827 Collection.Landsat2(), 828 Collection.Landsat3(), --> 829 Collection.Landsat4TOA(), 830 Collection.Landsat4USGS(), 831 Collection.Landsat5TOA(),
f:\Anaconda3\envs\GEE\lib\site-packages\geebap\satcol.py in Landsat4TOA(cls) 428 429 obj.clouds_band = "BQA" --> 430 obj.fclouds = cld.landsatTOA() 431 # obj.ID = "LANDSAT/LT4_L1T_TOA_FMASK" 432 obj.ID = IDS[obj.short]
AttributeError: 'module' object has no attribute 'landsatTOA'
Hi @cugsunjie, still interested? Sorry, I didn't see the issue before..
Hi @fitoprincipe, I'm interested. I'm trying to run the code and have the same error.
Hi @krubiano , what python version are you running?
@fitoprincipe I'm running python v. 2.7.16.
Actually I dropped python 2 support, switch to python 3 and see if it works.
Hi @cugsunjie, @krubiano, how did all go? should I close this issue?
@fitoprincipe I already switched to python 3 and installed the new version, but still having an error. I will try in deep and let you know.
Hi @fitoprincipe I'm trying to run the code using an anaconda environment. I've got the following error:
scores: ['score-doy', 'score-sat', 'score-atm-op', 'score-outlier', 'score-index', 'score-maskper', 'score-cld-dist'] satellites: ['LANDSAT/LE07/C01/T1_SR', 'LANDSAT/LE07/C01/T1_TOA', 'LANDSAT/LT05/C01/T1_TOA', 'LANDSAT/LT05/C01/T1_SR']
Satellite: LANDSAT/LE07/C01/T1_SR ini: 2009-11-15 ,end: 2010-03-15 size after filters: 29 Traceback (most recent call last): File "geebap_py3.py", line 59, in
indices=("ndvi")) File "C:\Users\kristian.rubiano\AppData\Local\Continuum\anaconda3\envs\geebap_py3\lib\site-packages\geebap-0.1.8.dev0-py3.7.egg\geebap\bap.py", line 914, in bestpixel normalize=normalize, bbox=bbox, force=force) File "C:\Users\kristian.rubiano\AppData\Local\Continuum\anaconda3\envs\geebap_py3\lib\site-packages\geebap-0.1.8.dev0-py3.7.egg\geebap\bap.py", line 651, in collection f = col.INDICES[i] KeyError: 'n'
Sorry if it's a simple error, could you help me?
@krubiano , I haven't updated the pypi version yet, because I'm still working on the new version. But you can try installing the develop branch:
- create a new environment in anaconda (
geebap_dev_py3
could be the name) - install EE API
- if you haven't got git for windows, install it
- Using git, clone the repo:
git clone https://github.com/fitoprincipe/geebap
- Enter Anaconda prompt
- Go to
geebap
folder (repo), for example, if you cloned it intoC:/CLONES>
(geebap_dev_py3) C:/>cd CLONES (geebap_dev_py3) C:/CLONES>cd geebap (geebap_dev_py3) C:/CLONES/geebap>
- switch to
develop
branch
git checkout develop
- install the develop branch
pip install .
- May be before step 8 you have to install the dependencies, like
geetools
, see: https://github.com/gee-community/gee_tools/issues/26#issuecomment-472405182
Good luck! =)
Hi @krubiano and @cugsunjie, I just pushed a new version =) you can try it out
Hello @fitoprincipe I need to talk to you, can you have me your email?