Code Monkey home page Code Monkey logo

geebap's Issues

Problem upon import

Hi Rodrigo,

Thanks for the updates. I have updated to 0.2.2, Conda 3.6 and I get this error during import. Any idea why?

Thanks a lot

S

>>> from geebap import bap
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/sebastien/anaconda3/envs/ee/lib/python3.6/site-packages/geebap/__init__.py", line 24, in <module>
    from . import bap, date, expgen, expressions, filters, functions,\
  File "/Users/sebastien/anaconda3/envs/ee/lib/python3.6/site-packages/geebap/bap.py", line 5, in <module>
    from . import scores, priority, functions, utils, __version__
  File "/Users/sebastien/anaconda3/envs/ee/lib/python3.6/site-packages/geebap/scores.py", line 33, in <module>
    from . import priority
  File "/Users/sebastien/anaconda3/envs/ee/lib/python3.6/site-packages/geebap/priority.py", line 23, in <module>
    class SeasonPriority(object):
  File "/Users/sebastien/anaconda3/envs/ee/lib/python3.6/site-packages/geebap/priority.py", line 55, in SeasonPriority
    ee_relation = ee.Dictionary(relation)
  File "/Users/sebastien/anaconda3/envs/ee/lib/python3.6/site-packages/ee/computedobject.py", line 32, in __call__
    return type.__call__(cls, *args, **kwargs)
  File "/Users/sebastien/anaconda3/envs/ee/lib/python3.6/site-packages/ee/dictionary.py", line 27, in __init__
    self.initialize()
  File "/Users/sebastien/anaconda3/envs/ee/lib/python3.6/site-packages/ee/dictionary.py", line 48, in initialize
    apifunction.ApiFunction.importApi(cls, 'Dictionary', 'Dictionary')
  File "/Users/sebastien/anaconda3/envs/ee/lib/python3.6/site-packages/ee/apifunction.py", line 180, in importApi
    cls.initialize()
  File "/Users/sebastien/anaconda3/envs/ee/lib/python3.6/site-packages/ee/apifunction.py", line 151, in initialize
    signatures = data.getAlgorithms()
  File "/Users/sebastien/anaconda3/envs/ee/lib/python3.6/site-packages/ee/data.py", line 426, in getAlgorithms
    return send_('/algorithms', {}, 'GET')
  File "/Users/sebastien/anaconda3/envs/ee/lib/python3.6/site-packages/ee/data.py", line 838, in send_
    response.status)
ee.ee_exception.EEException: Server returned HTTP code: 404

overwriting module name in example notebook

@fitoprincipe - super cool tool. I've just started playing around with it. One thing you might want to consider changing is this line in your Best_Available_Pixel_Composite,ipynb script:

bap = bap.Bap(year=2000, range=(0, 0),
          season=a_season,
          masks=(cld_mask,),
          scores=(doy, sat, atm_op, dist, out, maskper, ind),
          filters=(filt_cld, filt_mask))

If a user steps through the code sequentially, but then comes back and changes reruns this block, the variable name bap has now clobbered the module name. Minor annoyance, but might trip up some people. Thanks for your work on this.

Updated version available?

Hi there,

I was just wondering if you had an updated version of the code anywhere?
Thanks a lot for the great work!

S

Example code does not work

The sample code does not work. This is the code:

`rom geebap import bap, season, filters, masks,
scores, satcol, functions
from geetools import tools

import ee
ee.Initialize()

COLLECTION

col_group = satcol.ColGroup.Landsat()

SEASON

a_season = season.Season.Growing_South()

MASKS

cld_mask = masks.Clouds()
equiv_mask = masks.Equivalent()

Combine masks in a tuple

masks = (cld_mask, equiv_mask)

FILTERS

filt_cld = filters.CloudsPercent()
filt_mask = filters.MaskPercent()

Combine filters in a tuple

filters = (filt_cld, filt_mask)

SCORES

doy = scores.Doy()
sat = scores.Satellite()
op = scores.AtmosOpacity()
out = scores.Outliers(("ndvi",))
ind = scores.Index("ndvi")
mascpor = scores.MaskPercent()
dist = scores.CloudDist()

Combine scores in a tuple

scores = (doy, sat, op, out, ind, mascpor, dist)

BAP OBJECT

bap = bap.Bap(year=2010, range=(0, 0),
season=a_season,
colgroup=col_group,
masks=masks,
scores=scores,
filters=filters)

SITE

site = ee.Geometry.Polygon([[-71,-42],
[-71,-43],
[-72,-43],
[-72,-42]])

COMPOSITE

composite = bap.bestpixel(site=site,
indices=("ndvi",))

The result (composite) is a namedtuple, so

image = composite.image

image is a ee.Image object, so you can do anything

from here..

one_value = tools.get_value(image,
site.centroid(),
30, 'client')

print(one_value)

See below for the debug output:

scores: ['score-doy', 'score-sat', 'score-atm-op', 'score-outlier', 'score-inde
', 'score-maskper', 'score-cld-dist']

Satellite: LEDAPS/LT5_L1T_SR
ini: 2009-11-15 ,end: 2010-03-15
size after filters: 15
** score-doy **
** score-sat **
** score-atm-op **
** score-outlier **
1.2.3.4.5.6.7.8.9.10.** score-index **
** score-maskper **
1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.3
.** score-cld-dist **
1.2.3.4.5.6.7.8.9.10.
Satellite: LANDSAT/LT5_SR
ini: 2009-11-15 ,end: 2010-03-15
size after filters: 0

Satellite: LANDSAT/LE7_SR
ini: 2009-11-15 ,end: 2010-03-15
size after filters: 0

Satellite: LEDAPS/LE7_L1T_SR
ini: 2009-11-15 ,end: 2010-03-15
size after filters: 29
** score-doy **
** score-sat **
** score-atm-op **
** score-outlier **
1.2.3.4.5.6.7.8.9.10.** score-index **
** score-maskper **
1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.3
.** score-cld-dist **
1.2.3.4.5.6.7.8.9.10.final collection size: 0
Traceback (most recent call last):
File "", line 3, in
File "C:\Users\geogz\AppData\Local\Continuum\Anaconda2\lib\site-packages\geeb
p\bap.py", line 474, in bestpixel
imgCol = colbap.col
AttributeError: 'NoneType' object has no attribute 'col'

The result (composite) is a namedtuple, so

... image = composite.image
Traceback (most recent call last):
File "", line 2, in
NameError: name 'composite' is not defined

image is a ee.Image object, so you can do anything

... # from here..
...

one_value = tools.get_value(image,
... site.centroid(),
... 30, 'client')
Traceback (most recent call last):
File "", line 1, in
NameError: name 'tools' is not defined

print(one_value)

It seems the final collection after filtering is 0 and the bap.py does not check if there is at least one image?

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'

Install error

Hellow,

When I tried to run ,I have returned the following error:

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-EMcAa9/geetools/

Can you help me?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.