<jupyter_start><jupyter_text>Example 3 - Analysis of Time Series from Sentinel HubThis example demonstrates the following time-series capabilites: * List time stamps for variable;* Compute time-series for point;* Compute time-series for geometry.    To run this Notebook, make sure the Sentinel Hub / xcube Integration is setup correctly, see [Ex0-DCFS-Setup](./Ex0-DCFS-Setup.ipynb).<jupyter_code>from xcube_sh.config import CubeConfig
from xcube_sh.cube import open_cube
from xcube_sh.sentinelhub import SentinelHub
import xarray as xr
from xcube.core.geom import mask_dataset_by_geometry
from xcube.core.geom import rasterize_features
import matplotlib.pyplot as plt
import gdal
x1 = 10.11 # degree
y1 = 54.17  # degree
x2 = 10.20 # degree
y2 = 54.22  # degree

bbox = x1, y1, x2, y2
spatial_res = 0.00018   # = 20.038 meters in degree
cube_config = CubeConfig(dataset_name='S2L2A',
                         band_names=['B04'],
                         tile_size=[512, 512],
                         bbox=bbox,
                         spatial_res=spatial_res,
                         time_range=['2019-01-01', '2019-12-31'],
                         time_tolerance='1d')  
cube = open_cube(cube_config)
cube<jupyter_output><empty_output><jupyter_text>List time stamps vor observations<jupyter_code>cube.time.data
#cube.to_zarr('ts_cube.zarr')
cube = xr.open_zarr("ts_cube.zarr").chunk(dict(time=cube.time.size,lon=10,lat=10))<jupyter_output><empty_output><jupyter_text>Get time-series for point, nearest neighbour and spatially interpolated<jupyter_code>cube.B04.sel(lon=10.1256, lat=54.237,method='nearest').plot(figsize=[20,4])<jupyter_output><empty_output><jupyter_text>Time-series for geometry<jupyter_code>import IPython.display
aoi = dict(type='Polygon', coordinates=[[[10.14,54.20],[10.14,54.22],[10.18,54.19],[10.19,54.18],[10.14,54.20]]] )
IPython.display.GeoJSON(aoi)
aoi
masked_cube = mask_dataset_by_geometry(cube,aoi)
masked_cube.B04.isel(time=1).plot.imshow()
masked_cube.mean().compute()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12076583210603829, 'fraction_numerical': 0.06283750613647521, 'mean_word_length': 4.293506493506493, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '13061', 'license': 'MIT', 'n_tokens_mistral': 834, 'n_tokens_neox': 743, 'n_words': 137, 'path': 'examples/notebooks/Ex3-DCFS-Timeseries.ipynb', 'repo_name': 'geoanalytics-ca/xcube-sh', 'size': '2037'}