Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement virtual band on collection fetchers #98

Open
GriffinBabe opened this issue Apr 19, 2024 · 0 comments
Open

Implement virtual band on collection fetchers #98

GriffinBabe opened this issue Apr 19, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@GriffinBabe
Copy link
Collaborator

At the moment, users can only compute special bands by manually using the openEO client and then merging the compute cubes in the collection fetcher parameters. For example:

bands = ["S2-L2A-B04", "S2-L2A-B03", "S2-L2A-B02"]

# Compute the SCL dilation mask
scl_cube = connection.load_collection(
    collection_id="SENTINEL2_L2A",
    bands=["SCL"],
    temporal_extent=temporal_extent,
    spatial_extent=spatial_extent
)
scl_dilated_mask = scl_cube.process(
    "to_scl_dilation_mask",
    data=scl_cube,
    scl_band_name="SCL",
).rename_labels("bands", ["S2-L2A-SCL_DILATED_MASK"])

extraction_parameters = {
    "pre-merge": scl_dilated_mask,
}

extractor = build_sentinel2_l2a_extractor(
    backend_context,
    bands=bands,
    fetch_type=fetch_type,
    **extraction_parameters,
)

While the pre-merge field remains important for high level, custom pipelines, many common bands such as results to the SCL dilation or the BAP cloud distance could be directly computed by simply adding a new band.

bands = ["S2-L2A-B04", "S2-L2A-B03", "S2-L2A-B02", "S2-SCL_DILATED_MASK"]

A virtual layer logic could be triggered within the extractor to take care of those bands.

@GriffinBabe GriffinBabe self-assigned this Apr 19, 2024
@GriffinBabe GriffinBabe added the enhancement New feature or request label Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant