Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Better handling of "cube math" like `cube1 / cube2`

オープン
#748 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@soxofaan がすでに取り組んでいます。

2025年3月10日 から。

評価

この issue はまだ評価されていません。

説明

api compliancy bug feature request technical debt usability

The python client has since long a compelling "band math" feature, e.g.:

red = s2cube.band("B04")
nir = s2cube.band("B08")
ndvi = (nir - red) / (nir + red)

which is translated to a reduce_dimension along band dimension with the appropriate reducer.

User however also naively try to use these kind of math expressions without using the .band() method, e.g.:

cube3 = cube1 / cube2

Which kind of works: it will produce a merge_cubes operation with an overlap resolver set to "divide" in this case.
As discussed in https://github.com/Open-EO/openeo-processes/issues/280 this is unfortunately a dangerous approach because it will give unexpected results in situations without 100% overlap

Alternative approach: use merge_cubes without overlap resolver to "stack" bands of both cubes in a single cube and do apply_dimension to combine the bands as desired to a new cube. This would involve quite a bit more steps, but will result in more correct calculation:

  • before merge: rename bands to ensure 0 overlap. Also: if there are no bands yet: make sure there are
  • merge_cubes explicitly without overlap resolver to make sure bands are stacked
  • use apply_dimension (or maybe reduce_dimension in some cases) to implement the desired operation
  • remame bands again to what the user expects

Quite vital to get this working is that band name handling is correct and in line with how it works backend-side. This might be a bit challenging with load_stac use cases where band detection can be a bit fuzzy.

other related issues:

主要言語
Python
スター
219
フォーク
56
平均マージ
2日 21時間
マージ済み PR(30日)
9

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Open-EO/openeo-python-client のほかの issue

Open-EO/openeo-python-client の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。