|
7 | 7 | "source": [ |
8 | 8 | "---\n", |
9 | 9 | "title: Introduction to xarray-eopf backend.\n", |
10 | | - "subtitle: A userfriendly way to open the mew EOPF Zarr products with xarray.\n", |
| 10 | + "subtitle: A userfriendly way to open the new EOPF Zarr products with Xarray.\n", |
11 | 11 | "authors:\n", |
12 | 12 | " - name: Konstantin Ntokas\n", |
13 | 13 | " orcid: 0000-0002-0049-0690\n", |
|
16 | 16 | " - id: Brockmann Consult GmbH\n", |
17 | 17 | " institution: Brockmann Consult GmbH\n", |
18 | 18 | " ror: 04r0k9g65\n", |
| 19 | + "reviewers:\n", |
| 20 | + " - name: Michele Claus\n", |
| 21 | + " orcid: 0000-0003-3680-381X\n", |
| 22 | + " github: clausmichele\n", |
| 23 | + " affiliations:\n", |
| 24 | + " - id: Eurac Research\n", |
| 25 | + " institution: Eurac Research\n", |
| 26 | + " ror: 01xt1w755\n", |
19 | 27 | "date: 2025-05-19\n", |
20 | 28 | "thumbnail: ../static/ESA_EOPF_logo_2025_COLOR_ESA_blue_reduced.png\n", |
21 | 29 | "keywords : data access, xarray, EOPF Zarr products\n", |
22 | 30 | "releaseDate: 2025-05-19\n", |
23 | 31 | "datePublished: 2025-05-19\n", |
24 | | - "dateModified: 2025-05-19\n", |
| 32 | + "dateModified: 2025-05-27\n", |
| 33 | + "github: https://github.com/EOPF-Sample-Service/eopf-sample-notebooks\n", |
| 34 | + "license: Apache-2.0\n", |
25 | 35 | "---" |
26 | 36 | ] |
27 | 37 | }, |
|
43 | 53 | "metadata": {}, |
44 | 54 | "source": [ |
45 | 55 | "## Table of Contents\n", |
46 | | - "1. [Introduction](#Introduction)\n", |
47 | | - "2. [Install the xarray-eopf Backend](#Install-the-xarray-eopf-Backend)\n", |
48 | | - "3. [Import modules](#Import-Modules)\n", |
49 | | - "4. [Main Features of the xarray-eopf Backend](#Main-Features-of-the-xarray-eopf-Backend)\n", |
50 | | - "5. [Open the Product in Native Mode](#Open-the-Product-in-Native-Mode)\n", |
51 | | - "7. [Open the Product in Analysis Mode](#Open-the-Product-in-Analysis-Mode)\n", |
52 | | - "8. [Integration with the STAC Item](#Integration-with-the-STAC-Item)\n", |
53 | | - "9. [Conclusion](#Conclusion)" |
| 56 | + "1. [Introduction](#Introduction_XEOPF)\n", |
| 57 | + "2. [Install the xarray-eopf Backend](#Install_XEOPF)\n", |
| 58 | + "3. [Import modules](#Import_XEOPF)\n", |
| 59 | + "4. [Main Features of the xarray-eopf Backend](#Main_Features_XEOPF)\n", |
| 60 | + "5. [Open the Product in Native Mode](#Native_XEOPF)\n", |
| 61 | + "7. [Open the Product in Analysis Mode](#Analysis_XEOPF)\n", |
| 62 | + "8. [Integration with the STAC Item](#STAC_XEOPF)\n", |
| 63 | + "9. [Conclusion](#Conclusion_XEOPF)" |
54 | 64 | ] |
55 | 65 | }, |
56 | 66 | { |
57 | 67 | "cell_type": "markdown", |
58 | 68 | "id": "a4a7eeac-9aa1-42cc-8540-28146c52899e", |
59 | 69 | "metadata": {}, |
60 | 70 | "source": [ |
| 71 | + "(Introduction_XEOPF)=\n", |
61 | 72 | "## Introduction\n", |
62 | 73 | "\n", |
63 | 74 | "**xarray-eopf** is a Python package that extends **xarray** with a custom backend called `\"eopf-zarr\"`. This backend enables **seamless access to ESA EOPF data products** stored in the **Zarr** format, presenting them as analysis-ready data structures.\n", |
|
86 | 97 | ":::" |
87 | 98 | ] |
88 | 99 | }, |
| 100 | + { |
| 101 | + "cell_type": "markdown", |
| 102 | + "id": "9d672493-d21c-489e-a97f-0457063adb31", |
| 103 | + "metadata": {}, |
| 104 | + "source": [ |
| 105 | + "---" |
| 106 | + ] |
| 107 | + }, |
89 | 108 | { |
90 | 109 | "cell_type": "markdown", |
91 | 110 | "id": "85bf0184-91d1-4174-8dab-756b1822a455", |
92 | 111 | "metadata": {}, |
93 | 112 | "source": [ |
94 | | - "---\n", |
| 113 | + "(Install_XEOPF)=\n", |
95 | 114 | "## Install the xarray-eopf Backend\n", |
96 | 115 | "\n", |
97 | 116 | "The backend is implemented as an **xarray plugin** and can be installed using either `pip` or `conda/mamba` from the conda-forge channel.\n", |
98 | 117 | "\n", |
99 | 118 | "- 📦 **PyPI:** [xarray-eopf on PyPI](https://pypi.org/project/xarray-eopf/) `pip install xarray-eopf`\n", |
100 | 119 | "- 🐍 **Conda (conda-forge):** [xarray-eopf on Anaconda](https://anaconda.org/conda-forge/xarray-eopf) `conda install -c conda-forge xarray-eopf`\n", |
101 | 120 | "\n", |
102 | | - " You can also use **Mamba** as a faster alternative to Conda: `mamba install -c conda-forge xarray-eopf`\n", |
103 | | - " ```" |
| 121 | + " You can also use **Mamba** as a faster alternative to Conda: `mamba install -c conda-forge xarray-eopf`" |
| 122 | + ] |
| 123 | + }, |
| 124 | + { |
| 125 | + "cell_type": "markdown", |
| 126 | + "id": "7c680c3f-55c0-46b4-9c47-f00843d95779", |
| 127 | + "metadata": {}, |
| 128 | + "source": [ |
| 129 | + "---" |
104 | 130 | ] |
105 | 131 | }, |
106 | 132 | { |
107 | 133 | "cell_type": "markdown", |
108 | 134 | "id": "9354864c-046e-4713-8c85-b09cd322c2f6", |
109 | 135 | "metadata": {}, |
110 | 136 | "source": [ |
111 | | - "---\n", |
| 137 | + "(Import_XEOPF)=\n", |
112 | 138 | "## Import Modules\n", |
113 | 139 | "\n", |
114 | 140 | "The `xarray-eopf` backend is implemented as a plugin for `xarray`. Once installed, it registers automatically and requires no additional import. You can simply import `xarray` as usual:" |
|
151 | 177 | }, |
152 | 178 | { |
153 | 179 | "cell_type": "markdown", |
154 | | - "id": "56d4bd4f-1787-47ed-b21e-13c0dcca0ec5", |
| 180 | + "id": "0be643b1-55e6-412f-84c4-d6d90e87010b", |
155 | 181 | "metadata": {}, |
156 | 182 | "source": [ |
157 | | - "---\n", |
| 183 | + "---" |
| 184 | + ] |
| 185 | + }, |
| 186 | + { |
| 187 | + "cell_type": "markdown", |
| 188 | + "id": "c4c6b46d-563a-4263-b861-e77fef90b779", |
| 189 | + "metadata": {}, |
| 190 | + "source": [ |
| 191 | + "(Main_Features_XEOPF)=\n", |
158 | 192 | "## Main Features of the xarray-eopf Backend\n", |
159 | 193 | "\n", |
160 | 194 | "The xarray-eopf backend for EOPF data products can be selecterd by setting `engine=\"eopf-zarr\"` in `xarray.open_dataset(..)` and `xarray.open_datatree(..)` method. It supports two modes of operation:\n", |
161 | 195 | "\n", |
162 | 196 | "- **Analysis Mode** *(default)*\n", |
163 | | - "- **Native Mode**\n", |
164 | | - "\n", |
165 | | - "\n", |
| 197 | + "- **Native Mode**" |
| 198 | + ] |
| 199 | + }, |
| 200 | + { |
| 201 | + "cell_type": "markdown", |
| 202 | + "id": "fca3d4d5-74b5-4534-ac2e-97132fb4bfde", |
| 203 | + "metadata": {}, |
| 204 | + "source": [ |
166 | 205 | "### Native Mode\n", |
167 | 206 | "\n", |
168 | 207 | "Represents EOPF products without modification using `xarray`'s `DataTree` and `Dataset`.\n", |
169 | 208 | "\n", |
170 | 209 | "- `open_dataset(..)` — Returns a *flattened* version of the data tree \n", |
171 | | - "- `open_datatree(..)` — Returns the full `DataTree`, same as `xr.open_datatree(.., engine=\"zarr\")`\n", |
172 | | - "\n", |
| 210 | + "- `open_datatree(..)` — Returns the full `DataTree`, same as `xr.open_datatree(.., engine=\"zarr\")`" |
| 211 | + ] |
| 212 | + }, |
| 213 | + { |
| 214 | + "cell_type": "markdown", |
| 215 | + "id": "464f10a2-32eb-4077-bb51-0d733d0d0554", |
| 216 | + "metadata": {}, |
| 217 | + "source": [ |
173 | 218 | "### Analysis Mode\n", |
174 | 219 | "\n", |
175 | 220 | "Provides an analysis-ready, resampled view of the data (currently for **Sentinel-2** only).\n", |
|
178 | 223 | "- `open_datatree(..)` — Not implemented in this mode (`NotImplementedError`)\n", |
179 | 224 | " \n", |
180 | 225 | "\n", |
181 | | - "📚 **More info:** [xarray-eopf Guide](https://eopf-sample-service.github.io/xarray-eopf/guide/)\n" |
| 226 | + "📚 **More info:** [xarray-eopf Guide](https://eopf-sample-service.github.io/xarray-eopf/guide/)" |
182 | 227 | ] |
183 | 228 | }, |
184 | 229 | { |
185 | 230 | "cell_type": "markdown", |
186 | | - "id": "dba06fac-af26-4ae0-97c0-e12a7821ae1c", |
| 231 | + "id": "20a1c12a-6363-4582-8049-e5b3a69c9f9a", |
187 | 232 | "metadata": {}, |
188 | 233 | "source": [ |
189 | | - "---\n", |
190 | | - "## Open the Product in Native Mode\n" |
| 234 | + "---" |
| 235 | + ] |
| 236 | + }, |
| 237 | + { |
| 238 | + "cell_type": "markdown", |
| 239 | + "id": "ffca9ec6-9a49-40cc-93e9-fad3ef653331", |
| 240 | + "metadata": { |
| 241 | + "jp-MarkdownHeadingCollapsed": true |
| 242 | + }, |
| 243 | + "source": [ |
| 244 | + "(Native_XEOPF)=\n", |
| 245 | + "## Open the Product in Native Mode" |
191 | 246 | ] |
192 | 247 | }, |
193 | 248 | { |
@@ -43211,10 +43266,20 @@ |
43211 | 43266 | }, |
43212 | 43267 | { |
43213 | 43268 | "cell_type": "markdown", |
43214 | | - "id": "9852d954-15ce-44d4-b351-25c2d5c34625", |
| 43269 | + "id": "746022e4-54f5-4258-897b-d9b7d9a680cd", |
43215 | 43270 | "metadata": {}, |
43216 | 43271 | "source": [ |
43217 | | - "---\n", |
| 43272 | + "---" |
| 43273 | + ] |
| 43274 | + }, |
| 43275 | + { |
| 43276 | + "cell_type": "markdown", |
| 43277 | + "id": "9852d954-15ce-44d4-b351-25c2d5c34625", |
| 43278 | + "metadata": { |
| 43279 | + "jp-MarkdownHeadingCollapsed": true |
| 43280 | + }, |
| 43281 | + "source": [ |
| 43282 | + "(Analysis_XEOPF)=\n", |
43218 | 43283 | "## Open the Product in Analysis Mode\n", |
43219 | 43284 | "\n", |
43220 | 43285 | "Currently, analysis mode is available only for Sentinel-2 products. Support for Sentinel-3 and Sentinel-1 will be added in upcoming releases.\n", |
@@ -49572,18 +49637,26 @@ |
49572 | 49637 | "plt.tight_layout()" |
49573 | 49638 | ] |
49574 | 49639 | }, |
| 49640 | + { |
| 49641 | + "cell_type": "markdown", |
| 49642 | + "id": "2b00eed6-0374-405f-b27f-9b6ec5646337", |
| 49643 | + "metadata": {}, |
| 49644 | + "source": [ |
| 49645 | + "---" |
| 49646 | + ] |
| 49647 | + }, |
49575 | 49648 | { |
49576 | 49649 | "cell_type": "markdown", |
49577 | 49650 | "id": "c5f67756-ce35-4ebc-9ff7-93c0b7cc2e29", |
49578 | 49651 | "metadata": {}, |
49579 | 49652 | "source": [ |
49580 | | - "---\n", |
| 49653 | + "(STAC_XEOPF)=\n", |
49581 | 49654 | "## Integration with the STAC Item\n", |
49582 | 49655 | "\n", |
49583 | 49656 | "- The STAC API at `https://stac.core.eopf.eodc.eu` allows searching for tiles by bounding box and time range.\n", |
49584 | 49657 | "- The `\"product\"` asset can be used to open an EOPF Zarr product.\n", |
49585 | 49658 | "- Additional fields in the asset provide the parameters required to open the dataset.\n", |
49586 | | - "- Assets representing individual bands are also available; xarray integration for these is still a work in progress.\n" |
| 49659 | + "- Assets representing individual bands are also available; Xarray integration for these is still a work in progress." |
49587 | 49660 | ] |
49588 | 49661 | }, |
49589 | 49662 | { |
|
49628 | 49701 | "id": "ac537572-d51a-40ba-a550-cb5bbaa68855", |
49629 | 49702 | "metadata": {}, |
49630 | 49703 | "source": [ |
49631 | | - "Next, we can inspect the item’s contents, including the additional field `xarray:open_datatree_kwargs`, which provides the arguments needed to open the product using xarray’s `eopf-zarr` engine." |
| 49704 | + "Next, we can inspect the item’s contents, including the additional field `xarray:open_datatree_kwargs`, which provides the arguments needed to open the product using Xarray’s `eopf-zarr` engine." |
49632 | 49705 | ] |
49633 | 49706 | }, |
49634 | 49707 | { |
@@ -75540,13 +75613,14 @@ |
75540 | 75613 | "id": "d9d9b7c1-a090-4d56-b633-bd58f5344d09", |
75541 | 75614 | "metadata": {}, |
75542 | 75615 | "source": [ |
| 75616 | + "(Conclusion_XEOPF)=\n", |
75543 | 75617 | "## Conclusion\n", |
75544 | 75618 | "\n", |
75545 | | - "This notebook presents the current development state of the **xarray-eopf** backend, which enables seamless access to EOPF Zarr products using familiar xarray methods such as `xr.open_dataset` and `xr.open_datatree` by specifying `engine=\"eopf-zarr\"`. The key takeaways are summarized below:\n", |
| 75619 | + "This notebook presents the current development state of the **xarray-eopf** backend, which enables seamless access to EOPF Zarr products using familiar Xarray methods such as `xr.open_dataset` and `xr.open_datatree` by specifying `engine=\"eopf-zarr\"`. The key takeaways are summarized below:\n", |
75546 | 75620 | "\n", |
75547 | 75621 | "- Two operation modes are available:\n", |
75548 | 75622 | " - `op_mode=\"native\"`: \n", |
75549 | | - " Represents EOPF products without modification using xarray's `DataTree` and `Dataset` structures. \n", |
| 75623 | + " Represents EOPF products without modification using Xarray's `DataTree` and `Dataset` structures. \n", |
75550 | 75624 | " Example: `xr.open_dataset(path, engine=\"eopf-zarr\", op_mode=\"native\")` returns the data tree as a *flattened* `xr.Dataset`.\n", |
75551 | 75625 | " - `op_mode=\"analysis\"`: \n", |
75552 | 75626 | " Provides an analysis-ready, resampled view of the data (currently supported for Sentinel-2 only). Features include:\n", |
|
75587 | 75661 | "name": "python", |
75588 | 75662 | "nbconvert_exporter": "python", |
75589 | 75663 | "pygments_lexer": "ipython3", |
75590 | | - "version": "3.13.3" |
| 75664 | + "version": "3.12.10" |
75591 | 75665 | } |
75592 | 75666 | }, |
75593 | 75667 | "nbformat": 4, |
|
0 commit comments