Closed JanssenBrm closed 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:
reduce_dimension
, but no improvements there, with or without the t
dimension (on which I reduce the data cube).metadata = CollectionMetadata({})
metadata = metadata.add_dimension('var', '', 'bands')\
.rename_labels(dimension='var', target=phenology_bands)
phenology.metadata = metadata
bands
already exists. When removing the add_dimension
statement, another error is thrown (ValueError: Invalid dimension 'bands'. Should be one of ['t', 'x', 'y']
)
phenology = phenology.add_dimension('bands', phenology_bands[0], 'bands')
phenology = phenology.rename_labels(dimension='bands', target=phenology_bands)
@soxofaan / @jdries - FYI
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
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)
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.However, after downloading the result, there is only 1 band left. It looks like some of the band information gets lost.