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

some methods and modules do not work #78

Closed
navidboy70 opened this issue Sep 9, 2022 · 5 comments
Closed

some methods and modules do not work #78

navidboy70 opened this issue Sep 9, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@navidboy70
Copy link

Describe the bug
I am trying to use geemap,eemont and ee to derive some indices from sentinel-2 dataset from GEE python API in VSCode. the problem is that some methods and modules can not be recognized by python and I face error. I also copied the exact scripts from your tutorials, but the problem still exists.

To Reproduce
import ee, eemont, geemap

   S2 = (ee.ImageCollection("COPERNICUS/S2_SR")
            .filterBounds(ROI)
            .filterDate("2020-01-01","2021-01-01")
            .preprocess()
            .maskClouds()
            .scaleAndOffset()
            )
    S2online = S2.spectralIndices(["NDVI","kNDVI","NDWI","SeLI"],online = True).median()

AttributeError: 'ImageCollection' object has no attribute 'preprocess'

Screenshots
If applicable, add screenshots to help explain your problem.

Setup (please complete the following information):

  • OS: Windows
  • python version 3.10 & 3.8
  • eemont version 0.3.5
  • earthengine-api version [e.g. 0.1.32]

Additional context
Add any other context about the problem here.

@navidboy70 navidboy70 added the bug Something isn't working label Sep 9, 2022
@davemlz
Copy link
Owner

davemlz commented Sep 14, 2022

Hi @navidboy70!

I tried the code that you sent (with another ROI since I don't have access to the one you're using) and everything works fine in VS Code, JN, and Colab. Please try the following:

  1. The preprocess method was created for eemont>=0.2.0. Check you are actually using eemont with a version greater or equal to 0.2.0. You can check the version with eemont.__version__. You can update eemont with pip install -U eemont.
  2. The preprocess method is actually a short method for object.maskClouds().scaleAndOffset(): You shouldn't use these methods after calling preprocess.

If the problem persists, please paste here the complete code with a screenshot of the error.

Best,

David

@navidboy70
Copy link
Author

navidboy70 commented Oct 9, 2022 via email

@davemlz
Copy link
Owner

davemlz commented Oct 9, 2022

Sorry, it was an error when translating from Python to JavaScript. It has been fixed! :)

Bets regards,

David

@davemlz davemlz closed this as completed Oct 9, 2022
@navidboy70
Copy link
Author

navidboy70 commented Oct 9, 2022 via email

@navidboy70
Copy link
Author

navidboy70 commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants