Open-EO / Open-EO/openeo-python-client

Cumbersome way to calculate temporal difference between two cubes from custom processes

Open
#348 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation feature request usability
Dominant language
Python
Stars
217
Forks
56
Avg merge
1d 22h
Merged PRs (30d)
2

Description

# load before flash flood params
before_date = ["2021-06-13","2021-06-13"]
after_date = ["2021-07-18", "2021-07-18"]

# Create a processing graph from the NDWI process using an active openEO connection
before_ndwi = eoconn.datacube_from_process("NDWI", namespace="vito", date=before_date
                                        ,polygon=aoi)
# Create a processing graph from the NDWI process using an active openEO connection
after_ndwi = eoconn.datacube_from_process("NDWI", namespace="vito", date=after_date
                                        ,polygon=aoi)


from openeo.metadata import CollectionMetadata

before_ndwi.metadata = CollectionMetadata({"cube:dimensions":{"t":{"type":"temporal"}}})
after_ndwi.metadata = CollectionMetadata({"cube:dimensions":{"t":{"type":"temporal"}}})
# final result
# compute the change between pre and post image
merging_cubes = after_ndwi.merge_cubes(-before_ndwi)
differenced_cube = merging_cubes.reduce_dimension(dimension="t",reducer='sum')

#differenced_cube.download()

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the shown datacube_from_process calls and the merge_cubes and reduce_dimension entry points. Clarify the intended API for calculating a temporal difference between the two custom-process cubes, then define completion criteria and corresponding tests before changing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.