A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://openeo.org/documentation/1.0/python/client-side-processing.html below:

Get started with the openEO Python Client Client Side Processing

# Get started with the openEO Python Client Client Side Processing # Background

The client-side processing functionality allows to test and use openEO with its processes locally, i.e. without any connection to an openEO back-end. It relies on the projects openeo-pg-parser-networkx (opens new window), which provides an openEO process graph parsing tool, and openeo-processes-dask (opens new window), which provides an Xarray and Dask implementation of most openEO processes.

# Installation

Important

This feature requires Python>=3.9.

The openEO Python client library can easily be installed with a tool like pip, for example:

# Usage

Every openEO process graph relies on data which is typically provided by a cloud infrastructure (the openEO back-end). The client-side processing adds the possibility to read and use local netCDFs, geoTIFFs, ZARR files, and remote STAC Collections or Items for your experiments.

# STAC Collections and Items

Important

The provided examples using STAC rely on third party STAC Catalogs, we can't guarantee that the urls will remain valid.

With the load_stac process it's possible to load and use data provided by remote or local STAC Collections or Items. The following code snippet loads Sentinel-2 L2A data from a public STAC Catalog, using specific spatial and temporal extent, band name and also properties for cloud coverage.

When calling the .execute() method on a Datacube created from a LocalConnection, an xarray.DataArray object containing dask arrays is returned:

# Local Collections

If you want to use our sample data, please clone this repository:

With some sample data we can now check the STAC metadata for the local files by doing:

This code will parse the metadata content of each netCDF, geoTIFF or ZARR file in the provided folders and return a JSON object containing the STAC representation of the metadata. If this code is run in a Jupyter Notebook, the metadata will be rendered nicely.

# Local Processing

Let's start with the provided sample netCDF of Sentinel-2 data:

As you can see in the previous example, we are using a call to .execute() which will execute locally the generated openEO process graph. In this case, the process graph consist only in a single load_collection, which performs lazy loading of the data. With this first step you can check if the data is being read correctly by openEO.

Looking at the metadata of this netCDF sample, we can see that it contains the bands B04, B03, B02, B08 and SCL. Additionally, we also see that it is composed by more than one element in time and that it covers the month of June 2022.

We can now do a simple processing for demo purposes, let's compute the median NDVI in time and visualize the result:

We can perform the same example using data provided by STAC Collection:

# Client-Side Processing Example Notebooks # Additional Information

Additional information and resources about the openEO Python Client Library:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4