-
Notifications
You must be signed in to change notification settings - Fork 42
Guided usage exercise
https://openeo.org/documentation/1.0/python/#installation
This exercise will use a Jupyter notebook, but it's also possible to copy paste the code into a regular script.
Managed Jupyter notebook environments can also be used, this may require you to register for an account. Example: https://notebooks.terrascope.be Note that all you need is Python > 3.6 and the ability to install packages.
This notebook runs on the backend at https://openeo.vito.be/openeo/ Other backends may work, but keep in mind that names of data collections and supported processes will need to be adjusted!
Find your preferred backend at: https://hub.openeo.org/
Information about demo credentials will be provided in the session. Future warning: backends will allow you to log in with your institution (edugain) or social accounts. This will make demo credentials invalid. Always avoid sharing your credentials with others!
Try to run the initial connection steps in the notebook or your IDE.
Learning goal: learn how to work in an interactive manner, and debug your code.
The notebook constructs a complex workflow, but when developing and debugging, you often want to check intermediate results. Please try this.
Tip: this notebook works on Terrascope data. You can explore the Sentinel-2 layer here: https://viewer.terrascope.be/?language=en&bbox=2.798217823728918,50.43992723836223,6.313842823728918,51.59490312270836&overlay=true&bgLayer=Satellite&date=2018-05-06&layer=CGS_S2_RADIOMETRY
Download a small area of the NDVI datacube (S2ndvi). Tip: 2018-05-06 has nice cloud free data!
You will have to choose a format:
- GTiff (GeoTiff) is suitable for single dates, but does not support timeseries very well. (It will return data for some date.)
- NetCDF does support full timeseries, but the format is somewhat more complex.
API docs: https://open-eo.github.io/openeo-python-client/basics.html#example-simple-band-math
Downloading an aggregated timeseries for an area of interest is another great way to explore a dataset:
https://open-eo.github.io/openeo-python-client/basics.html#example-retrieving-aggregated-timeseries
It can give you a sense of how much data is available, and how the signal behaves for your area of interest.
Warning When debugging, it is recommmended to always work on smaller areas, also the time range can be limited. This improves interactivity, and avoids a network timeout when connecting with the backend.
When you do experience timeouts, and tuning parameters does not work, have a look at using batch jobs: https://open-eo.github.io/openeo-python-client/basics.html#managing-jobs-in-openeo
Note that the performance of requests can depend on the backend!
At this point, you know how to use so called 'predefined' functions, and are able to download and inspect intermediate results. The next level of usage is mastering user defined functions: https://open-eo.github.io/openeo-python-client/udf.html
This example uses two UDF's: one that users Tensorflow, the other one applies Szavitky Golay smoothing. Try to understand how this works, or adjust them if you feel like a challenge!
If you've gotten here, you've already mastered the most important openEO concepts, so play around, read the docs, and see where it gets you.