geebap icon indicating copy to clipboard operation
geebap copied to clipboard

A question

Open cugsunjie opened this issue 6 years ago • 11 comments

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'

cugsunjie avatar Jan 03 '19 23:01 cugsunjie

Hi @cugsunjie, still interested? Sorry, I didn't see the issue before..

fitoprincipe avatar Mar 07 '19 13:03 fitoprincipe

Hi @fitoprincipe, I'm interested. I'm trying to run the code and have the same error.

krubiano avatar Mar 08 '19 16:03 krubiano

Hi @krubiano , what python version are you running?

fitoprincipe avatar Mar 08 '19 16:03 fitoprincipe

@fitoprincipe I'm running python v. 2.7.16.

krubiano avatar Mar 08 '19 16:03 krubiano

Actually I dropped python 2 support, switch to python 3 and see if it works.

fitoprincipe avatar Mar 08 '19 16:03 fitoprincipe

Hi @cugsunjie, @krubiano, how did all go? should I close this issue?

fitoprincipe avatar Mar 20 '19 13:03 fitoprincipe

@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.

krubiano avatar Mar 22 '19 14:03 krubiano

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 avatar Apr 03 '19 21:04 krubiano

@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:

  1. create a new environment in anaconda (geebap_dev_py3 could be the name)
  2. install EE API
  3. if you haven't got git for windows, install it
  4. Using git, clone the repo:

git clone https://github.com/fitoprincipe/geebap

  1. Enter Anaconda prompt
  2. Go to geebap folder (repo), for example, if you cloned it into C:/CLONES>

(geebap_dev_py3) C:/>cd CLONES (geebap_dev_py3) C:/CLONES>cd geebap (geebap_dev_py3) C:/CLONES/geebap>

  1. switch to develop branch

git checkout develop

  1. install the develop branch

pip install .

  1. 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! =)

fitoprincipe avatar Apr 04 '19 11:04 fitoprincipe

Hi @krubiano and @cugsunjie, I just pushed a new version =) you can try it out

fitoprincipe avatar May 10 '19 16:05 fitoprincipe

Hello @fitoprincipe I need to talk to you, can you have me your email?

LiliGuimaraes avatar Jul 21 '19 10:07 LiliGuimaraes