Access Sentinel2 data from CDSE
Access Sentinel-2 data from the CDSE STAC catalog¶
A DeepESDL example notebook¶
This notebook demonstrates how to access Sentinel-2 data from CDSE via xcube-stac store. The data is fetched via the CDSE STAC API.
The data can be accessed via S3, where key and secret can be obtained following the CDSE access documentation to EO data via S3. The store object will receive the key and secret upon initialization, as demonstrated below.
Please, also refer to the DeepESDL documentation and visit the platform's website for further information!
Brockmann Consult, 2025
This notebook runs with the python environment users-deepesdl-xcube-1.11.0
, please checkout the documentation for help on changing the environment.
%%time
import matplotlib.pyplot as plt
import xarray as xr
from xcube.core.store import new_data_store, get_data_store_params_schema
from xcube_stac.utils import reproject_bbox
CPU times: user 2.23 s, sys: 557 ms, total: 2.79 s Wall time: 4 s
xr.set_options(display_expand_attrs=False)
<xarray.core.options.set_options at 0x7f95fe1e2660>
Next store the credentials in a dictionary.
credentials = dict(
key="xxx",
secret="xxx",
)
There are two data stores available for the CDSE STAC API:
stac-cdse-ardc
: Allows you to open multiple STAC items and assemble them into a 3D spatiotemporal data cube.stac-cdse
: Enables you to open individual STAC items.
Data store to access spatiotemporal analysis-ready data cubes¶
In the following, we will first demonstrate how to use the stac-cdse-ardc
store. To view the parameters to initialize the data store instance, execute the following cell.
Note:
Access requires your S3key
andsecret
.
%%time
store_params = get_data_store_params_schema("stac-cdse-ardc")
store_params
CPU times: user 123 ms, sys: 44.3 ms, total: 167 ms Wall time: 378 ms
<xcube.util.jsonschema.JsonObjectSchema at 0x7f95fd927070>
%%time
store = new_data_store("stac-cdse-ardc", **credentials)
CPU times: user 13 ms, sys: 4.31 ms, total: 17.4 ms Wall time: 148 ms
The following cell shows the available data IDs for the analysis-ready datacube mode. The data IDs point to a STAC collections.
%%time
data_ids = store.list_data_ids()
data_ids
CPU times: user 19 μs, sys: 5 μs, total: 24 μs Wall time: 26.5 μs
['sentinel-2-l2a', 'sentinel-2-l1c', 'sentinel-3-syn-2-syn-ntc']
Below, the parameters for the open_data
method can be viewed for a specific data ID.
%%time
open_params = store.get_open_data_params_schema("sentinel-2-l1c")
open_params
CPU times: user 88.8 ms, sys: 113 ms, total: 201 ms Wall time: 581 ms
<xcube.util.jsonschema.JsonComplexSchema at 0x7f95fcd8ccd0>
The store supports the collection sentinel-2-l1c
and sentinel-2-l2a
. We first get Sentinel-2 Level-1C data by assigning the data_id
to "sentinel-2-l1c"
. We set the bounding box to cover the greater Hamburg area and the time range to second half of July 2020.
%%time
ds = store.open_data(
data_id="sentinel-2-l1c",
bbox=[9.7, 53.3, 10.3, 53.8],
time_range=["2020-07-15", "2020-08-01"],
spatial_res=10 / 111320, # meter in degree
crs="EPSG:4326",
asset_names=["B02", "B03", "B04"],
add_angles=True,
)
ds
CPU times: user 26.9 s, sys: 41.9 ms, total: 27 s Wall time: 35.1 s
<xarray.Dataset> Size: 3GB Dimensions: (time: 7, lon: 6681, lat: 5567, angle_lon: 15, angle_lat: 13, angle: 2, band: 3) Coordinates: * time (time) datetime64[ns] 56B 2020-07-16T10:40:31.024000 ... 2... spatial_ref int64 8B 0 * lon (lon) float64 53kB 9.7 9.7 9.7 9.7 ... 10.3 10.3 10.3 10.3 * lat (lat) float64 45kB 53.8 53.8 53.8 53.8 ... 53.3 53.3 53.3 * angle_lon (angle_lon) float64 120B 9.7 9.746 9.791 ... 10.29 10.34 * angle_lat (angle_lat) float64 104B 53.84 53.79 53.75 ... 53.34 53.3 * angle (angle) object 16B 'zenith' 'azimuth' * band (band) <U3 36B 'B02' 'B03' 'B04' Data variables: B02 (time, lat, lon) float32 1GB dask.array<chunksize=(1, 1024, 1024), meta=np.ndarray> B03 (time, lat, lon) float32 1GB dask.array<chunksize=(1, 1024, 1024), meta=np.ndarray> B04 (time, lat, lon) float32 1GB dask.array<chunksize=(1, 1024, 1024), meta=np.ndarray> solar_angle (angle, time, angle_lat, angle_lon) float32 11kB dask.array<chunksize=(2, 1, 13, 15), meta=np.ndarray> viewing_angle (angle, band, time, angle_lat, angle_lon) float32 33kB dask.array<chunksize=(2, 3, 1, 13, 15), meta=np.ndarray> Attributes: (3)
We can plot the B04 (red) band for a given timestamp as an example. Hereby a mosaicking of multiple tiles have been applied. Additionally, we plot the solar and viewing angle.
%%time
fig, ax = plt.subplots(1, 3, figsize=(20, 6))
ds.B04.isel(time=-1)[::10, ::10].plot(ax=ax[0], vmin=0, vmax=0.2)
ds.solar_angle.isel(angle=0, time=-1).plot(ax=ax[1])
ds.viewing_angle.isel(band=2, angle=0, time=-1).plot(ax=ax[2])
CPU times: user 9.79 s, sys: 216 ms, total: 10 s Wall time: 12.1 s
<matplotlib.collections.QuadMesh at 0x7f95f4551a90>
Next we retrieve the same data cube, but for Level-2a by assigning the data_id
to sentinel-2-l2a
.
%%time
ds = store.open_data(
data_id="sentinel-2-l2a",
bbox=[9.7, 53.3, 10.3, 53.8],
time_range=["2020-07-15", "2020-08-01"],
spatial_res=10 / 111320, # meter in degree
crs="EPSG:4326",
asset_names=["B02", "B03", "B04", "SCL"],
add_angles=True,
)
ds
CPU times: user 34.8 s, sys: 81.9 ms, total: 34.8 s Wall time: 45.1 s
<xarray.Dataset> Size: 4GB Dimensions: (time: 7, lon: 6681, lat: 5567, angle_lon: 15, angle_lat: 13, angle: 2, band: 3) Coordinates: * time (time) datetime64[ns] 56B 2020-07-16T10:40:31.024000 ... 2... spatial_ref int64 8B 0 * lon (lon) float64 53kB 9.7 9.7 9.7 9.7 ... 10.3 10.3 10.3 10.3 * lat (lat) float64 45kB 53.8 53.8 53.8 53.8 ... 53.3 53.3 53.3 * angle_lon (angle_lon) float64 120B 9.7 9.746 9.791 ... 10.29 10.34 * angle_lat (angle_lat) float64 104B 53.84 53.79 53.75 ... 53.34 53.3 * angle (angle) object 16B 'zenith' 'azimuth' * band (band) <U3 36B 'B02' 'B03' 'B04' Data variables: B02 (time, lat, lon) float32 1GB dask.array<chunksize=(1, 1024, 1024), meta=np.ndarray> B03 (time, lat, lon) float32 1GB dask.array<chunksize=(1, 1024, 1024), meta=np.ndarray> B04 (time, lat, lon) float32 1GB dask.array<chunksize=(1, 1024, 1024), meta=np.ndarray> SCL (time, lat, lon) float32 1GB dask.array<chunksize=(1, 1024, 1024), meta=np.ndarray> solar_angle (angle, time, angle_lat, angle_lon) float32 11kB dask.array<chunksize=(2, 1, 13, 15), meta=np.ndarray> viewing_angle (angle, band, time, angle_lat, angle_lon) float32 33kB dask.array<chunksize=(2, 3, 1, 13, 15), meta=np.ndarray> Attributes: (3)
We can plot the B04 (red) band for a given timestamp as an example. Hereby a mosaicking of multiple tiles have been applied. Additionally, we plot the solar and viewing angle.
%%time
fig, ax = plt.subplots(1, 3, figsize=(20, 6))
ds.B04.isel(time=-1)[::10, ::10].plot(ax=ax[0], vmin=0, vmax=0.2)
ds.solar_angle.isel(angle=0, time=-1).plot(ax=ax[1])
ds.viewing_angle.isel(band=2, angle=0, time=-1).plot(ax=ax[2])
CPU times: user 9.82 s, sys: 201 ms, total: 10 s Wall time: 12.7 s
<matplotlib.collections.QuadMesh at 0x7f95d7359d10>
The data access can be sped up when requesting the data in the UTM CRS which is the native UTM of the Sentinel-2 products.
%%time
bbox = [9.7, 53.3, 10.3, 53.8]
crs_target = "EPSG:32632"
bbox_utm = reproject_bbox(bbox, "EPSG:4326", crs_target)
CPU times: user 1.24 ms, sys: 0 ns, total: 1.24 ms Wall time: 793 μs
%%time
ds = store.open_data(
data_id="sentinel-2-l2a",
bbox=bbox_utm,
time_range=["2020-07-15", "2020-08-01"],
spatial_res=10,
crs=crs_target,
asset_names=["B02", "B03", "B04", "SCL"],
add_angles=True,
)
ds
CPU times: user 4.22 s, sys: 92.6 ms, total: 4.31 s Wall time: 12.2 s
<xarray.Dataset> Size: 4GB Dimensions: (time: 11, y: 5619, x: 4054, angle_x: 10, angle_y: 13, angle: 2, band: 3) Coordinates: * time (time) datetime64[ns] 88B 2020-07-15T10:15:59.024000 ... 2... spatial_ref int64 8B 0 * x (x) float64 32kB 5.461e+05 5.461e+05 ... 5.866e+05 5.866e+05 * y (y) float64 45kB 5.962e+06 5.962e+06 ... 5.906e+06 5.906e+06 * angle_x (angle_x) float64 80B 5.461e+05 5.511e+05 ... 5.911e+05 * angle_y (angle_y) float64 104B 5.966e+06 5.961e+06 ... 5.906e+06 * angle (angle) object 16B 'zenith' 'azimuth' * band (band) <U3 36B 'B02' 'B03' 'B04' Data variables: B02 (time, y, x) float32 1GB dask.array<chunksize=(1, 1024, 1024), meta=np.ndarray> B03 (time, y, x) float32 1GB dask.array<chunksize=(1, 1024, 1024), meta=np.ndarray> B04 (time, y, x) float32 1GB dask.array<chunksize=(1, 1024, 1024), meta=np.ndarray> SCL (time, y, x) float32 1GB dask.array<chunksize=(1, 1024, 1024), meta=np.ndarray> solar_angle (angle, time, angle_y, angle_x) float32 11kB dask.array<chunksize=(2, 1, 13, 10), meta=np.ndarray> viewing_angle (angle, band, time, angle_y, angle_x) float32 34kB dask.array<chunksize=(2, 3, 1, 13, 10), meta=np.ndarray> Attributes: (3)
We can plot the B04 (red) band for a given timestamp as an example. Hereby a mosaicking of multiple tiles have been applied. Additionally, we plot the solar and viewing angle.
%%time
fig, ax = plt.subplots(1, 3, figsize=(20, 6))
ds.B04.isel(time=-1)[::10, ::10].plot(ax=ax[0], vmin=0, vmax=0.2)
ds.solar_angle.isel(angle=0, time=-1).plot(ax=ax[1])
ds.viewing_angle.isel(band=2, angle=0, time=-1).plot(ax=ax[2])
CPU times: user 3.7 s, sys: 56.3 ms, total: 3.76 s Wall time: 2.84 s
/home/conda/users/03ab8823-1758107623-131-deepesdl-xcube-1.11.0/lib/python3.13/site-packages/dask/_task_spec.py:759: RuntimeWarning: invalid value encountered in divide return self.func(*new_argspec)
<matplotlib.collections.QuadMesh at 0x7f95d4b84cd0>
Fast timeseries cube generation (single-tile mode)¶
There is also a timeseries mode available that generates a time series cube from a single Sentinel-2 tile. Instead of providing bbox
and crs
, you now supply a point
(lon, lat) together with a bbox_width
in meters (must be < 10,000). The system will cut out a region around the given point, restricted to a single tile and native crs, and stack it along the time dimension. This improves cube generation performance.
Below we again view the open_params
, where the second group shows the parameters needed to trigger the single-tile mode.
%%time
store.get_open_data_params_schema(data_id="sentinel-2-l2a")
CPU times: user 12.9 ms, sys: 0 ns, total: 12.9 ms Wall time: 12.1 ms
<xcube.util.jsonschema.JsonComplexSchema at 0x7f95fcf2a8d0>
%%time
ds = store.open_data(
data_id="sentinel-2-l2a",
point=(10.3, 53.3),
bbox_width=1000,
time_range=["2020-07-15", "2020-08-01"],
spatial_res=10,
asset_names=["B02", "B03", "B04", "SCL"],
)
ds
CPU times: user 483 ms, sys: 19.9 ms, total: 503 ms Wall time: 2.63 s
<xarray.Dataset> Size: 482kB Dimensions: (time: 3, y: 100, x: 100) Coordinates: * x (x) float64 800B 5.861e+05 5.862e+05 ... 5.871e+05 5.871e+05 * y (y) float64 800B 5.907e+06 5.907e+06 ... 5.906e+06 5.906e+06 spatial_ref int64 8B 0 * time (time) datetime64[ns] 24B 2020-07-18T10:25:59.024000 ... 202... Data variables: B02 (time, y, x) float32 120kB dask.array<chunksize=(1, 100, 100), meta=np.ndarray> B03 (time, y, x) float32 120kB dask.array<chunksize=(1, 100, 100), meta=np.ndarray> B04 (time, y, x) float32 120kB dask.array<chunksize=(1, 100, 100), meta=np.ndarray> SCL (time, y, x) float32 120kB dask.array<chunksize=(1, 100, 100), meta=np.ndarray> Attributes: (4)
%%time
ds.B04.isel(time=0).plot(vmin=0, vmax=0.2)
CPU times: user 247 ms, sys: 3.85 ms, total: 251 ms Wall time: 6.42 s
<matplotlib.collections.QuadMesh at 0x7f95d70cb750>
Data store to access single observations¶
Now, we initiate the data store to access each STAC item representing one observation tile.
%%time
store = new_data_store("stac-cdse", **credentials)
CPU times: user 14.1 ms, sys: 104 μs, total: 14.2 ms Wall time: 91.9 ms
In the next step, we can search for items using search parameters. The following code shows which search parameters are available.
%%time
search_params = store.get_search_params_schema()
search_params
CPU times: user 29 μs, sys: 0 ns, total: 29 μs Wall time: 32.2 μs
<xcube.util.jsonschema.JsonObjectSchema at 0x7f95d6b86a50>
Next, we will search for tiles of Sentinel-2 data. The data IDs point to a STAC item's JSON and are specified by the segment of the URL that follows the catalog's URL.
%%time
descriptors = list(
store.search_data(
collections=["sentinel-2-l2a"],
bbox=[9, 47, 10, 48],
time_range=["2020-07-01", "2020-07-05"],
)
)
[d.to_dict() for d in descriptors]
CPU times: user 252 ms, sys: 15.9 ms, total: 268 ms Wall time: 2.37 s
[{'data_id': 'collections/sentinel-2-l2a/items/S2B_MSIL2A_20200705T101559_N0500_R065_T32UNU_20230530T175912', 'data_type': 'dataset', 'bbox': [8.999728, 47.755819, 10.493269, 48.753013], 'time_range': ('2020-07-05T10:15:59.024Z', '2020-07-05T10:15:59.024Z')}, {'data_id': 'collections/sentinel-2-l2a/items/S2B_MSIL2A_20200705T101559_N0500_R065_T32UMU_20230530T175912', 'data_type': 'dataset', 'bbox': [8.087776, 47.759622, 9.132783, 48.752937], 'time_range': ('2020-07-05T10:15:59.024Z', '2020-07-05T10:15:59.024Z')}, {'data_id': 'collections/sentinel-2-l2a/items/S2B_MSIL2A_20200705T101559_N0500_R065_T32TNT_20230530T175912', 'data_type': 'dataset', 'bbox': [8.999733, 46.85664, 10.467277, 47.853702], 'time_range': ('2020-07-05T10:15:59.024Z', '2020-07-05T10:15:59.024Z')}, {'data_id': 'collections/sentinel-2-l2a/items/S2B_MSIL2A_20200705T101559_N0500_R065_T32TMT_20230530T175912', 'data_type': 'dataset', 'bbox': [7.760786, 46.858555, 9.13047, 47.853628], 'time_range': ('2020-07-05T10:15:59.024Z', '2020-07-05T10:15:59.024Z')}, {'data_id': 'collections/sentinel-2-l2a/items/S2A_MSIL2A_20200703T103031_N0500_R108_T32UNU_20230613T212700', 'data_type': 'dataset', 'bbox': [8.999728, 47.761055, 10.094773, 48.753013], 'time_range': ('2020-07-03T10:30:31.024Z', '2020-07-03T10:30:31.024Z')}, {'data_id': 'collections/sentinel-2-l2a/items/S2A_MSIL2A_20200703T103031_N0500_R108_T32UMU_20230613T212700', 'data_type': 'dataset', 'bbox': [7.639177, 47.757404, 9.132783, 48.752937], 'time_range': ('2020-07-03T10:30:31.024Z', '2020-07-03T10:30:31.024Z')}, {'data_id': 'collections/sentinel-2-l2a/items/S2A_MSIL2A_20200703T103031_N0500_R108_T32TNT_20230613T212700', 'data_type': 'dataset', 'bbox': [8.999733, 46.864171, 9.68382, 47.853702], 'time_range': ('2020-07-03T10:30:31.024Z', '2020-07-03T10:30:31.024Z')}, {'data_id': 'collections/sentinel-2-l2a/items/S2A_MSIL2A_20200703T103031_N0500_R108_T32TMT_20230613T212700', 'data_type': 'dataset', 'bbox': [7.662865, 46.858176, 9.13047, 47.853628], 'time_range': ('2020-07-03T10:30:31.024Z', '2020-07-03T10:30:31.024Z')}]
In the next step, we can open the data for each data ID. The following code shows which parameters are available for opening the data.
%%time
open_params = store.get_open_data_params_schema()
open_params
CPU times: user 50 μs, sys: 0 ns, total: 50 μs Wall time: 54.1 μs
<xcube.util.jsonschema.JsonObjectSchema at 0x7f95d6b86970>
We select the band B04 (red), B03 (green), B02 (blue), and the science classification layer (SLC), and lazily load the corresponding data.
%%time
ds = store.open_data(
"collections/sentinel-2-l2a/items/S2B_MSIL2A_20200705T101559_N0500_R065_T32TMT_20230530T175912",
asset_names=["B04", "B03", "B02", "SCL"],
add_angles=True,
)
ds
CPU times: user 784 ms, sys: 11.9 ms, total: 796 ms Wall time: 2.12 s
<xarray.Dataset> Size: 2GB Dimensions: (y: 10980, x: 10980, angle_x: 23, angle_y: 23, angle: 2, band: 3) Coordinates: * x (x) float64 88kB 4e+05 4e+05 4e+05 ... 5.097e+05 5.098e+05 * y (y) float64 88kB 5.3e+06 5.3e+06 ... 5.19e+06 5.19e+06 spatial_ref int64 8B 0 * angle_x (angle_x) float64 184B 4e+05 4.05e+05 ... 5.05e+05 5.1e+05 * angle_y (angle_y) float64 184B 5.3e+06 5.295e+06 ... 5.19e+06 * angle (angle) object 16B 'zenith' 'azimuth' * band (band) <U3 36B 'B02' 'B03' 'B04' Data variables: B04 (y, x) float32 482MB dask.array<chunksize=(1024, 1024), meta=np.ndarray> B03 (y, x) float32 482MB dask.array<chunksize=(1024, 1024), meta=np.ndarray> B02 (y, x) float32 482MB dask.array<chunksize=(1024, 1024), meta=np.ndarray> SCL (y, x) float32 482MB dask.array<chunksize=(1024, 1024), meta=np.ndarray> solar_angle (angle, angle_y, angle_x) float32 4kB dask.array<chunksize=(2, 23, 23), meta=np.ndarray> viewing_angle (angle, band, angle_y, angle_x) float32 13kB dask.array<chunksize=(2, 3, 23, 23), meta=np.ndarray> Attributes: (3)
We plot the loaded data as an example below.
%%time
ds.B04[::10, ::10].plot(vmin=0.0, vmax=0.2)
CPU times: user 17 s, sys: 343 ms, total: 17.4 s Wall time: 18.7 s
<matplotlib.collections.QuadMesh at 0x7f95fd8ba490>
Next, we do the same for Sentine-2 Level-1C. We first search in the collection sentinel-2-l1c
and open one tile.
%%time
descriptors = list(
store.search_data(
collections=["sentinel-2-l1c"],
bbox=[9, 47, 10, 48],
time_range=["2020-07-01", "2020-07-05"],
)
)
[d.to_dict() for d in descriptors]
CPU times: user 191 ms, sys: 4 ms, total: 195 ms Wall time: 2.61 s
[{'data_id': 'collections/sentinel-2-l1c/items/S2B_MSIL1C_20200705T101559_N0500_R065_T32UNU_20230530T084300', 'data_type': 'dataset', 'bbox': [8.999728, 47.755819, 10.493269, 48.753013], 'time_range': ('2020-07-05T10:15:59.024Z', '2020-07-05T10:15:59.024Z')}, {'data_id': 'collections/sentinel-2-l1c/items/S2B_MSIL1C_20200705T101559_N0500_R065_T32UMU_20230530T084300', 'data_type': 'dataset', 'bbox': [8.087776, 47.759622, 9.132783, 48.752937], 'time_range': ('2020-07-05T10:15:59.024Z', '2020-07-05T10:15:59.024Z')}, {'data_id': 'collections/sentinel-2-l1c/items/S2B_MSIL1C_20200705T101559_N0500_R065_T32TNT_20230530T084300', 'data_type': 'dataset', 'bbox': [8.999733, 46.85664, 10.467277, 47.853702], 'time_range': ('2020-07-05T10:15:59.024Z', '2020-07-05T10:15:59.024Z')}, {'data_id': 'collections/sentinel-2-l1c/items/S2B_MSIL1C_20200705T101559_N0500_R065_T32TMT_20230530T084300', 'data_type': 'dataset', 'bbox': [7.760786, 46.858555, 9.13047, 47.853628], 'time_range': ('2020-07-05T10:15:59.024Z', '2020-07-05T10:15:59.024Z')}, {'data_id': 'collections/sentinel-2-l1c/items/S2A_MSIL1C_20200703T103031_N0500_R108_T32UNU_20230613T124137', 'data_type': 'dataset', 'bbox': [8.999728, 47.761055, 10.094773, 48.753013], 'time_range': ('2020-07-03T10:30:31.024Z', '2020-07-03T10:30:31.024Z')}, {'data_id': 'collections/sentinel-2-l1c/items/S2A_MSIL1C_20200703T103031_N0500_R108_T32UMU_20230613T124137', 'data_type': 'dataset', 'bbox': [7.639177, 47.757404, 9.132783, 48.752937], 'time_range': ('2020-07-03T10:30:31.024Z', '2020-07-03T10:30:31.024Z')}, {'data_id': 'collections/sentinel-2-l1c/items/S2A_MSIL1C_20200703T103031_N0500_R108_T32TNT_20230613T124137', 'data_type': 'dataset', 'bbox': [8.999733, 46.864171, 9.68382, 47.853702], 'time_range': ('2020-07-03T10:30:31.024Z', '2020-07-03T10:30:31.024Z')}, {'data_id': 'collections/sentinel-2-l1c/items/S2A_MSIL1C_20200703T103031_N0500_R108_T32TMT_20230613T124137', 'data_type': 'dataset', 'bbox': [7.662865, 46.858176, 9.13047, 47.853628], 'time_range': ('2020-07-03T10:30:31.024Z', '2020-07-03T10:30:31.024Z')}]
%%time
ds = store.open_data(
"collections/sentinel-2-l1c/items/S2B_MSIL1C_20200705T101559_N0500_R065_T32TMT_20230530T084300",
asset_names=["B04", "B03", "B02"],
add_angles=True,
)
ds
CPU times: user 206 ms, sys: 8.06 ms, total: 215 ms Wall time: 1.49 s
<xarray.Dataset> Size: 1GB Dimensions: (x: 10980, y: 10980, angle_x: 23, angle_y: 23, angle: 2, band: 3) Coordinates: * x (x) float64 88kB 4e+05 4e+05 4e+05 ... 5.097e+05 5.098e+05 * y (y) float64 88kB 5.3e+06 5.3e+06 ... 5.19e+06 5.19e+06 spatial_ref int64 8B 0 * angle_x (angle_x) float64 184B 4e+05 4.05e+05 ... 5.05e+05 5.1e+05 * angle_y (angle_y) float64 184B 5.3e+06 5.295e+06 ... 5.19e+06 * angle (angle) object 16B 'zenith' 'azimuth' * band (band) <U3 36B 'B02' 'B03' 'B04' Data variables: B04 (y, x) float32 482MB dask.array<chunksize=(1024, 1024), meta=np.ndarray> B03 (y, x) float32 482MB dask.array<chunksize=(1024, 1024), meta=np.ndarray> B02 (y, x) float32 482MB dask.array<chunksize=(1024, 1024), meta=np.ndarray> solar_angle (angle, angle_y, angle_x) float32 4kB dask.array<chunksize=(2, 23, 23), meta=np.ndarray> viewing_angle (angle, band, angle_y, angle_x) float32 13kB dask.array<chunksize=(2, 3, 23, 23), meta=np.ndarray> Attributes: (3)
%%time
ds.B04[::10, ::10].plot(vmin=0.0, vmax=0.2)
CPU times: user 16.5 s, sys: 318 ms, total: 16.8 s Wall time: 18.7 s
<matplotlib.collections.QuadMesh at 0x7f95d6bf7110>