xcube-dev / xcube-cci

An xcube plugin to allow generating data cubes from the ESA CCI Open Data Portal
MIT License
2 stars 0 forks source link

store.open_data ignores parameter 'bbox' #24

Closed AliceBalfanz closed 3 years ago

AliceBalfanz commented 3 years ago

When requesting a cci-cube for dataset_ID 'esacci.SST.day.L4.SSTdepth.multi-sensor.multi-platform.OSTIA.1-1.r1' the parameter bbox is ignored, and the global extent is returned:

To reproduce:

%matplotlib inline
# CCI Data Store requires asyncio. In order to work in Notebooks, we need to do the following:
import nest_asyncio
nest_asyncio.apply()

from xcube.core.store import find_data_store_extensions
from xcube.core.store import get_data_store_params_schema
from xcube.core.store import new_data_store

store = new_data_store('cciodp')
store

dataset = store.open_data(
    'esacci.SST.day.L4.SSTdepth.multi-sensor.multi-platform.OSTIA.1-1.r1', 
    variable_names=['analysed_sst'],
    bbox=[5, 35, 6, 36],
    time_range=['2008-07-01','2008-07-10'])

dataset

dataset.analysed_sst.isel(time=0).plot.imshow(cmap='plasma')

image

TonioF commented 3 years ago

If you do not specify the opener, the cci odp data store will return data as a dataset. For datasets, spatial subsetting is not supported (as they might not have the necessary spatial dimensions). To create a subset, you need to specify to open the data as a cube: dataset = store.open_data( 'esacci.SST.day.L4.SSTdepth.multi-sensor.multi-platform.OSTIA.1-1.r1', opener_id='dataset[cube]:zarr:cciodp' variable_names=['analysed_sst'], bbox=[5, 35, 6, 36], time_range=['2008-07-01','2008-07-10'])

(In your example, you only get a white area, so I recommend to use another bounding box to see the effect.)

This does not mean that there is no bug here, though. Calling store.get_open_data_params_schema() should tell you that you have to use the global bounding box extent, but it doesn't.

TonioF commented 3 years ago

Will be solved by #34 .

TonioF commented 3 years ago

Aolved by #34