xcube-dev / xcube-sh

An xcube plugin to allow generating data cubes from the Sentinel Hub Cloud API
MIT License
12 stars 10 forks source link

BYOC collections time-stamps #67

Closed maximlamare closed 2 years ago

maximlamare commented 2 years ago

Disclaimer: I am opening a series of issues that are preventing the use of xcube-sh for a specific workflow.

BYOC collections time-stamps

This point has already been mentioned in the past, but I'm reopening the issue in order to find a technical solution that can lead us to solving it.

When requesting a BYOC collection as following:

cube_config = CubeConfig(dataset_name='CUSTOM',
                         band_names=['myband'],
                         bbox=aoi_coords,
                         crs = projection_code,
                         time_range=['2018-07-01', '2019-12-31'],
                         time_period="1d",
                         spatial_res=spatial_res,
                         band_sample_types='FLOAT32',
                         collection_id=my_collection_id
                         )
my_cube = open_cube(cube_config)

the cube is filled with timestamps for each day between the start date and the end date. Removing the time_period parameter cause error #35 . The "fix" is to then to filter the cube for nodata, but this is computationally costly (significant processing time).

BYOC collections do work with the Catalog API, therefore it should be quite straightforward to implement a feature that allows the service to return a cube comprising only the dates that contain data.