From a4945b07a6c58c079b733dcfa776f9eba409b119 Mon Sep 17 00:00:00 2001 From: konstntokas Date: Fri, 24 Apr 2026 10:12:59 +0200 Subject: [PATCH 1/9] checkout comp --- examples/debug.py | 21 + examples/sentinel_3_analysis.ipynb | 5911 ++--------------- integration/test_data/dem_small.zarr/.zattrs | 1 + integration/test_data/dem_small.zarr/.zgroup | 3 + .../test_data/dem_small.zarr/.zmetadata | 116 + .../test_data/dem_small.zarr/dem/.zarray | 22 + .../test_data/dem_small.zarr/dem/.zattrs | 10 + integration/test_data/dem_small.zarr/dem/0.0 | Bin 0 -> 1006715 bytes .../test_data/dem_small.zarr/lat/.zarray | 20 + .../test_data/dem_small.zarr/lat/.zattrs | 5 + integration/test_data/dem_small.zarr/lat/0 | Bin 0 -> 1367 bytes .../test_data/dem_small.zarr/lon/.zarray | 20 + .../test_data/dem_small.zarr/lon/.zattrs | 5 + integration/test_data/dem_small.zarr/lon/0 | Bin 0 -> 2381 bytes .../dem_small.zarr/spatial_ref/.zarray | 10 + .../dem_small.zarr/spatial_ref/.zattrs | 15 + .../test_data/dem_small.zarr/spatial_ref/0 | Bin 0 -> 8 bytes xarray_eopf/amodes/sentinel3.py | 74 +- xarray_eopf/utils.py | 64 + xarray_eopf/version.py | 2 +- 20 files changed, 928 insertions(+), 5371 deletions(-) create mode 100644 examples/debug.py create mode 100644 integration/test_data/dem_small.zarr/.zattrs create mode 100644 integration/test_data/dem_small.zarr/.zgroup create mode 100644 integration/test_data/dem_small.zarr/.zmetadata create mode 100644 integration/test_data/dem_small.zarr/dem/.zarray create mode 100644 integration/test_data/dem_small.zarr/dem/.zattrs create mode 100644 integration/test_data/dem_small.zarr/dem/0.0 create mode 100644 integration/test_data/dem_small.zarr/lat/.zarray create mode 100644 integration/test_data/dem_small.zarr/lat/.zattrs create mode 100644 integration/test_data/dem_small.zarr/lat/0 create mode 100644 integration/test_data/dem_small.zarr/lon/.zarray create mode 100644 integration/test_data/dem_small.zarr/lon/.zattrs create mode 100644 integration/test_data/dem_small.zarr/lon/0 create mode 100644 integration/test_data/dem_small.zarr/spatial_ref/.zarray create mode 100644 integration/test_data/dem_small.zarr/spatial_ref/.zattrs create mode 100644 integration/test_data/dem_small.zarr/spatial_ref/0 diff --git a/examples/debug.py b/examples/debug.py new file mode 100644 index 0000000..f7caeab --- /dev/null +++ b/examples/debug.py @@ -0,0 +1,21 @@ +import pystac_client +import xarray as xr + +catalog = pystac_client.Client.open("https://stac.core.eopf.eodc.eu") +items = list( + catalog.search( + collections=["sentinel-3-olci-l1-efr"], + bbox=[7.2, 44.5, 7.4, 44.7], + datetime=["2026-03-13", "2026-03-13"], + ).items() +) +item = items[0] + +ds = xr.open_dataset( + item.assets["product"].href, + engine="eopf-zarr", + resolution=0.01, + bbox=[5, 40, 15, 48], + chunks={}, +) +print(ds) diff --git a/examples/sentinel_3_analysis.ipynb b/examples/sentinel_3_analysis.ipynb index 3380548..9192f2e 100644 --- a/examples/sentinel_3_analysis.ipynb +++ b/examples/sentinel_3_analysis.ipynb @@ -66,16 +66,21 @@ }, { "cell_type": "code", - "execution_count": 1, "id": "c67a8abc-36ab-4565-892f-c7bce452c290", - "metadata": {}, - "outputs": [], + "metadata": { + "ExecuteTime": { + "end_time": "2026-04-24T08:02:07.412441592Z", + "start_time": "2026-04-24T08:02:04.624045299Z" + } + }, "source": [ "import matplotlib.pyplot as plt\n", "import pyproj\n", "import pystac_client\n", "import xarray as xr" - ] + ], + "outputs": [], + "execution_count": 1 }, { "cell_type": "markdown", @@ -106,10 +111,13 @@ "id": "61aaf5bf32d1b1fb" }, { - "metadata": {}, + "metadata": { + "ExecuteTime": { + "end_time": "2026-04-24T08:02:09.121329740Z", + "start_time": "2026-04-24T08:02:07.420038827Z" + } + }, "cell_type": "code", - "outputs": [], - "execution_count": null, "source": [ "catalog = pystac_client.Client.open(\"https://stac.core.eopf.eodc.eu\")\n", "items = list(\n", @@ -121,17 +129,36 @@ ")\n", "items" ], - "id": "1642d3ef3ac4e706" + "id": "1642d3ef3ac4e706", + "outputs": [ + { + "data": { + "text/plain": [ + "[,\n", + " ]" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 2 }, { "cell_type": "code", - "execution_count": 3, "id": "bc0f93c0-6539-4937-b775-d6061b136909", - "metadata": {}, - "outputs": [], + "metadata": { + "ExecuteTime": { + "end_time": "2026-04-24T08:02:09.166195894Z", + "start_time": "2026-04-24T08:02:09.149096214Z" + } + }, "source": [ "item = items[0]" - ] + ], + "outputs": [], + "execution_count": 3 }, { "cell_type": "markdown", @@ -147,12 +174,47 @@ }, { "cell_type": "code", - "execution_count": 4, "id": "76045d5f-3085-4bbf-b201-9e45d0f98253", - "metadata": {}, + "metadata": { + "ExecuteTime": { + "end_time": "2026-04-24T08:02:30.526773960Z", + "start_time": "2026-04-24T08:02:09.171291282Z" + } + }, + "source": [ + "ds = xr.open_dataset(\n", + " item.assets[\"product\"].href,\n", + " engine=\"eopf-zarr\",\n", + " chunks={}\n", + ")\n", + "ds" + ], "outputs": [ { "data": { + "text/plain": [ + " Size: 4GB\n", + "Dimensions: (lon: 5157, lat: 4791)\n", + "Coordinates:\n", + " * lon (lon) float64 41kB -4.786 -4.782 -4.778 ... 15.21 15.22 15.22\n", + " * lat (lat) float64 38kB 52.46 52.46 52.46 ... 39.56 39.56 39.55\n", + " spatial_ref int64 8B ...\n", + "Data variables: (12/21)\n", + " oa01_radiance (lat, lon) float64 198MB dask.array\n", + " oa02_radiance (lat, lon) float64 198MB dask.array\n", + " oa03_radiance (lat, lon) float64 198MB dask.array\n", + " oa04_radiance (lat, lon) float64 198MB dask.array\n", + " oa05_radiance (lat, lon) float64 198MB dask.array\n", + " oa06_radiance (lat, lon) float64 198MB dask.array\n", + " ... ...\n", + " oa16_radiance (lat, lon) float64 198MB dask.array\n", + " oa17_radiance (lat, lon) float64 198MB dask.array\n", + " oa18_radiance (lat, lon) float64 198MB dask.array\n", + " oa19_radiance (lat, lon) float64 198MB dask.array\n", + " oa20_radiance (lat, lon) float64 198MB dask.array\n", + " oa21_radiance (lat, lon) float64 198MB dask.array\n", + "Attributes: (9)" + ], "text/html": [ "
\n", "\n", @@ -716,9 +778,9 @@ " oa19_radiance (lat, lon) float64 198MB dask.array<chunksize=(2048, 2048), meta=np.ndarray>\n", " oa20_radiance (lat, lon) float64 198MB dask.array<chunksize=(2048, 2048), meta=np.ndarray>\n", " oa21_radiance (lat, lon) float64 198MB dask.array<chunksize=(2048, 2048), meta=np.ndarray>\n", - "Attributes: (9)