Skip to main content

Python package for RQA trend calculation for deforestation analysis

Project description

RQADeforestation.py

Python bindings for the Julia package RQADeforestation.jl. It provides functions for fast recurrence quantification analysis (RQA), accelerated using Julia. This library is part of the FAIRSenDD project that utilize Sentinel-1 data for FAIR deforestation detection.

Get Started

Install:

pip install git+https://github.com/EarthyScience/RQADeforestation.py

Run RQA analysis on a single time series:

from rqadeforestation import rqatrend
import numpy as np

x = np.arange(1, 30, step=0.01)
y = np.sin(x) + 0.1 * x
rqatrend(y, 0.5, 10, 1)
# -0.14028027430322332

Use in openEO:

import openeo
connection = openeo.connect("https://openeo.cloud")

cube_in = connection.load_collection(
  "SENTINEL1_SIG0_20M",
  spatial_extent={"west": 16.06, "south": 48.06, "east": 16.67, "north": 48.07},
  temporal_extent=["2023-01-01", "2024-01-01"],
  bands=["VV"]
)

rqatrend = openeo.UDF(
"""
# /// script
# dependencies = [
# "xarray",
# "rqadeforestation @ git+https://github.com/EarthyScience/RQADeforestation.py",
# ]
# ///

import xarray as xr
from rqadeforestation import rqatrend

def apply_datacube(cube: xr.DataArray, context: dict) -> xr.DataArray:
    res_np = rqatrend(cube.to_numpy(), 0.5, 10, 1)
    res_xr = xr.DataArray(res_np)
    return res_xr
"""
)

cube_out = cube_in.apply(process=rqatrend)
result = cube_out.save_result("GTiff")

connection.authenticate_oidc()
job = result.create_job()
job.start_and_wait()
job.get_results().download_files("output")

Motivation

Analyzing high resolution sattelite images at global scale requires to optimize the execution efficiency. Python is required for most openEO workflows in which performance critical parts of the code are written in a compiled programming language. Usually, this is done in C, e.g., array operations in numpy. Julia provides an alternative to accellerate code using a more user-friendly language.

Development

Development workflow:

  1. Write Julia code at https://github.com/EarthyScience/RQADeforestation.jl
  2. Compile using StaticCompiler
  3. Put the binary libraries at rqadeforestation/lib
  4. Add python binding functions to this package
  5. Install this package in openEO and use it in an User-Defined-Function

Citation

F. Cremer, M. Urbazaev, J. Cortés, J. Truckenbrodt, C. Schmullius and C. Thiel, "Potential of Recurrence Metrics from Sentinel-1 Time Series for Deforestation Mapping," in IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing, vol. 13, pp. 5233-5240, 2020, doi: 10.1109/JSTARS.2020.3019333.

Funding

This project was funded by the European Space Agency in the Science Result Long-Term Availability & Reusability Demonstrator Initiative. In addition, this project was supported by the ESA Network of Resources.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rqadeforestation-0.1.0.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rqadeforestation-0.1.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file rqadeforestation-0.1.0.tar.gz.

File metadata

  • Download URL: rqadeforestation-0.1.0.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for rqadeforestation-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5646ba19ae4d377b2a92f7c2557dc7655610444a218fa044629a09b2386abc98
MD5 20cfc3487b46b9ca1b2a72094dac3c59
BLAKE2b-256 a9ad3cce32e0fc4d128e101f4e60c92751fe7b0654c98a03f405cedd425091ed

See more details on using hashes here.

File details

Details for the file rqadeforestation-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for rqadeforestation-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9ba609397bc3334d57fad39d00d43e4be1b5f227c5801cf13879e161a90a36a2
MD5 8c0f6c20c3593dd50e66a8dde451de20
BLAKE2b-256 68df3bab0a15935738e4248485d85f45544e23470de5c9715e1714bc2a14e484

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page