Hi,
i’m new to Sentinel Hub and I’m trying to create a data cube with data from Landsat8 on EDC using xcube as such:
cube_config = CubeConfig(dataset_name=‘LANDSAT_OT_L2’,
band_names=[‘B10’],
tile_size=[256,256],
bbox=my_bbox,
spatial_res=spatial_res,
time_range=time_interval,
time_period=‘8D’)
sh_credentials.update(api_url=‘https://services-uswest2.sentinel-hub.com’)
cube = open_cube(cube_config, **sh_credentials)
data = cube[‘B10’].data
data.compute()
but I get the following error :
Could you tell me what I’m doing wrong or indicate another way of doing it ?
Thanks in advance
Julie
Hi Julie,
As you are requesting Landsat 8 and 9 Level 2 data collections, it’s important to specify API URL endpoint
as it is different than the default setting in this case.
In addition, the dataset_name needs to be updated as the name specified by you does not exist. The method to list the dataset names you can used is:
SH = SentinelHub()
SH.dataset_names
This will return the list of data collection names that are supported by the xcube-sh plugin.
You can then configure your datacube like below:
bbox = (11.15, 46.7, 11.2, 46.75)
cube_config = CubeConfig(dataset_name="LOTL2",
band_names=["B10"],
bbox=bbox,
spatial_res=0.0018,
time_range=["2018-01-08", "2018-02-11"],
time_tolerance='30min')
and then open it like this:
# Open cube (on the fly)
cube = open_cube(cube_config, api_url="https://services-uswest2.sentinel-hub.com")
# Display contents
cube
Note how I have added the api_url
parameter to the open_cube
function. Doing this should successfully configure and then open the datacube.
In addition, we will ensure we update the documentation to include the dataset names for each collection to use with xcube as this is currently not too clear.
If you have any additional issues, please let us know and we will help solve them with you!
1 Like
Thank you so much, it’s much clearer !