Open-EO / FuseTS

Time series Fusion toolbox integrated with openEO
https://open-eo.github.io/FuseTS/
Other
22 stars 4 forks source link

openEO is not returning all bands after UDF execution #92

Closed JanssenBrm closed 1 year ago

JanssenBrm commented 1 year ago

On the openeo-publish branch we are currently integrating the different FuseTS services into openEO. One of the services we are curently working on is the Phenology service. In the following file, you can find a function that tests the Phenology UDF through openEO:

https://github.com/Open-EO/FuseTS/blob/openeo_publish/src/fusets/openeo/services/publish_phenology.py#L34

When the UDF is executed, the result seems to be valid datacube that contains 18 bands (see log entry with Phenology result . Each of these bands represent one of the phenology metrics that are calculated.

MicrosoftTeams-image

However, after downloading the result, there is only 1 band left. It looks like some of the band information gets lost.

image

JanssenBrm commented 1 year ago

I'm wondering if this is caused by using the apply_dimension as the data variable of the downloaded netcdf looks pretty strange:

var        (phenology, y, x) float64 0.8873 0.8689 0.8909 ... 0.8858 0.9385

I've also tried the following paths, but without success:

JanssenBrm commented 1 year ago

@soxofaan / @jdries - FYI

JanssenBrm commented 1 year ago

I've also tried using the apply_neighborhood function with the following code:

size = 125
phenology = base_ndvi.apply_neighborhood(process=lambda x: run_udf(x, udf=load_phenology_udf(), runtime="Python"),
                                              size=[
                                             {'dimension': 'x', 'value': size, 'unit': 'px'},
                                             {'dimension': 'y', 'value': size, 'unit': 'px'}
                                         ], overlap=[])

However this results in an error that is also reported in https://github.com/Open-EO/openeo-geopyspark-driver/issues/434

JanssenBrm commented 1 year ago

It looks like summarizing your experiments really help with resolving the issue 😄 . After looking at the screenshots I noticed that the resulting band from the UDF is called var. Applying the following code did the trick:

phenology = phenology.add_dimension('var', phenology_bands[0], 'bands')
phenology = phenology.rename_labels(dimension='var', target=phenology_bands)
soxofaan commented 1 year ago

:duck: