Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A question #3

Open
cugsunjie opened this issue Jan 3, 2019 · 11 comments
Open

A question #3

cugsunjie opened this issue Jan 3, 2019 · 11 comments

Comments

@cugsunjie
Copy link

cugsunjie commented Jan 3, 2019

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'

@fitoprincipe
Copy link
Owner

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

@krubiano
Copy link

krubiano commented Mar 8, 2019

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

@fitoprincipe
Copy link
Owner

Hi @krubiano , what python version are you running?

@krubiano
Copy link

krubiano commented Mar 8, 2019

@fitoprincipe I'm running python v. 2.7.16.

@fitoprincipe
Copy link
Owner

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

@fitoprincipe
Copy link
Owner

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

@krubiano
Copy link

@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
Copy link

krubiano commented Apr 3, 2019

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?

@fitoprincipe
Copy link
Owner

@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: Ubuntu 18.04 installation fails gee-community/geetools#26 (comment)

Good luck! =)

@fitoprincipe
Copy link
Owner

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

@LiliGuimaraes
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants