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 a t_to_bands function #109

Open
VincentVerelst opened this issue May 28, 2024 · 0 comments
Open

Implement a t_to_bands function #109

VincentVerelst opened this issue May 28, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@VincentVerelst
Copy link
Collaborator

VincentVerelst commented May 28, 2024

Typically, for feature extractions in parquet/csv/... format the time dimension is removed and timesteps are mapped to the band dimension.
Currently, users have to take care of this manually, with a script like this:

from openeo.processes import ProcessBuilder, array_create

def time_to_bands(input_timeseries:ProcessBuilder):
    tsteps = array_create(data=[input_timeseries.array_element(i) for i in range(3)])
    return tsteps
cube = cube.apply_dimension(dimension='t',
                            target_dimension='bands',
                            process=time_to_bands)

tstep_labels = [f'S2-L2A-EVI_t{i}' for i in range(3)]
cube = cube.rename_labels('bands', tstep_labels)

Given that his happens commonly, we could implement a function that performs this operation in GFMap, so that the user only needs to provide the amount of timesteps (hardcoded as 3 in the example above).

@VincentVerelst VincentVerelst added the enhancement New feature or request label May 28, 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

No branches or pull requests

1 participant