Frequently Asked Question

How to use the Austrian Data Cube with Jupyterlab?
Last Updated 4 years ago

1. Introduction

The Austrian Data Cube (ACube) is a service for accessing and working with higher level Sentinel-1 and Sentinel-2 data over Austria.

This tutorial focuses on the OpenDataCube part of ACube, which can be accessed through JupyterLab using Jupyter notebooks. Demo access is provided at https://acube.eodc.eu/. For establishing access please write to both office@eodc.eu and, after approval, to support@eodc.eu for an account.

Some familiarity with python is useful, however the examples well documented, given the nature of Jupyter notebooks, so that the beginner user might adapt the variables for his use case.

More information about the Austrian Data Cube, the project and data products can be found at the ACube wiki.

2. Jupyterlab

JupyterLab enables you to work with documents and activities such as Jupyter notebooks, text editors, terminals, and custom components in a flexible, integrated, and extensible manner. A broad documentation on many functions of Jupyterlab is found here , in the user section.

The interface after logging with an enabled account in is displayed below.

image

In the left pane there should be three folders:

  1. acube-notebooks - where the demonstration notebooks and some documentation is setup. In this folder the files currently cannot be changed in order to keep a minimum sample always available.
  2. eodc-products - where the user can see the  of products
  3. work - where the user can store their work

2.1 Creating a new notebook

In order to create a new notebook, navigate to the work folder by double clicking on it. Then in the main Launcher window open a Python notebook.

image

The main window changes to show the notebook. The notebook is shown in the folder, as Untitled.ipynb, and can be renamed. The main window contains the code cells where python code can be written and ran. Each cell can be ran independently, as long as there are no dependencies between cells (a variable in an inactivated cell used in another cell for example)

image

The notebook can be renamed by right click -> Rename.

3. OpenDataCube

The Open Data Cube (ODC) is an Open Source Geospatial Data Management and Analysis Software project that helps in harnessing the power of Satellite data. At its core, the ODC is a set of Python libraries and PostgreSQL database that helps work with geospatial raster data. The ACube service provides access to processed data using the ODC API which is pre-installed on JupyterLab instances.

A full documentation on ODC functions and API can be found here.

3.1 Using the provided examples to access ACube

To access the ACube notebooks navigate to the acube-notebooks folder and copy them to the work folder, along with the acube_functions.py library. To select multiple files, hold the Ctrl(STRG) button and right click -> Copy. Navigate back to the work folder and right click in the folder space -> Paste. The notebooks contains code and annotation for explaining each code cell. For further information on the code, refer to the notebook.

3.2.1 Sentinel-2 Monthly True Color Image

This notebook (BOKU_Sentinel2_MTCI.ipynb) shows how to query the monthly average True Color Sentinel-2 Images over Vienna, which are available as a product (MTCI_Sentinel_2). Additionally it shows how to download a single file as a GeoTIFF & netCDF.

image

To run all the cells, in the main menu click Run -> Run all cells. This notebook relies on the acube_functions.py file. If you get the error below, please copy the acube_functions.py file to the work folder

ModuleNotFoundError: No module named 'acube_functions'

If cell 8 fails with:

AttributeError: module 'datacube' has no attribute 'helpers'

Replace the code in the cell with:

from datacube import helpers
helpers.write_geotiff('MTCI_MAY.tif', data.isel(time=0))

The variables that can be adapted in this notebook are:

  • vienna_summer - this variable contains the lon, lat and time keys. These can be adapted to change the desired area and time for the query
  • acube.load - this function loads the product='MTCI_Sentinel_2'. This product can be changed to any of the products available in the ACube repository. The product names are shown in the output of Cell 2.

The generated image MTCI_MAY.tif is a georeferenced image that can be loaded in any standard GIS software, and used for further analysis and calculation.

3.2.2 Sentinel-1 Monthly SIG0 Images

This notebook (TUW_Sentinel1_MMENSIG0.ipynb) displays how to get more information from the metadata of a product, measurement and dataset, and how to use the xarray and matplotlib for plottingIt also shows how to plot a histogram, how to query for measurements and how to save multiple GeoTIFF files.

image

3.2.3 Grid Workflow

This notebook (GRID_WORKFLOW.ipynb) shows how to potentially split processing loads when working with huge amounts of data. The notebook outlines the steps on how to split the product in a self defined grid, and how to identify and load lazily (when needed in processing) each cell of the grid. It also shows how to perform a pixel time series drill.

image

3.2 Using the extended examples to access ACube

The extended examples show some additional basic functions and all of the ACube data products. These are hosted on github https://github.com/eodcgmbh/ACube_notebooks.

To get the examples open the Terminal and clone the repository.

image

To clone the repository run the following command in the terminal.

git clone https://github.com/eodcgmbh/ACube_notebooks.git

A new folder named ACube_notebooks should appear that contains the example notebooks.

3.2.1 Basic Examples

The repository contains basic examples split into topics. All of the examples use ODC core API functions. The basic notebooks are:

  1. 01_Product_search_and_query.ipynb - Shows how to search for data products and query the data

  2. 02_Advanced_search_and_query.ipynb - Shows how to search measurements of products, and query for data measurements

  3. 03_Plotting.ipynb - Shows how to plot the different types of data, or how to create charts

  4. 04_Using_vector_data.ipynb - Shows how to use vector data for querying and masking.

  5. 05_Performing_Calculations.ipynb - Shows how to do band math.

  6. 06_Large_scale_processing.ipynb - Shows how large scale processing can be split

3.2.2 Sentinel data products

The ACube_products folder contains an explanation of each Sentinel data product and how to access it. Currently there are 24 different data products in the ACube which can be used for different analysis including agriculture, vegetation analysis, flood analysis, surface soil moisture, elevation analysis etc.

The folder ACube_products/S1 contains notebooks explaining Sentinel-1 products.

The folder ACube_products/S2 contains notebooks explaining Sentinel-2 products.

The folder ACube_products contains notebooks for other products.

This website relies on temporary cookies to function, but no personal data is ever stored in the cookies. For further information see our

privacy policy.

Accept

Loading ...