From 6d5a53c837a7fb47ba0bb9c4ca2b4e6f999dbb6a Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Wed, 28 Oct 2026 12:28:48 +0100 Subject: [PATCH 01/45] feat(data-api): validate GeoZarr arrays strictly in a scope via pydantic-zarr main pydantic-zarr now validates every Zarr V3 array spec as a whole metadata document, judging each extension-point name by the definition that claims it in a scope. The GeoZarr DataArray sets zarr_scope_strict, so a typo'd or unknown codec or data type name is refused instead of passing unjudged, against a GeoZarr scope that extends the default with zarr-python's provisional fixed_length_utf32 data type (band and angle coordinates in real stores hold it, and no zarr-metadata scope claims it yet). The pyz wrappers drop their attributes redeclaration: the parent field now carries a validated empty-dict default, so narrowed attribute types that refuse {} stay required without it. pydantic-zarr comes from git main pending its next release. Assisted-by: ClaudeCode:claude-fable-5 Co-Authored-By: Claude Fable 5 --- pyproject.toml | 6 ++++ src/eopf_geozarr/data_api/geozarr/scope.py | 39 ++++++++++++++++++++++ src/eopf_geozarr/data_api/geozarr/v3.py | 11 ++++++ src/eopf_geozarr/pyz/v2.py | 4 ++- src/eopf_geozarr/pyz/v3.py | 4 ++- tests/test_data_api/test_v3.py | 31 +++++++++++++++++ uv.lock | 25 ++++++++++---- 7 files changed, 111 insertions(+), 9 deletions(-) create mode 100644 src/eopf_geozarr/data_api/geozarr/scope.py diff --git a/pyproject.toml b/pyproject.toml index de612035..f803ef02 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -258,4 +258,10 @@ constraint-dependencies = [ "pygments>=2.20.0", ] +[tool.uv.sources] +# pydantic-zarr main: scoped whole-document metadata validation (zarr-metadata), +# the zarr_scope / zarr_scope_strict class variables, and MISSING-based +# attribute models. Swap back to PyPI once the next pydantic-zarr releases. +pydantic-zarr = { git = "https://github.com/zarr-developers/pydantic-zarr.git", rev = "main" } + diff --git a/src/eopf_geozarr/data_api/geozarr/scope.py b/src/eopf_geozarr/data_api/geozarr/scope.py new file mode 100644 index 00000000..bd4d6694 --- /dev/null +++ b/src/eopf_geozarr/data_api/geozarr/scope.py @@ -0,0 +1,39 @@ +""" +The validation scope for GeoZarr metadata documents. + +pydantic-zarr validates each Zarr V3 array spec as a whole metadata document, +judging every extension-point name (data type, chunk grid, chunk key encoding, +codec, storage transformer) by the definition that claims it in a scope, and +leaving unclaimed names unjudged. GeoZarr stores written by zarr-python hold +fixed-length unicode arrays (band and angle coordinates) under zarr-python's +provisional ``fixed_length_utf32`` spelling, which no ``zarr-metadata`` scope +claims yet; this module's scope extends the default with a definition for it, +so GeoZarr documents can be judged strictly — every extension-point name +claimed — instead of leniently. +""" + +from __future__ import annotations + +from typing_extensions import TypedDict +from zarr_metadata.v3.definition import CORE_AND_EXTENSIONS, DataTypeDefinition + + +class FixedLengthUtf32Configuration(TypedDict, closed=True): + """The configuration of zarr-python's ``fixed_length_utf32`` data type.""" + + length_bytes: int + + +FIXED_LENGTH_UTF32 = DataTypeDefinition( + name="fixed_length_utf32", + configuration=FixedLengthUtf32Configuration, + fill_value=str, +) +"""zarr-python's provisional fixed-length unicode data type (numpy's ``U``).""" + +GEOZARR_SCOPE = CORE_AND_EXTENSIONS.update( + # update() replaces a slot whole, so splice the new definition in after + # the default scope's own data types + data_types=[*CORE_AND_EXTENSIONS.data_types.values(), FIXED_LENGTH_UTF32], +) +"""The default scope plus the data types zarr-python writes that it lacks.""" diff --git a/src/eopf_geozarr/data_api/geozarr/v3.py b/src/eopf_geozarr/data_api/geozarr/v3.py index ee2a487c..97cf7c33 100644 --- a/src/eopf_geozarr/data_api/geozarr/v3.py +++ b/src/eopf_geozarr/data_api/geozarr/v3.py @@ -16,6 +16,7 @@ check_valid_coordinates, ) from eopf_geozarr.data_api.geozarr.multiscales import MultiscaleGroupAttrs +from eopf_geozarr.data_api.geozarr.scope import GEOZARR_SCOPE class DataArray(ArraySpec[BaseDataArrayAttrs]): @@ -35,6 +36,16 @@ class DataArray(ArraySpec[BaseDataArrayAttrs]): # `tuple[str | None, ...] | None` field to a required tuple of strings. dimension_names: tuple[str, ...] # pyright: ignore[reportGeneralTypeIssues, reportIncompatibleVariableOverride] + # Every extension-point name (data type, chunk grid, chunk key encoding, + # codecs, storage transformers) must be claimed by a definition in the + # validation scope, instead of passing unjudged: a GeoZarr DataArray is a + # conformance contract, so a typo'd or unknown codec or data type name is + # refused at validation. The scope is the default plus the data types + # zarr-python writes that it lacks (fixed_length_utf32 band/angle + # coordinates); an explicit pydantic validation context still overrides. + zarr_scope = GEOZARR_SCOPE + zarr_scope_strict = True + @property def array_dimensions(self) -> tuple[str, ...]: return self.dimension_names diff --git a/src/eopf_geozarr/pyz/v2.py b/src/eopf_geozarr/pyz/v2.py index 52605eb1..6555d3db 100644 --- a/src/eopf_geozarr/pyz/v2.py +++ b/src/eopf_geozarr/pyz/v2.py @@ -43,7 +43,9 @@ class MyGroup(GroupSpec[Any, MyMembers]) class GroupSpec(GroupSpecV2[TAttr, TMembers]): # type: ignore[type-var] # TMembers is bound to the full members mapping (e.g. a TypedDict) by design, # whereas the parent's second type parameter expects a single member item type. - attributes: TAttr + # (attributes needs no redeclaration: the parent parameterization binds TAttr, + # and its validated empty-dict default keeps narrowed attribute types that + # refuse {} effectively required.) # members holds the full mapping (TMembers) rather than the parent's # Mapping[str, TItem] | None; this is the intended structure for this subclass. members: TMembers # type: ignore[assignment] diff --git a/src/eopf_geozarr/pyz/v3.py b/src/eopf_geozarr/pyz/v3.py index 405c8590..0bb2e471 100644 --- a/src/eopf_geozarr/pyz/v3.py +++ b/src/eopf_geozarr/pyz/v3.py @@ -43,7 +43,9 @@ class MyGroup(GroupSpec[Any, MyMembers]) class GroupSpec(GroupSpecV3[TAttr, TMembers]): # type: ignore[type-var] # TMembers is bound to the full members mapping (e.g. a TypedDict) by design, # whereas the parent's second type parameter expects a single member item type. - attributes: TAttr + # (attributes needs no redeclaration: the parent parameterization binds TAttr, + # and its validated empty-dict default keeps narrowed attribute types that + # refuse {} effectively required.) # members holds the full mapping (TMembers) rather than the parent's # Mapping[str, TItem] | None; this is the intended structure for this subclass. members: TMembers # type: ignore[assignment] diff --git a/tests/test_data_api/test_v3.py b/tests/test_data_api/test_v3.py index 51c85419..83ff5779 100644 --- a/tests/test_data_api/test_v3.py +++ b/tests/test_data_api/test_v3.py @@ -124,3 +124,34 @@ def test_missing_grid_mapping_variable(self) -> None: ) with pytest.raises(ValidationError, match="Grid mapping variable 'nope'"): Dataset(attributes=DatasetAttrs(), members=members) + + +class TestStrictScope: + """DataArray sets `zarr_scope_strict`: extension-point names must be claimed.""" + + @staticmethod + def _document_with_codec(codec: dict[str, object]) -> dict[str, object]: + valid = DataArray.from_array(np.zeros((4,), dtype="uint8"), dimension_names=("x",)) + document = valid.model_dump() + document["codecs"] = (*document["codecs"], codec) + return document + + def test_claimed_names_pass(self) -> None: + """A document built from names the scope claims validates, zstd included.""" + document = self._document_with_codec( + {"name": "zstd", "configuration": {"level": 1, "checksum": False}} + ) + spec = DataArray.model_validate(document) + last = spec.codecs[-1] + assert isinstance(last, Mapping) + assert last["name"] == "zstd" + + def test_unclaimed_codec_name_refused(self) -> None: + """A typo'd codec name is refused, where the lenient parent leaves it unjudged.""" + document = self._document_with_codec({"name": "zstdd", "configuration": {"level": 1}}) + with pytest.raises(ValidationError, match="'zstdd' names no codec in the scope"): + DataArray.model_validate(document) + # the unscoped parent class accepts the same document, the name unjudged + last = ArraySpec.model_validate(document).codecs[-1] + assert isinstance(last, Mapping) + assert last["name"] == "zstdd" diff --git a/uv.lock b/uv.lock index 04f4269f..a6d024fa 100644 --- a/uv.lock +++ b/uv.lock @@ -1733,7 +1733,7 @@ requires-dist = [ { name = "eopf", marker = "python_full_version >= '3.13' and extra == 'cpm'", specifier = ">=3.0.0" }, { name = "numpy", specifier = ">=2.3.1" }, { name = "pydantic", specifier = ">=2.12" }, - { name = "pydantic-zarr", specifier = ">=0.8.0" }, + { name = "pydantic-zarr", git = "https://github.com/zarr-developers/pydantic-zarr.git?rev=main" }, { name = "pygit2", specifier = ">=1.20.1" }, { name = "pyproj", specifier = ">=3.7.0" }, { name = "pystac", specifier = ">=1.8.0" }, @@ -4496,17 +4496,15 @@ wheels = [ [[package]] name = "pydantic-zarr" -version = "0.10.0" -source = { registry = "https://pypi.org/simple" } +version = "0.10.1.dev32+gd11289a9f" +source = { git = "https://github.com/zarr-developers/pydantic-zarr.git?rev=main#d11289a9f1e21d12e329cf55f809b3e8ad631ab5" } dependencies = [ { name = "numpy", version = "2.4.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.13'" }, { name = "numpy", version = "2.5.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.13'" }, { name = "packaging" }, { name = "pydantic" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/2f/57/aac9e500abe15719b7406d55871fc8787e7d0ebf83de5f98d44471139f70/pydantic_zarr-0.10.0.tar.gz", hash = "sha256:996b5b4225fb05757e7fff831ee7a75c61f54514a4c2493c7b79635bade7b415", size = 80374, upload-time = "2026-04-23T14:23:12.575Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/c7/05/04af0ca9c5747c95591a549509ebbb0a986155015de59f1e4c984e3af9ab/pydantic_zarr-0.10.0-py3-none-any.whl", hash = "sha256:d15769dab43346b070051fdf6e83509d7f55259dd00c6d12be2400935117e230", size = 52809, upload-time = "2026-04-23T14:23:11.011Z" }, + { name = "typing-extensions" }, + { name = "zarr-metadata" }, ] [[package]] @@ -6653,6 +6651,19 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/85/fb/8c17b2956a248be9398f6727490976ab3e69cd419af9d983164a46d830da/zarr_cm-0.5.0-py3-none-any.whl", hash = "sha256:99fef56dae5eb5ee2a7126d8a18e669944494e0778832577ae8ae922b0207b12", size = 55585, upload-time = "2026-09-26T07:57:41.935Z" }, ] +[[package]] +name = "zarr-metadata" +version = "0.6.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "annotated-types" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/5f/a3/4526430215c09ed45d47886a7c8b439218622a4f05e6ce1198147961ca64/zarr_metadata-0.6.0.tar.gz", hash = "sha256:4462dc91cdb8c19c370bcd548096125591359579586f42de789dc495a33119d0", size = 519797, upload-time = "2026-10-26T13:55:27.086Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/20/b2/c70c528d438bbf656873e8da51949c50efff866b85c6ee3335ba81bf1142/zarr_metadata-0.6.0-py3-none-any.whl", hash = "sha256:ab1f9f33d18094ffac020c2c975aa32f8737f36a0dfa8543b6c6d717a3469d1e", size = 274628, upload-time = "2026-10-26T13:55:25.798Z" }, +] + [[package]] name = "zict" version = "3.0.0" From 9a6a55522d80a8ac5eb7676e2035a0afca3cecb4 Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Wed, 28 Oct 2026 13:51:31 +0100 Subject: [PATCH 02/45] feat(pyz): enforce the attributes type parameter and legalize the members override The pyz ArraySpec type parameter was phantom (both wrappers subclassed ArraySpec[Any]), so every declared attributes model on the Sentinel array classes was decorative: Sentinel2DataArray accepted arbitrary attributes and held plain dicts. The parameter is now passed through, so attributes validate against the declared model and read back typed. The GroupSpec wrappers stop binding the members mapping type into the parent's member-item slot (the old type-var hack and both its ignores): with pydantic-zarr's covariant parameters, parameterizing the parent at its widest member type and narrowing the members field is a legal override. s3_olci spells unconstrained attributes Mapping[str, object] (object no longer satisfies the enforced bound), and the GeoZarr v3 group classes use AnyGroupSpec, now an ordinary wide type, so member reads stay checked. pydantic-zarr is bumped to main with covariant spec parameters (zarr-developers/pydantic-zarr#191). Assisted-by: ClaudeCode:claude-fable-5 Co-Authored-By: Claude Fable 5 --- src/eopf_geozarr/data_api/geozarr/v3.py | 8 ++-- src/eopf_geozarr/data_api/s3_olci.py | 56 ++++++++++++------------- src/eopf_geozarr/pyz/v2.py | 35 ++++++++++------ src/eopf_geozarr/pyz/v3.py | 35 ++++++++++------ uv.lock | 4 +- 5 files changed, 78 insertions(+), 60 deletions(-) diff --git a/src/eopf_geozarr/data_api/geozarr/v3.py b/src/eopf_geozarr/data_api/geozarr/v3.py index 97cf7c33..ee3f9431 100644 --- a/src/eopf_geozarr/data_api/geozarr/v3.py +++ b/src/eopf_geozarr/data_api/geozarr/v3.py @@ -5,7 +5,7 @@ from typing import Any, Self, cast from pydantic import model_validator -from pydantic_zarr.v3 import ArraySpec, GroupSpec +from pydantic_zarr.v3 import AnyGroupSpec, ArraySpec, GroupSpec from eopf_geozarr.data_api.geozarr.common import ( BaseDataArrayAttrs, @@ -51,7 +51,7 @@ def array_dimensions(self) -> tuple[str, ...]: return self.dimension_names -class Dataset(GroupSpec[DatasetAttrs, GroupSpec[Any, Any] | DataArray]): +class Dataset(GroupSpec[DatasetAttrs, AnyGroupSpec | DataArray]): """ A GeoZarr Dataset. """ @@ -66,7 +66,7 @@ def check_valid_coordinates(self) -> Self: Returns ------- - GroupSpec[Any, Any] + AnyGroupSpec The validated GeoZarr DataSet. """ # ``self`` structurally satisfies the ``GroupLike`` protocol, but mypy cannot bind the @@ -82,7 +82,7 @@ def validate_grid_mapping(self) -> Self: return self -class MultiscaleGroup(GroupSpec[MultiscaleGroupAttrs, DataArray | GroupSpec[Any, Any]]): +class MultiscaleGroup(GroupSpec[MultiscaleGroupAttrs, DataArray | AnyGroupSpec]): """ A GeoZarr Multiscale Group. """ diff --git a/src/eopf_geozarr/data_api/s3_olci.py b/src/eopf_geozarr/data_api/s3_olci.py index 7b55f8f0..23b7c7bc 100644 --- a/src/eopf_geozarr/data_api/s3_olci.py +++ b/src/eopf_geozarr/data_api/s3_olci.py @@ -30,32 +30,32 @@ class Sentinel3OlciMeasurementsMembers(TypedDict, closed=True, total=False): validate; the converter checks for the bands it needs. """ - latitude: ArraySpec[object] - longitude: ArraySpec[object] - altitude: ArraySpec[object] - time_stamp: ArraySpec[object] - orphans: GroupSpec[Mapping[str, object], Mapping[str, ArraySpec[object]]] - oa01_radiance: ArraySpec[object] - oa02_radiance: ArraySpec[object] - oa03_radiance: ArraySpec[object] - oa04_radiance: ArraySpec[object] - oa05_radiance: ArraySpec[object] - oa06_radiance: ArraySpec[object] - oa07_radiance: ArraySpec[object] - oa08_radiance: ArraySpec[object] - oa09_radiance: ArraySpec[object] - oa10_radiance: ArraySpec[object] - oa11_radiance: ArraySpec[object] - oa12_radiance: ArraySpec[object] - oa13_radiance: ArraySpec[object] - oa14_radiance: ArraySpec[object] - oa15_radiance: ArraySpec[object] - oa16_radiance: ArraySpec[object] - oa17_radiance: ArraySpec[object] - oa18_radiance: ArraySpec[object] - oa19_radiance: ArraySpec[object] - oa20_radiance: ArraySpec[object] - oa21_radiance: ArraySpec[object] + latitude: ArraySpec[Mapping[str, object]] + longitude: ArraySpec[Mapping[str, object]] + altitude: ArraySpec[Mapping[str, object]] + time_stamp: ArraySpec[Mapping[str, object]] + orphans: GroupSpec[Mapping[str, object], Mapping[str, ArraySpec[Mapping[str, object]]]] + oa01_radiance: ArraySpec[Mapping[str, object]] + oa02_radiance: ArraySpec[Mapping[str, object]] + oa03_radiance: ArraySpec[Mapping[str, object]] + oa04_radiance: ArraySpec[Mapping[str, object]] + oa05_radiance: ArraySpec[Mapping[str, object]] + oa06_radiance: ArraySpec[Mapping[str, object]] + oa07_radiance: ArraySpec[Mapping[str, object]] + oa08_radiance: ArraySpec[Mapping[str, object]] + oa09_radiance: ArraySpec[Mapping[str, object]] + oa10_radiance: ArraySpec[Mapping[str, object]] + oa11_radiance: ArraySpec[Mapping[str, object]] + oa12_radiance: ArraySpec[Mapping[str, object]] + oa13_radiance: ArraySpec[Mapping[str, object]] + oa14_radiance: ArraySpec[Mapping[str, object]] + oa15_radiance: ArraySpec[Mapping[str, object]] + oa16_radiance: ArraySpec[Mapping[str, object]] + oa17_radiance: ArraySpec[Mapping[str, object]] + oa18_radiance: ArraySpec[Mapping[str, object]] + oa19_radiance: ArraySpec[Mapping[str, object]] + oa20_radiance: ArraySpec[Mapping[str, object]] + oa21_radiance: ArraySpec[Mapping[str, object]] class Sentinel3OlciMeasurementsGroup(GroupSpec[DatasetAttrs, Sentinel3OlciMeasurementsMembers]): @@ -70,14 +70,14 @@ class Sentinel3OlciRootMembers(TypedDict, closed=True, total=False): Mapping[str, object], Mapping[ str, - GroupSpec[Mapping[str, object], Mapping[str, ArraySpec[object]]] | ArraySpec[object], + GroupSpec[Mapping[str, object], Mapping[str, ArraySpec[Mapping[str, object]]]] | ArraySpec[Mapping[str, object]], ], ] conditions: GroupSpec[ Mapping[str, object], Mapping[ str, - GroupSpec[Mapping[str, object], Mapping[str, ArraySpec[object]]] | ArraySpec[object], + GroupSpec[Mapping[str, object], Mapping[str, ArraySpec[Mapping[str, object]]]] | ArraySpec[Mapping[str, object]], ], ] diff --git a/src/eopf_geozarr/pyz/v2.py b/src/eopf_geozarr/pyz/v2.py index 6555d3db..242d648d 100644 --- a/src/eopf_geozarr/pyz/v2.py +++ b/src/eopf_geozarr/pyz/v2.py @@ -20,10 +20,13 @@ class MyGroup(GroupSpec[Any, MyMembers]) from __future__ import annotations from collections.abc import Mapping -from typing import Any, TypeAlias, TypeVar, Union +from typing import Any, Generic, TypeAlias, TypeVar, Union + +from pydantic import Field from pydantic_zarr.v2 import ArraySpec as ArraySpecV2 from pydantic_zarr.v2 import GroupSpec as GroupSpecV2 +from pydantic_zarr.v2 import TBaseItem as TBaseItemV2 from eopf_geozarr.pyz.common import ( TBaseAttr, @@ -37,18 +40,18 @@ class MyGroup(GroupSpec[Any, MyMembers]) TAttr = TypeVar("TAttr", bound=TBaseAttr) TMembers = TypeVar("TMembers", bound=TBaseMember) -TArraySpecType = TypeVar("TArraySpecType") -class GroupSpec(GroupSpecV2[TAttr, TMembers]): # type: ignore[type-var] - # TMembers is bound to the full members mapping (e.g. a TypedDict) by design, - # whereas the parent's second type parameter expects a single member item type. - # (attributes needs no redeclaration: the parent parameterization binds TAttr, - # and its validated empty-dict default keeps narrowed attribute types that - # refuse {} effectively required.) - # members holds the full mapping (TMembers) rather than the parent's - # Mapping[str, TItem] | None; this is the intended structure for this subclass. - members: TMembers # type: ignore[assignment] +class GroupSpec(GroupSpecV2[TAttr, TBaseItemV2], Generic[TAttr, TMembers]): + # The parent is parameterized at its widest member type, and TMembers (the + # full members mapping, e.g. a closed TypedDict) narrows the *field*: a + # legal override, since pydantic-zarr's parameters are covariant and the + # specs frozen. members is required here, unlike the parent's + # (Mapping | None) with its empty default: modeling the exact member set + # is this class's purpose. (attributes needs no redeclaration: the parent + # parameterization binds TAttr, and its validated empty-dict default keeps + # narrowed attribute types that refuse {} effectively required.) + members: TMembers = Field(...) # pyright: ignore[reportIncompatibleVariableOverride] def __repr__(self) -> str: """Return a condensed text representation of the GroupSpec.""" @@ -69,8 +72,14 @@ def _repr_html_(self) -> str: ) -class ArraySpec[TArraySpecType](ArraySpecV2[Any]): - """Zarr V2 ArraySpec with enhanced HTML representation for Jupyter/IPython.""" +class ArraySpec(ArraySpecV2[TAttr], Generic[TAttr]): + """ + Zarr V2 ArraySpec with enhanced HTML representation for Jupyter/IPython. + + The type parameter is the attributes type and is enforced: it previously + subclassed ``ArraySpecV2[Any]``, which made ``ArraySpec[MyAttrs]`` + decorative — any attributes validated. + """ def _repr_html_(self) -> str: """Return an HTML representation for Jupyter/IPython.""" diff --git a/src/eopf_geozarr/pyz/v3.py b/src/eopf_geozarr/pyz/v3.py index 0bb2e471..50347a4e 100644 --- a/src/eopf_geozarr/pyz/v3.py +++ b/src/eopf_geozarr/pyz/v3.py @@ -20,10 +20,13 @@ class MyGroup(GroupSpec[Any, MyMembers]) from __future__ import annotations from collections.abc import Mapping -from typing import Any, TypeAlias, TypeVar, Union +from typing import Any, Generic, TypeAlias, TypeVar, Union + +from pydantic import Field from pydantic_zarr.v3 import ArraySpec as ArraySpecV3 from pydantic_zarr.v3 import GroupSpec as GroupSpecV3 +from pydantic_zarr.v3 import TBaseItem as TBaseItemV3 from eopf_geozarr.pyz.common import ( TBaseAttr, @@ -37,18 +40,18 @@ class MyGroup(GroupSpec[Any, MyMembers]) TAttr = TypeVar("TAttr", bound=TBaseAttr) TMembers = TypeVar("TMembers", bound=TBaseMember) -TArraySpecType = TypeVar("TArraySpecType") -class GroupSpec(GroupSpecV3[TAttr, TMembers]): # type: ignore[type-var] - # TMembers is bound to the full members mapping (e.g. a TypedDict) by design, - # whereas the parent's second type parameter expects a single member item type. - # (attributes needs no redeclaration: the parent parameterization binds TAttr, - # and its validated empty-dict default keeps narrowed attribute types that - # refuse {} effectively required.) - # members holds the full mapping (TMembers) rather than the parent's - # Mapping[str, TItem] | None; this is the intended structure for this subclass. - members: TMembers # type: ignore[assignment] +class GroupSpec(GroupSpecV3[TAttr, TBaseItemV3], Generic[TAttr, TMembers]): + # The parent is parameterized at its widest member type, and TMembers (the + # full members mapping, e.g. a closed TypedDict) narrows the *field*: a + # legal override, since pydantic-zarr's parameters are covariant and the + # specs frozen. members is required here, unlike the parent's + # (Mapping | None) with its empty default: modeling the exact member set + # is this class's purpose. (attributes needs no redeclaration: the parent + # parameterization binds TAttr, and its validated empty-dict default keeps + # narrowed attribute types that refuse {} effectively required.) + members: TMembers = Field(...) # pyright: ignore[reportIncompatibleVariableOverride] def __repr__(self) -> str: """Return a condensed text representation of the GroupSpec.""" @@ -69,8 +72,14 @@ def _repr_html_(self) -> str: ) -class ArraySpec[TArraySpecType](ArraySpecV3[Any]): - """Zarr V3 ArraySpec with enhanced HTML representation for Jupyter/IPython.""" +class ArraySpec(ArraySpecV3[TAttr], Generic[TAttr]): + """ + Zarr V3 ArraySpec with enhanced HTML representation for Jupyter/IPython. + + The type parameter is the attributes type and is enforced: it previously + subclassed ``ArraySpecV3[Any]``, which made ``ArraySpec[MyAttrs]`` + decorative — any attributes validated. + """ def _repr_html_(self) -> str: """Return an HTML representation for Jupyter/IPython.""" diff --git a/uv.lock b/uv.lock index a6d024fa..3f11ec02 100644 --- a/uv.lock +++ b/uv.lock @@ -4496,8 +4496,8 @@ wheels = [ [[package]] name = "pydantic-zarr" -version = "0.10.1.dev32+gd11289a9f" -source = { git = "https://github.com/zarr-developers/pydantic-zarr.git?rev=main#d11289a9f1e21d12e329cf55f809b3e8ad631ab5" } +version = "0.10.1.dev34+g66cf23990" +source = { git = "https://github.com/zarr-developers/pydantic-zarr.git?rev=main#66cf23990b122f2d4272829243095bce6b9ca233" } dependencies = [ { name = "numpy", version = "2.4.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.13'" }, { name = "numpy", version = "2.5.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.13'" }, From 717721f78ed4ed6a537a519f5980e5bb1e7fd958 Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Wed, 28 Oct 2026 15:04:18 +0100 Subject: [PATCH 03/45] feat(data-api): add the spec-level Sentinel-2 GeoZarr plan MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit load_sentinel2 reads a Zarr store into the validated Sentinel2Root input model — keeping the model as the carrier instead of validating and discarding it — and plan_geozarr is a pure function from that model to the GeoZarr hierarchy to write, as a Zarr V3 GroupSpec tree: the metadata plane of the conversion, independent of chunk copying. The reflectance pyramid (native levels with the product level's finer bands injected, coarser levels derived, sharded uint16 bands, float64 coordinates, CF grid mappings from the product's own proj:wkt2 via a CF round-trip, spatial/proj/multiscales convention attributes) is derived entirely from the input model's metadata, and reproduces the converter's stored snapshot byte for byte for the product whose tile the snapshot harness models; for the other products the snapshots carry the harness's synthetic tile georeferencing, so the tests mask those values and pin the plan's georeferencing to the product's own band attributes instead. conditions and quality stay on the DataTree converter for now. Assisted-by: ClaudeCode:claude-fable-5 Co-Authored-By: Claude Fable 5 --- src/eopf_geozarr/data_api/s2_plan.py | 482 +++++++++++++++++++++++++++ tests/test_data_api/test_s2_plan.py | 178 ++++++++++ 2 files changed, 660 insertions(+) create mode 100644 src/eopf_geozarr/data_api/s2_plan.py create mode 100644 tests/test_data_api/test_s2_plan.py diff --git a/src/eopf_geozarr/data_api/s2_plan.py b/src/eopf_geozarr/data_api/s2_plan.py new file mode 100644 index 00000000..9331aed1 --- /dev/null +++ b/src/eopf_geozarr/data_api/s2_plan.py @@ -0,0 +1,482 @@ +""" +Spec-level planning of the Sentinel-2 GeoZarr hierarchy. + +This module is the metadata plane of the Sentinel-2 conversion: +`load_sentinel2` reads a Zarr store into the validated `Sentinel2Root` input +model — keeping the model as the carrier of everything the conversion needs, +instead of validating and discarding it — and `plan_geozarr` is a pure +function from that model to the GeoZarr hierarchy we want to write, as a +Zarr V3 `GroupSpec` tree. No chunk data is read or written here: realizing +the plan (copying and coarsening chunks into the planned arrays) is a +separate, data-plane step. + +Everything the plan emits is derived from the input model's own metadata: +EOPF products carry `long_name`, the `proj:*` attributes, and the CF packing +attributes on every band, so the output documents (band arrays retyped and +sharded, per-level coordinate arrays, `spatial_ref` grid-mapping arrays, the +spatial/proj convention attributes, and the multiscales layout) are all +computable from the input document alone. + +The reflectance pyramid follows the converter's policy +(`eopf_geozarr.s2_optimization`): the scale levels are +``(10, 20, 60, 120, 360, 720)`` metres, levels present in the input are +reused, coarser levels are derived from the level before them, and finer +bands are injected into the coarser native levels (`b08` everywhere; for L1C +also the other 10 m and 20 m bands) so they propagate through the overview +chain. + +Only the `measurements/reflectance` subtree is planned so far; the +`conditions` and `quality` subtrees still go through the DataTree-based +converter (a follow-up migrates them onto this plan). +""" + +from __future__ import annotations + +import base64 +import struct +from math import ceil +from typing import TYPE_CHECKING, Any, Literal + +from pydantic_zarr.v3 import ArraySpec as ArraySpecV3 +from pydantic_zarr.v3 import GroupSpec as GroupSpecV3 + +from eopf_geozarr.data_api.geozarr.v3 import DataArray +from eopf_geozarr.data_api.s2 import Sentinel2Root + +if TYPE_CHECKING: + from collections.abc import Mapping + + import zarr + from pydantic_zarr.v3 import AnyGroupSpec + +S2Level = Literal["L1C", "L2A"] + +#: Reflectance pyramid levels in metres, finest first (the converter's policy). +REFLECTANCE_SCALE_LEVELS: tuple[int, ...] = (10, 20, 60, 120, 360, 720) + +#: Bands injected into coarser *native* levels, per product level, keyed by +#: target resolution in metres; generated levels inherit the previous level's +#: bands. Mirrors the converter's `inject_missing_bands` calls. +INJECTED_BANDS: dict[S2Level, dict[int, frozenset[str]]] = { + "L2A": {20: frozenset({"b08"}), 60: frozenset({"b08"})}, + "L1C": { + 20: frozenset({"b02", "b03", "b04", "b08"}), + 60: frozenset({"b02", "b03", "b04", "b08", "b05", "b06", "b07", "b8a", "b11", "b12"}), + }, +} + +#: Inner (sub-shard) chunk edge length for band arrays. +BAND_CHUNK = 1024 + +#: Band attributes carried from the input document, in the order they are +#: carried; everything else (xarray bookkeeping such as `_ARRAY_DIMENSIONS` +#: and `_eopf_attrs`, and the per-band `proj:wkt2`, which the per-level +#: `spatial_ref` array carries instead) is dropped. +_BAND_ATTR_CARRY = ( + "add_offset", + "long_name", + "proj:bbox", + "proj:epsg", + "proj:shape", + "proj:transform", + "scale_factor", + "valid_max", + "valid_min", +) + +# base64 of a little-endian float64 NaN: the `_FillValue` spelling xarray +# stores for the float coordinate arrays +_NAN_FLOAT64_B64 = base64.b64encode(struct.pack(" Sentinel2Root: + """ + Read a Zarr group into the validated `Sentinel2Root` input model. + + The model is the carrier for the conversion: it holds exactly the members + and attributes the GeoZarr plan reads, validated (member structure by the + closed TypedDicts, attributes by the attribute models). Raises + `pydantic.ValidationError` when the group is not a Sentinel-2 product. + """ + from pydantic_zarr.v2 import GroupSpec as GroupSpecV2 + + return Sentinel2Root.model_validate(GroupSpecV2.from_zarr(group).model_dump()) + + +def product_level(root: Sentinel2Root) -> S2Level: + """ + The product level (L1C or L2A) of a Sentinel-2 product, read from the + `stac_discovery` root attribute (the STAC id and `product:type` both + carry it). Raises `ValueError` when neither names a known level. + """ + stac = root.attributes.stac_discovery + candidates: list[object] = [stac.get("id")] + properties = stac.get("properties") + if isinstance(properties, dict): + candidates.append(properties.get("product:type")) + for candidate in candidates: + if not isinstance(candidate, str): + continue + for level in ("L2A", "L1C"): + # "MSIL2A" in product ids; "S2MSI2A" in product:type + if level in candidate or candidate.endswith(level[1:]): + return level + msg = "Could not determine the Sentinel-2 product level (L1C or L2A) from stac_discovery" + raise ValueError(msg) + + +def _shard_and_inner(shape: tuple[int, ...]) -> tuple[tuple[int, ...], tuple[int, ...]]: + """ + The (shard, inner chunk) shapes for a band array: inner chunks of + `BAND_CHUNK` per side (the whole dimension when smaller), shards rounded + up to whole inner chunks. + """ + inner = tuple(min(dim, BAND_CHUNK) for dim in shape) + shard = tuple( + dim if dim <= i else ceil(dim / i) * i for dim, i in zip(shape, inner, strict=True) + ) + return shard, inner + + +def _plan_band( + source_attrs: Mapping[str, object], + shape: tuple[int, ...], + data_type: str, + fill_value: object, + dimension_names: tuple[str, ...], + typesize: int, +) -> DataArray: + """One band array of one *native* level: input attributes mapped and carried.""" + attributes: dict[str, object] = { + "_FillValue": source_attrs.get("fill_value", fill_value), + "grid_mapping": "spatial_ref", + "units": "1", + } + for key in _BAND_ATTR_CARRY: + if key in source_attrs: + attributes[key] = source_attrs[key] + return _band_array(attributes, shape, data_type, fill_value, dimension_names, typesize) + + +def _band_array( + attributes: dict[str, object], + shape: tuple[int, ...], + data_type: str, + fill_value: object, + dimension_names: tuple[str, ...], + typesize: int, +) -> DataArray: + """One band array document: sharded uint16 with the blosc policy.""" + shard, inner = _shard_and_inner(shape) + return DataArray.model_validate( + { + "attributes": attributes, + "shape": shape, + "data_type": data_type, + "chunk_grid": {"name": "regular", "configuration": {"chunk_shape": shard}}, + "chunk_key_encoding": _CHUNK_KEY_ENCODING, + "fill_value": fill_value, + "codecs": ( + { + "name": "sharding_indexed", + "configuration": { + "chunk_shape": inner, + "codecs": ( + {"name": "bytes", "configuration": {"endian": "little"}}, + { + "name": "blosc", + "configuration": { + "typesize": typesize, + "cname": "zstd", + "clevel": 3, + "shuffle": "shuffle", + "blocksize": 0, + }, + }, + ), + "index_codecs": ( + {"name": "bytes", "configuration": {"endian": "little"}}, + {"name": "crc32c"}, + ), + "index_location": "end", + }, + }, + ), + "dimension_names": dimension_names, + } + ) + + +def _plan_coordinate(name: str, size: int) -> DataArray: + """A 1-D coordinate array (`x` or `y`): float64, NaN-filled, one chunk.""" + return DataArray.model_validate( + { + "attributes": {"_FillValue": _NAN_FLOAT64_B64}, + "shape": (size,), + "data_type": "float64", + "chunk_grid": {"name": "regular", "configuration": {"chunk_shape": (size,)}}, + "chunk_key_encoding": _CHUNK_KEY_ENCODING, + "fill_value": "NaN", + "codecs": ({"name": "bytes", "configuration": {"endian": "little"}},), + "dimension_names": (name,), + } + ) + + +def _grid_mapping_attributes(wkt2: str) -> dict[str, object]: + """ + The CF grid-mapping attributes of a CRS, rioxarray-style, derived from + the product's own `proj:wkt2` (rather than re-deriving from the EPSG + code, which is hostage to the installed PROJ database's naming). + """ + from pyproj import CRS + + # round-trip through CF: the stored grid mapping is exactly what a reader + # reconstructs from the CF attributes, with the authority bookkeeping the + # CF form cannot carry dropped from the WKT + crs = CRS.from_cf(CRS.from_wkt(wkt2).to_cf()) + attributes: dict[str, object] = dict(crs.to_cf()) + wkt = crs.to_wkt("WKT1_GDAL") + attributes["crs_wkt"] = wkt + attributes["spatial_ref"] = wkt + return attributes + + +def _plan_spatial_ref(wkt2: str, *, native: bool) -> ArraySpecV3: + """ + The dimensionless `spatial_ref` grid-mapping array of one level. + + A plain `pydantic_zarr.v3.ArraySpec` rather than a GeoZarr `DataArray`: + the grid-mapping array has no dimensions, which `DataArray` requires. + The levels written natively carry a zstd codec; the coarsened levels are + written uncompressed (mirroring the two write paths of the converter). + """ + codecs: tuple[Mapping[str, object], ...] = ( + {"name": "bytes", "configuration": {"endian": "little"}}, + ) + if native: + codecs = (*codecs, {"name": "zstd", "configuration": {"level": 0, "checksum": False}}) + return ArraySpecV3.model_validate( + { + "attributes": _grid_mapping_attributes(wkt2), + "shape": (), + "data_type": "int64", + "chunk_grid": {"name": "regular", "configuration": {"chunk_shape": ()}}, + "chunk_key_encoding": _CHUNK_KEY_ENCODING, + "fill_value": 0, + "codecs": codecs, + } + ) + + +def _level_spatial_attributes( + *, + meters: int, + shape: tuple[int, ...], + origin: tuple[float, float], + epsg: int, +) -> dict[str, object]: + """The spatial/proj convention attributes of one pyramid level's group.""" + x0, y0 = origin + rows, cols = shape + resolution = float(meters) + return { + "grid_mapping": "spatial_ref", + "proj:code": f"EPSG:{epsg}", + "spatial:bbox": [x0, y0 - rows * resolution, x0 + cols * resolution, y0], + "spatial:dimensions": ["y", "x"], + "spatial:registration": "pixel", + "spatial:shape": list(shape), + "spatial:transform": [resolution, 0.0, x0, 0.0, -resolution, y0], + "zarr_conventions": [_SPATIAL_CONVENTION, _PROJ_CONVENTION], + } + + +def plan_reflectance(root: Sentinel2Root) -> AnyGroupSpec: + """ + Plan the GeoZarr `measurements/reflectance` multiscale group of a + Sentinel-2 product: one level group per entry of + `REFLECTANCE_SCALE_LEVELS`, native levels carried from the input (with + the product level's finer bands injected), coarser levels derived from + the level before them, each holding sharded uint16 band arrays, float64 + `x`/`y` coordinates and a `spatial_ref` grid-mapping array, under a + multiscales layout attribute. + """ + level = product_level(root) + reflectance = root.members["measurements"].members["reflectance"] + input_levels: dict[int, Any] = {} + for meters in REFLECTANCE_SCALE_LEVELS: + member = reflectance.members.get(f"r{meters}m") + if member is not None: + input_levels[meters] = member + + if not input_levels: + msg = "The product's reflectance group holds none of the known resolution datasets" + raise ValueError(msg) + + # the georeferencing of the pyramid: origin and EPSG from any finest-level band + finest = input_levels[min(input_levels)] + first_band_name = next(k for k in finest.members if k.startswith("b")) + first_band_attrs: Mapping[str, object] = finest.members[first_band_name].attributes + transform = first_band_attrs["proj:transform"] + assert isinstance(transform, (list, tuple)) + origin = (float(transform[2]), float(transform[5])) + epsg = int(first_band_attrs["proj:epsg"]) # type: ignore[call-overload] + wkt2 = str(first_band_attrs["proj:wkt2"]) + + # per-level planned bands: name -> (source attrs, shape, dtype itemsize) + planned_levels: dict[int, dict[str, DataArray]] = {} + previous_meters: int | None = None + layout: list[dict[str, object]] = [] + members_out: dict[str, AnyGroupSpec] = {} + + for meters in REFLECTANCE_SCALE_LEVELS: + bands: dict[str, DataArray] = {} + native = meters in input_levels + if native: + source = input_levels[meters] + for name, member in source.members.items(): + if not name.startswith("b"): + continue + dims = tuple(member.attributes.get("_ARRAY_DIMENSIONS", ("y", "x"))) + bands[name] = _plan_band( + member.attributes, + tuple(member.shape), + "uint16", + 0, + dims, + typesize=2, + ) + if not bands: + msg = f"The r{meters}m resolution dataset holds no band arrays" + raise ValueError(msg) + level_shape = next(iter(bands.values())).shape + # inject finer bands so they propagate through the overview chain + for band_name in sorted(INJECTED_BANDS.get(level, {}).get(meters, ())): + if band_name in bands: + continue + for src_meters in sorted(input_levels): + if src_meters >= meters: + break + src_member = input_levels[src_meters].members.get(band_name) + if src_member is None: + continue + dims = tuple(src_member.attributes.get("_ARRAY_DIMENSIONS", ("y", "x"))) + bands[band_name] = _plan_band( + src_member.attributes, level_shape, "uint16", 0, dims, typesize=2 + ) + break + else: + assert previous_meters is not None + factor = meters // previous_meters + for name, previous in planned_levels[previous_meters].items(): + shape = tuple(dim // factor for dim in previous.shape) + # a coarsened band keeps its attributes verbatim + dims = previous.dimension_names + assert dims is not None + bands[name] = _band_array( + previous.attributes.model_dump(), + shape, + "uint16", + 0, + dims, + typesize=2, + ) + level_shape = next(iter(bands.values())).shape + + planned_levels[meters] = bands + rows, cols = level_shape + shape2d = (rows, cols) + level_members: dict[str, DataArray | ArraySpecV3] = dict(bands) + level_members["x"] = _plan_coordinate("x", cols) + level_members["y"] = _plan_coordinate("y", rows) + level_members["spatial_ref"] = _plan_spatial_ref(wkt2, native=native) + + members_out[f"r{meters}m"] = GroupSpecV3( + attributes=_level_spatial_attributes( + meters=meters, shape=shape2d, origin=origin, epsg=epsg + ), + members=level_members, + ) + + entry: dict[str, object] = { + "asset": f"r{meters}m", + "spatial:shape": list(shape2d), + "spatial:transform": [float(meters), 0.0, origin[0], 0.0, -float(meters), origin[1]], + } + if previous_meters is not None: + factor = meters // previous_meters + entry = { + "asset": entry["asset"], + "derived_from": f"r{previous_meters}m", + "spatial:shape": entry["spatial:shape"], + "spatial:transform": entry["spatial:transform"], + "transform": {"scale": [factor, factor], "translation": [0.0, 0.0]}, + } + layout.append(entry) + previous_meters = meters + + finest_meters = REFLECTANCE_SCALE_LEVELS[0] + finest_attrs = members_out[f"r{min(input_levels)}m"].attributes + assert isinstance(finest_attrs, dict) + group_attributes: dict[str, object] = { + "multiscales": {"layout": layout, "resampling_method": "average"}, + "proj:code": f"EPSG:{epsg}", + "spatial:bbox": finest_attrs["spatial:bbox"], + "spatial:dimensions": ["y", "x"], + "spatial:registration": "pixel", + "spatial:transform": [ + float(finest_meters), + 0.0, + origin[0], + 0.0, + -float(finest_meters), + origin[1], + ], + "zarr_conventions": [_MULTISCALES_CONVENTION, _SPATIAL_CONVENTION, _PROJ_CONVENTION], + } + return GroupSpecV3(attributes=group_attributes, members=members_out) + + +def plan_geozarr(root: Sentinel2Root) -> AnyGroupSpec: + """ + Plan the GeoZarr hierarchy to write for a Sentinel-2 product. + + Pure: reads only the validated input model, returns the output tree as a + Zarr V3 `GroupSpec`. Only `measurements/reflectance` is planned so far; + the `conditions` and `quality` subtrees still come from the + DataTree-based converter. + """ + return GroupSpecV3( + attributes={}, + members={ + "measurements": GroupSpecV3( + attributes={}, members={"reflectance": plan_reflectance(root)} + ), + }, + ) diff --git a/tests/test_data_api/test_s2_plan.py b/tests/test_data_api/test_s2_plan.py new file mode 100644 index 00000000..761bf415 --- /dev/null +++ b/tests/test_data_api/test_s2_plan.py @@ -0,0 +1,178 @@ +"""Tests for the spec-level Sentinel-2 GeoZarr plan (`eopf_geozarr.data_api.s2_plan`).""" + +from __future__ import annotations + +import json +import pathlib +from typing import Any + +import pytest +import zarr +from pydantic import ValidationError +from pydantic_zarr.v2 import GroupSpec as GroupSpecV2 +from pydantic_zarr.v3 import GroupSpec as GroupSpecV3 + +from eopf_geozarr.data_api.s2 import Sentinel2Root +from eopf_geozarr.data_api.s2_plan import ( + REFLECTANCE_SCALE_LEVELS, + load_sentinel2, + plan_geozarr, + plan_reflectance, + product_level, +) + +_INPUT_DIR = pathlib.Path("tests/_test_data/s2_examples") +_SNAPSHOT_DIR = pathlib.Path("tests/_test_data/optimized_geozarr_examples") +_INPUT_PATHS = sorted(_INPUT_DIR.glob("*.json")) + +# The snapshot harness (test_s2_multiscale) feeds one fixed, synthetic tile +# CRS and coordinate set to every product, because the metadata-only input +# fixtures carry no coordinate data; the plan instead derives georeferencing +# from each product's own band attributes. These are the snapshot attribute +# keys that carry the harness's tile rather than the product's, masked in the +# cross-product comparison and pinned by the self-consistency test instead. +_HARNESS_GEOREF_KEYS = ("proj:code", "spatial:bbox", "spatial:transform") + +# The one product whose real tile matches the harness's synthetic tile, so its +# snapshot is byte-for-byte reproducible from metadata alone. +_EXACT_PRODUCT = "S2B_MSIL1C_20250113T103309_N0511_R108_T32TLQ_20250113T122458" + + +def _read(path: pathlib.Path) -> dict[str, Any]: + data = json.loads(path.read_text()) + assert isinstance(data, dict) + return data + + +def _planned_reflectance(path: pathlib.Path) -> dict[str, Any]: + root = Sentinel2Root.model_validate(_read(path)) + plan = plan_geozarr(root).model_dump(mode="json") + return plan["members"]["measurements"]["members"]["reflectance"] + + +def _snapshot_reflectance(path: pathlib.Path) -> dict[str, Any]: + snapshot = GroupSpecV3.model_validate(_read(_SNAPSHOT_DIR / path.name)) + dumped = snapshot.model_dump(mode="json") + return dumped["members"]["measurements"]["members"]["reflectance"] + + +def _mask_harness_georef(reflectance: dict[str, Any]) -> None: + """Blank the attribute values the snapshot harness injects (in place).""" + + def mask_attrs(attributes: dict[str, Any]) -> None: + for key in _HARNESS_GEOREF_KEYS: + attributes.pop(key, None) + multiscales = attributes.get("multiscales") + if isinstance(multiscales, dict): + for entry in multiscales.get("layout", ()): + entry.pop("spatial:transform", None) + + mask_attrs(reflectance["attributes"]) + for level in reflectance["members"].values(): + mask_attrs(level["attributes"]) + # the whole grid-mapping array carries the harness CRS + level["members"].pop("spatial_ref", None) + + +@pytest.mark.parametrize("path", _INPUT_PATHS, ids=lambda p: p.stem[:26]) +def test_plan_matches_snapshot(path: pathlib.Path) -> None: + """ + The planned reflectance tree reproduces the stored converter snapshot: + the member tree, every array document (shapes, dtypes, shards, codecs, + dimension names) and every attribute, except the georeferencing values + the snapshot harness injects from its synthetic tile, which the + self-consistency test pins to the product's own metadata instead. + """ + planned = _planned_reflectance(path) + expected = _snapshot_reflectance(path) + _mask_harness_georef(planned) + _mask_harness_georef(expected) + assert planned == expected + + +def test_plan_matches_snapshot_exactly() -> None: + """ + For the product whose tile the snapshot harness's synthetic coordinates + model, the plan reproduces the snapshot byte for byte, georeferencing + included. + """ + path = _INPUT_DIR / f"{_EXACT_PRODUCT}.json" + assert _planned_reflectance(path) == _snapshot_reflectance(path) + + +@pytest.mark.parametrize("path", _INPUT_PATHS, ids=lambda p: p.stem[:26]) +def test_plan_georeferencing_is_self_consistent(path: pathlib.Path) -> None: + """ + Every planned level's spatial attributes derive from the product's own + band attributes: the transform is the level resolution over the finest + band's origin, the bbox is the transform applied to the level shape, and + the grid-mapping array holds the band's own CRS. + """ + from pyproj import CRS + + planned = _planned_reflectance(path) + finest = planned["members"][f"r{REFLECTANCE_SCALE_LEVELS[0]}m"] + band = next(v for k, v in finest["members"].items() if k.startswith("b")) + transform = band["attributes"]["proj:transform"] + x0, y0 = transform[2], transform[5] + epsg = band["attributes"]["proj:epsg"] + + for name, level in planned["members"].items(): + meters = float(name[1:-1]) + attributes = level["attributes"] + assert attributes["proj:code"] == f"EPSG:{epsg}" + assert attributes["spatial:transform"] == [meters, 0.0, x0, 0.0, -meters, y0] + rows, cols = level["members"]["x"]["shape"][0], level["members"]["y"]["shape"][0] + rows, cols = cols, rows # y is rows, x is cols + assert attributes["spatial:bbox"] == [ + x0, + y0 - rows * meters, + x0 + cols * meters, + y0, + ] + crs = CRS.from_wkt(level["members"]["spatial_ref"]["attributes"]["crs_wkt"]) + assert crs.to_epsg() == epsg + + +def test_load_sentinel2_keeps_the_model(tmp_path: pathlib.Path) -> None: + """ + `load_sentinel2` reads a Zarr store into the validated input model, and + the plan built from it equals the plan built from the source document. + """ + path = _INPUT_DIR / f"{_EXACT_PRODUCT}.json" + document = _read(path) + store_path = tmp_path / "s2.zarr" + GroupSpecV2.model_validate(document).to_zarr(store_path, path="") # type: ignore[arg-type] + + root = load_sentinel2(zarr.open_group(store_path, mode="r", zarr_format=2)) + assert isinstance(root, Sentinel2Root) + assert plan_geozarr(root) == plan_geozarr(Sentinel2Root.model_validate(document)) + + +def test_load_sentinel2_refuses_non_s2(tmp_path: pathlib.Path) -> None: + """A store that is not a Sentinel-2 product is refused with a ValidationError.""" + s1_path = next(pathlib.Path("tests/_test_data/s1_examples").glob("*.json")) + store_path = tmp_path / "s1.zarr" + GroupSpecV2.model_validate(_read(s1_path)).to_zarr(store_path, path="") # type: ignore[arg-type] + with pytest.raises(ValidationError): + load_sentinel2(zarr.open_group(store_path, mode="r", zarr_format=2)) + + +def test_product_level_requires_stac_discovery_evidence() -> None: + """A product whose stac_discovery names no L1C/L2A level is refused.""" + path = _INPUT_PATHS[0] + document = _read(path) + document["attributes"]["stac_discovery"] = {"id": "mystery", "properties": {}} + root = Sentinel2Root.model_validate(document) + with pytest.raises(ValueError, match="product level"): + product_level(root) + + +def test_plan_reflectance_requires_a_resolution_dataset() -> None: + """A reflectance group with none of the known resolution datasets is refused.""" + path = _INPUT_PATHS[0] + document = _read(path) + document["members"]["measurements"]["members"]["reflectance"]["members"] = {} + root = Sentinel2Root.model_validate(document) + with pytest.raises(ValueError, match="resolution datasets"): + plan_reflectance(root) From 180d3e39b7d471af5787da4640c63636750d03f8 Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Wed, 28 Oct 2026 15:30:52 +0100 Subject: [PATCH 04/45] feat(data-api): extend the Sentinel-2 GeoZarr plan to conditions and quality MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit plan_geozarr now plans the whole hierarchy. The aux multiscale groups (l1c/l2a classification, cloud probabilities) get the same pyramid treatment as reflectance via AUX_MULTISCALE_LEVELS — native levels carried, coarser levels derived with attributes verbatim, nearest resampling when the arrays carry a flag table — and every other conditions/quality dataset is carried: georeferenced datasets (detector footprints, quality masks, atmosphere) gain spatial attributes and a spatial_ref grid mapping derived from their own proj attributes, geometry and meteorology are translated as-is (string arrays to fixed_length_utf32, coordinates uncompressed, data arrays sharded), and the quicklook groups and scalar arrays are dropped, as the converter drops them. The planner walks the input model's dump, since the input model types these subtrees loosely. Runtime assert statements are replaced with raises or restructured away. The whole planned tree is byte-for-byte equal to the stored converter snapshot for the product whose tile the snapshot harness models; for the others the tests mask the harness's synthetic-tile georeferencing and the generated aux levels' chunk shapes, which the converter derives from incidental dask chunking (inner chunks of 915, 512 and 1830 for the same situation across the snapshots) where the plan uses its uniform rule. Assisted-by: ClaudeCode:claude-fable-5 Co-Authored-By: Claude Fable 5 --- src/eopf_geozarr/data_api/s2_plan.py | 429 ++++++++++++++++++++++++--- tests/test_data_api/test_s2_plan.py | 89 ++++-- 2 files changed, 454 insertions(+), 64 deletions(-) diff --git a/src/eopf_geozarr/data_api/s2_plan.py b/src/eopf_geozarr/data_api/s2_plan.py index 9331aed1..3b537084 100644 --- a/src/eopf_geozarr/data_api/s2_plan.py +++ b/src/eopf_geozarr/data_api/s2_plan.py @@ -23,20 +23,22 @@ reused, coarser levels are derived from the level before them, and finer bands are injected into the coarser native levels (`b08` everywhere; for L1C also the other 10 m and 20 m bands) so they propagate through the overview -chain. - -Only the `measurements/reflectance` subtree is planned so far; the -`conditions` and `quality` subtrees still go through the DataTree-based -converter (a follow-up migrates them onto this plan). +chain. The `conditions` and `quality` subtrees are carried: their own +multiscale groups (the classification masks and the cloud probabilities) are +planned by `AUX_MULTISCALE_LEVELS`, georeferenced datasets get their spatial +attributes and `spatial_ref` grid mappings, and the quicklook groups and +scalar arrays are dropped, as the converter drops them. """ from __future__ import annotations import base64 import struct +from collections.abc import Mapping from math import ceil from typing import TYPE_CHECKING, Any, Literal +import numpy as np from pydantic_zarr.v3 import ArraySpec as ArraySpecV3 from pydantic_zarr.v3 import GroupSpec as GroupSpecV3 @@ -44,8 +46,6 @@ from eopf_geozarr.data_api.s2 import Sentinel2Root if TYPE_CHECKING: - from collections.abc import Mapping - import zarr from pydantic_zarr.v3 import AnyGroupSpec @@ -186,7 +186,7 @@ def _plan_band( def _band_array( attributes: dict[str, object], shape: tuple[int, ...], - data_type: str, + data_type: str | dict[str, object], fill_value: object, dimension_names: tuple[str, ...], typesize: int, @@ -294,29 +294,39 @@ def _plan_spatial_ref(wkt2: str, *, native: bool) -> ArraySpecV3: ) -def _level_spatial_attributes( - *, - meters: int, +def _spatial_dataset_attributes( + transform: tuple[float, float, float, float, float, float], shape: tuple[int, ...], - origin: tuple[float, float], epsg: int, ) -> dict[str, object]: - """The spatial/proj convention attributes of one pyramid level's group.""" - x0, y0 = origin + """The spatial/proj convention attributes of one spatial dataset's group.""" + res_x, _, x0, _, res_y, y0 = transform rows, cols = shape - resolution = float(meters) return { "grid_mapping": "spatial_ref", "proj:code": f"EPSG:{epsg}", - "spatial:bbox": [x0, y0 - rows * resolution, x0 + cols * resolution, y0], + "spatial:bbox": [x0, y0 + rows * res_y, x0 + cols * res_x, y0], "spatial:dimensions": ["y", "x"], "spatial:registration": "pixel", "spatial:shape": list(shape), - "spatial:transform": [resolution, 0.0, x0, 0.0, -resolution, y0], + "spatial:transform": list(transform), "zarr_conventions": [_SPATIAL_CONVENTION, _PROJ_CONVENTION], } +def _level_spatial_attributes( + *, + meters: int, + shape: tuple[int, ...], + origin: tuple[float, float], + epsg: int, +) -> dict[str, object]: + """The spatial/proj convention attributes of one pyramid level's group.""" + x0, y0 = origin + resolution = float(meters) + return _spatial_dataset_attributes((resolution, 0.0, x0, 0.0, -resolution, y0), shape, epsg) + + def plan_reflectance(root: Sentinel2Root) -> AnyGroupSpec: """ Plan the GeoZarr `measurements/reflectance` multiscale group of a @@ -344,13 +354,16 @@ def plan_reflectance(root: Sentinel2Root) -> AnyGroupSpec: first_band_name = next(k for k in finest.members if k.startswith("b")) first_band_attrs: Mapping[str, object] = finest.members[first_band_name].attributes transform = first_band_attrs["proj:transform"] - assert isinstance(transform, (list, tuple)) + if not isinstance(transform, (list, tuple)) or len(transform) < 6: + msg = f"Band {first_band_name!r} carries no usable proj:transform" + raise ValueError(msg) origin = (float(transform[2]), float(transform[5])) epsg = int(first_band_attrs["proj:epsg"]) # type: ignore[call-overload] wkt2 = str(first_band_attrs["proj:wkt2"]) # per-level planned bands: name -> (source attrs, shape, dtype itemsize) planned_levels: dict[int, dict[str, DataArray]] = {} + level_attributes: dict[int, dict[str, object]] = {} previous_meters: int | None = None layout: list[dict[str, object]] = [] members_out: dict[str, AnyGroupSpec] = {} @@ -392,13 +405,17 @@ def plan_reflectance(root: Sentinel2Root) -> AnyGroupSpec: ) break else: - assert previous_meters is not None + if previous_meters is None: + msg = ( + f"The finest pyramid level (r{meters}m) is not in the input, " + "so there is nothing to derive the coarser levels from" + ) + raise ValueError(msg) factor = meters // previous_meters for name, previous in planned_levels[previous_meters].items(): shape = tuple(dim // factor for dim in previous.shape) # a coarsened band keeps its attributes verbatim - dims = previous.dimension_names - assert dims is not None + dims = previous.dimension_names or ("y", "x") bands[name] = _band_array( previous.attributes.model_dump(), shape, @@ -417,10 +434,11 @@ def plan_reflectance(root: Sentinel2Root) -> AnyGroupSpec: level_members["y"] = _plan_coordinate("y", rows) level_members["spatial_ref"] = _plan_spatial_ref(wkt2, native=native) + level_attributes[meters] = _level_spatial_attributes( + meters=meters, shape=shape2d, origin=origin, epsg=epsg + ) members_out[f"r{meters}m"] = GroupSpecV3( - attributes=_level_spatial_attributes( - meters=meters, shape=shape2d, origin=origin, epsg=epsg - ), + attributes=level_attributes[meters], members=level_members, ) @@ -442,12 +460,11 @@ def plan_reflectance(root: Sentinel2Root) -> AnyGroupSpec: previous_meters = meters finest_meters = REFLECTANCE_SCALE_LEVELS[0] - finest_attrs = members_out[f"r{min(input_levels)}m"].attributes - assert isinstance(finest_attrs, dict) + finest_level_attrs = level_attributes[min(input_levels)] group_attributes: dict[str, object] = { "multiscales": {"layout": layout, "resampling_method": "average"}, "proj:code": f"EPSG:{epsg}", - "spatial:bbox": finest_attrs["spatial:bbox"], + "spatial:bbox": finest_level_attrs["spatial:bbox"], "spatial:dimensions": ["y", "x"], "spatial:registration": "pixel", "spatial:transform": [ @@ -463,20 +480,356 @@ def plan_reflectance(root: Sentinel2Root) -> AnyGroupSpec: return GroupSpecV3(attributes=group_attributes, members=members_out) +# --------------------------------------------------------------------------- +# conditions and quality + +#: Groups that get a multiscale pyramid, with their levels in metres (the +#: converter's aux multiscale specs); levels present in the input are reused, +#: the rest are coarsened from the level before them. +AUX_MULTISCALE_LEVELS: dict[str, tuple[int, ...]] = { + "conditions/mask/l1c_classification": (60, 120, 360, 720), + "conditions/mask/l2a_classification": (20, 60, 120, 360, 720), + "quality/probability": (20, 60, 120, 360, 720), +} + +#: Groups the output drops: the quicklooks duplicate RGB data derivable from +#: the reflectance bands (EOPF-Explorer/data-model#81). +_DROPPED_GROUPS = frozenset({"quality/l1c_quicklook", "quality/l2a_quicklook"}) + +#: Attribute keys never carried into the output: xarray's dimension +#: bookkeeping, the EOPF source bag, the fill value (which lives in the array +#: document, re-added as a CF attribute only for floats), and the geo-proj +#: convention keys that belong on the enclosing group. +_DROPPED_ATTRS = frozenset( + {"_ARRAY_DIMENSIONS", "_eopf_attrs", "_FillValue", "proj:code", "proj:wkt2", "proj:projjson"} +) + +# The conditions/quality planner walks the input model's *dump* — plain Zarr +# V2 documents — because the input model types those subtrees loosely, so +# their nodes are a mix of spec models and raw mappings. A node holding +# "members" is a group; one holding "shape" is an array. +_ArrayDoc = Mapping[str, Any] +_GroupDoc = Mapping[str, Any] + + +def _doc_attrs(doc: Mapping[str, Any]) -> Mapping[str, object]: + attributes = doc.get("attributes") or {} + if not isinstance(attributes, Mapping): + msg = f"Attributes are not a mapping: {type(attributes)!r}" + raise TypeError(msg) + return attributes + + +def _v3_data_type(dtype_v2: str) -> str | dict[str, object]: + """The Zarr V3 data type of a Zarr V2 dtype string.""" + parsed = np.dtype(dtype_v2) + if parsed.kind == "U": + return { + "name": "fixed_length_utf32", + "configuration": {"length_bytes": parsed.itemsize}, + } + return parsed.name + + +def _carried_array_attributes( + attrs: Mapping[str, object], *, is_float: bool, grid_mapping: bool, name: str +) -> dict[str, object]: + """The output attributes of a carried array: sanitized, with the CF float + fill, the grid-mapping reference and the SCL flag table added.""" + out = {key: value for key, value in attrs.items() if key not in _DROPPED_ATTRS} + if is_float: + out["_FillValue"] = _NAN_FLOAT64_B64 + if grid_mapping: + out["grid_mapping"] = "spatial_ref" + if name == "scl": + # the converter's SCL flag table and NO_DATA fill declaration + from eopf_geozarr.s2_optimization.s2_multiscale import SCL_ATTRS, SCL_NODATA + + out.update(SCL_ATTRS) + out["_FillValue"] = SCL_NODATA + return out + + +def _plan_carried_array(name: str, doc: _ArrayDoc, *, spatial: bool) -> DataArray: + """ + One carried (non-reflectance) array, translated to its output document: + `x`/`y` become the float64 coordinate arrays, other coordinate arrays + (an array whose only dimension is its own name) keep their data type + uncompressed, and data arrays are sharded with the blosc policy. + """ + attrs = _doc_attrs(doc) + dims_raw = attrs.get("_ARRAY_DIMENSIONS") + if not isinstance(dims_raw, (list, tuple)): + msg = f"Array {name!r} carries no _ARRAY_DIMENSIONS attribute" + raise TypeError(msg) + dims = tuple(str(dim) for dim in dims_raw) + shape = tuple(doc["shape"]) + if name in ("x", "y") and dims == (name,): + return _plan_coordinate(name, shape[0]) + parsed = np.dtype(str(doc["dtype"])) + data_type = _v3_data_type(str(doc["dtype"])) + fill_value: object = "NaN" if parsed.kind == "f" else "" if parsed.kind == "U" else 0 + attributes = _carried_array_attributes( + attrs, + is_float=parsed.kind == "f", + grid_mapping=spatial and "proj:epsg" in attrs, + name=name, + ) + if dims == (name,): + # a coordinate array: one chunk, uncompressed + return DataArray.model_validate( + { + "attributes": attributes, + "shape": shape, + "data_type": data_type, + "chunk_grid": {"name": "regular", "configuration": {"chunk_shape": shape}}, + "chunk_key_encoding": _CHUNK_KEY_ENCODING, + "fill_value": fill_value, + "codecs": ({"name": "bytes", "configuration": {"endian": "little"}},), + "dimension_names": dims, + } + ) + return _band_array(attributes, shape, data_type, fill_value, dims, typesize=parsed.itemsize) + + +def _carried_arrays(group: _GroupDoc) -> dict[str, _ArrayDoc]: + """The group's non-scalar arrays (scalar arrays are dropped).""" + members = group.get("members") or {} + return { + name: member + for name, member in members.items() + if isinstance(member, Mapping) and "shape" in member and len(member["shape"]) > 0 + } + + +def _spatial_anchor(arrays: Mapping[str, _ArrayDoc]) -> tuple[str, _ArrayDoc] | None: + """The first array carrying proj attributes, with its name, if any.""" + for name, member in arrays.items(): + if "proj:epsg" in _doc_attrs(member): + return name, member + return None + + +_Transform6 = tuple[float, float, float, float, float, float] + + +def _proj_of(name: str, doc: _ArrayDoc) -> tuple[_Transform6, int, str]: + """The (transform, EPSG, WKT2) a proj-bearing input array carries.""" + attrs = _doc_attrs(doc) + transform = attrs.get("proj:transform") + if not isinstance(transform, (list, tuple)) or len(transform) < 6: + msg = f"Array {name!r} carries no usable proj:transform" + raise ValueError(msg) + a, b, c, d, e, f = (float(part) for part in transform[:6]) + return ( + (a, b, c, d, e, f), + int(attrs["proj:epsg"]), # type: ignore[call-overload] + str(attrs["proj:wkt2"]), + ) + + +def _plan_dataset(group: _GroupDoc, path: str) -> AnyGroupSpec | None: + """ + Plan one carried leaf dataset: every non-scalar array translated, and — + when the dataset is georeferenced (an array carries proj attributes) — + the group's spatial attributes and a `spatial_ref` grid-mapping array. + Returns `None` for a dataset with no arrays to carry. + """ + arrays = _carried_arrays(group) + if not arrays: + return None + anchor = _spatial_anchor(arrays) + members: dict[str, DataArray | ArraySpecV3] = { + name: _plan_carried_array(name, member, spatial=anchor is not None) + for name, member in arrays.items() + } + if anchor is None: + return GroupSpecV3(attributes=dict(_doc_attrs(group)), members=members) + transform, epsg, wkt2 = _proj_of(*anchor) + members["spatial_ref"] = _plan_spatial_ref(wkt2, native=True) + return GroupSpecV3( + attributes=_spatial_dataset_attributes(transform, tuple(anchor[1]["shape"]), epsg), + members=members, + ) + + +def _plan_aux_multiscale( + group: _GroupDoc, path: str, scale_levels: tuple[int, ...] +) -> AnyGroupSpec: + """ + Plan an auxiliary multiscale group (a classification mask or the cloud + probabilities): levels present in the input are carried, coarser levels + derive from the level before them with their arrays' attributes verbatim, + and the group gets the multiscales layout — resampled `nearest` when the + arrays carry a flag table, `average` otherwise. + """ + group_members = group.get("members") or {} + input_levels: dict[int, _GroupDoc] = {} + for meters in scale_levels: + member = group_members.get(f"r{meters}m") + if member is not None: + input_levels[meters] = member + if not input_levels: + msg = f"The {path} group holds none of the known resolution datasets" + raise ValueError(msg) + + finest_arrays = { + name: member + for name, member in _carried_arrays(input_levels[min(input_levels)]).items() + if name not in ("x", "y") + } + anchor = _spatial_anchor(finest_arrays) + if anchor is None: + msg = f"The {path} group's finest level carries no proj attributes" + raise ValueError(msg) + transform, epsg, wkt2 = _proj_of(*anchor) + origin = (transform[2], transform[5]) + + planned_levels: dict[int, dict[str, DataArray]] = {} + level_attributes: dict[int, dict[str, object]] = {} + members_out: dict[str, AnyGroupSpec] = {} + layout: list[dict[str, object]] = [] + previous_meters: int | None = None + uses_flags = False + + for meters in scale_levels: + variables: dict[str, DataArray] = {} + native = meters in input_levels + if native: + for name, member in _carried_arrays(input_levels[meters]).items(): + if name in ("x", "y"): + continue + variables[name] = _plan_carried_array(name, member, spatial=True) + if not variables: + msg = f"The {path} r{meters}m dataset holds no arrays" + raise ValueError(msg) + else: + if previous_meters is None: + msg = ( + f"The finest {path} level (r{meters}m) is not in the input, " + "so there is nothing to derive the coarser levels from" + ) + raise ValueError(msg) + factor = meters // previous_meters + for name, previous in planned_levels[previous_meters].items(): + shape = tuple(dim // factor for dim in previous.shape) + data_type = previous.data_type + if not isinstance(data_type, str): + msg = f"Cannot coarsen {path} variable {name!r} of data type {data_type!r}" + raise TypeError(msg) + # a coarsened variable keeps its attributes verbatim + variables[name] = _band_array( + previous.attributes.model_dump(), + shape, + data_type, + previous.fill_value, + previous.dimension_names or ("y", "x"), + typesize=np.dtype(data_type).itemsize, + ) + uses_flags = uses_flags or any( + not {"flag_values", "flag_meanings", "flag_masks"}.isdisjoint( + variable.attributes.model_dump() + ) + for variable in variables.values() + ) + planned_levels[meters] = variables + rows, cols = next(iter(variables.values())).shape + level_members: dict[str, DataArray | ArraySpecV3] = dict(variables) + level_members["x"] = _plan_coordinate("x", cols) + level_members["y"] = _plan_coordinate("y", rows) + level_members["spatial_ref"] = _plan_spatial_ref(wkt2, native=native) + level_attributes[meters] = _level_spatial_attributes( + meters=meters, shape=(rows, cols), origin=origin, epsg=epsg + ) + members_out[f"r{meters}m"] = GroupSpecV3( + attributes=level_attributes[meters], members=level_members + ) + + entry: dict[str, object] = { + "asset": f"r{meters}m", + "spatial:shape": [rows, cols], + "spatial:transform": [float(meters), 0.0, origin[0], 0.0, -float(meters), origin[1]], + } + if previous_meters is not None: + factor = meters // previous_meters + entry = { + "asset": entry["asset"], + "derived_from": f"r{previous_meters}m", + "spatial:shape": entry["spatial:shape"], + "spatial:transform": entry["spatial:transform"], + "transform": {"scale": [factor, factor], "translation": [0.0, 0.0]}, + } + layout.append(entry) + previous_meters = meters + + finest_meters = scale_levels[0] + group_attributes: dict[str, object] = { + "multiscales": { + "layout": layout, + "resampling_method": "nearest" if uses_flags else "average", + }, + "proj:code": f"EPSG:{epsg}", + "spatial:bbox": level_attributes[min(input_levels)]["spatial:bbox"], + "spatial:dimensions": ["y", "x"], + "spatial:registration": "pixel", + "spatial:transform": [ + float(finest_meters), + 0.0, + origin[0], + 0.0, + -float(finest_meters), + origin[1], + ], + "zarr_conventions": [_MULTISCALES_CONVENTION, _SPATIAL_CONVENTION, _PROJ_CONVENTION], + } + return GroupSpecV3(attributes=group_attributes, members=members_out) + + +def _plan_subtree(group: _GroupDoc, path: str) -> AnyGroupSpec | None: + """ + Plan one conditions/quality subtree: aux multiscale groups by their specs, + leaf datasets carried, dropped and empty groups skipped. + """ + if path in _DROPPED_GROUPS: + return None + if path in AUX_MULTISCALE_LEVELS: + return _plan_aux_multiscale(group, path, AUX_MULTISCALE_LEVELS[path]) + members = group.get("members") or {} + subgroups = { + name: member + for name, member in members.items() + if isinstance(member, Mapping) and "members" in member + } + if not subgroups: + return _plan_dataset(group, path) + planned: dict[str, AnyGroupSpec] = {} + for name, member in subgroups.items(): + sub = _plan_subtree(member, f"{path}/{name}") + if sub is not None: + planned[name] = sub + if not planned: + return None + return GroupSpecV3(attributes=dict(_doc_attrs(group)), members=planned) + + def plan_geozarr(root: Sentinel2Root) -> AnyGroupSpec: """ Plan the GeoZarr hierarchy to write for a Sentinel-2 product. Pure: reads only the validated input model, returns the output tree as a - Zarr V3 `GroupSpec`. Only `measurements/reflectance` is planned so far; - the `conditions` and `quality` subtrees still come from the - DataTree-based converter. + Zarr V3 `GroupSpec` — `measurements/reflectance` as the sharded multiscale + pyramid, and the `conditions` and `quality` subtrees carried (their own + multiscale groups planned by `AUX_MULTISCALE_LEVELS`, the quicklooks and + scalar arrays dropped). """ - return GroupSpecV3( - attributes={}, - members={ - "measurements": GroupSpecV3( - attributes={}, members={"reflectance": plan_reflectance(root)} - ), - }, - ) + members: dict[str, AnyGroupSpec] = { + "measurements": GroupSpecV3(attributes={}, members={"reflectance": plan_reflectance(root)}), + } + for top in ("conditions", "quality"): + member = root.members.get(top) + if member is None: + continue + planned = _plan_subtree(member.model_dump(), top) + if planned is not None: + members[top] = planned + return GroupSpecV3(attributes={}, members=members) diff --git a/tests/test_data_api/test_s2_plan.py b/tests/test_data_api/test_s2_plan.py index 761bf415..afb28801 100644 --- a/tests/test_data_api/test_s2_plan.py +++ b/tests/test_data_api/test_s2_plan.py @@ -44,60 +44,97 @@ def _read(path: pathlib.Path) -> dict[str, Any]: return data -def _planned_reflectance(path: pathlib.Path) -> dict[str, Any]: +def _planned_root(path: pathlib.Path) -> dict[str, Any]: root = Sentinel2Root.model_validate(_read(path)) - plan = plan_geozarr(root).model_dump(mode="json") - return plan["members"]["measurements"]["members"]["reflectance"] + return plan_geozarr(root).model_dump(mode="json") -def _snapshot_reflectance(path: pathlib.Path) -> dict[str, Any]: +def _snapshot_root(path: pathlib.Path) -> dict[str, Any]: snapshot = GroupSpecV3.model_validate(_read(_SNAPSHOT_DIR / path.name)) - dumped = snapshot.model_dump(mode="json") - return dumped["members"]["measurements"]["members"]["reflectance"] + return snapshot.model_dump(mode="json") -def _mask_harness_georef(reflectance: dict[str, Any]) -> None: - """Blank the attribute values the snapshot harness injects (in place).""" +def _planned_reflectance(path: pathlib.Path) -> dict[str, Any]: + return _planned_root(path)["members"]["measurements"]["members"]["reflectance"] - def mask_attrs(attributes: dict[str, Any]) -> None: + +def _mask_harness_georef(node: dict[str, Any]) -> None: + """Blank the attribute values the snapshot harness injects (in place).""" + attributes = node.get("attributes") + if isinstance(attributes, dict): for key in _HARNESS_GEOREF_KEYS: attributes.pop(key, None) multiscales = attributes.get("multiscales") if isinstance(multiscales, dict): for entry in multiscales.get("layout", ()): entry.pop("spatial:transform", None) - - mask_attrs(reflectance["attributes"]) - for level in reflectance["members"].values(): - mask_attrs(level["attributes"]) + members = node.get("members") + if isinstance(members, dict): # the whole grid-mapping array carries the harness CRS - level["members"].pop("spatial_ref", None) + members.pop("spatial_ref", None) + for member in members.values(): + _mask_harness_georef(member) + + +def _mask_generated_aux_chunking(node: dict[str, Any], input_doc: dict[str, Any]) -> None: + """ + Blank the chunk and shard shapes of the *generated* aux pyramid levels + (in place). The converter derives them from the dask chunking of whatever + object the level was coarsened from, which is incoherent across products + (inner chunks of 915, 512 and 1830 for the same situation); the plan uses + its uniform rule, so these values cannot be pinned by the snapshots. + """ + from eopf_geozarr.data_api.s2_plan import AUX_MULTISCALE_LEVELS + + for group_path in AUX_MULTISCALE_LEVELS: + planned_group: dict[str, Any] | None = node + input_group: dict[str, Any] | None = input_doc + for part in group_path.split("/"): + planned_group = (planned_group or {}).get("members", {}).get(part) + input_group = (input_group or {}).get("members", {}).get(part) + if planned_group is None or input_group is None: + continue + for level_name, level in planned_group.get("members", {}).items(): + if level_name in input_group.get("members", {}): + continue # a native level: its chunking is pinned + for name, member in level.get("members", {}).items(): + if name in ("x", "y", "spatial_ref") or "shape" not in member: + continue + member.pop("chunk_grid", None) + codecs = member.get("codecs") + if codecs and codecs[0].get("name") == "sharding_indexed": + codecs[0]["configuration"].pop("chunk_shape", None) @pytest.mark.parametrize("path", _INPUT_PATHS, ids=lambda p: p.stem[:26]) def test_plan_matches_snapshot(path: pathlib.Path) -> None: """ - The planned reflectance tree reproduces the stored converter snapshot: - the member tree, every array document (shapes, dtypes, shards, codecs, - dimension names) and every attribute, except the georeferencing values - the snapshot harness injects from its synthetic tile, which the - self-consistency test pins to the product's own metadata instead. + The planned tree reproduces the stored converter snapshot — the member + tree, every array document (shapes, dtypes, shards, codecs, dimension + names) and every attribute, across measurements, conditions and quality — + except the georeferencing values the snapshot harness injects from its + synthetic tile (pinned to the product's own metadata by the + self-consistency test instead), and the chunk shapes of the generated aux + pyramid levels (incoherent in the snapshots; see + `_mask_generated_aux_chunking`). """ - planned = _planned_reflectance(path) - expected = _snapshot_reflectance(path) - _mask_harness_georef(planned) - _mask_harness_georef(expected) + input_doc = _read(path) + planned = _planned_root(path) + expected = _snapshot_root(path) + for tree in (planned, expected): + _mask_harness_georef(tree) + _mask_generated_aux_chunking(tree, input_doc) assert planned == expected def test_plan_matches_snapshot_exactly() -> None: """ For the product whose tile the snapshot harness's synthetic coordinates - model, the plan reproduces the snapshot byte for byte, georeferencing - included. + model, the plan reproduces the whole snapshot byte for byte, + georeferencing included. """ path = _INPUT_DIR / f"{_EXACT_PRODUCT}.json" - assert _planned_reflectance(path) == _snapshot_reflectance(path) + assert _planned_root(path) == _snapshot_root(path) @pytest.mark.parametrize("path", _INPUT_PATHS, ids=lambda p: p.stem[:26]) From 0cbf5674f98c0c7c688eb0f8c487079c3559e302 Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Wed, 28 Oct 2026 15:45:02 +0100 Subject: [PATCH 05/45] fix(s2-optimization): rechunk generated pyramid levels uniformly before encoding Coarsening divides whatever dask chunks the source dataset happens to have, so the stored encoding of a generated level depended on the incidental chunking of the object it was coarsened from: the snapshots held inner chunks of 915, 512 and 1830 for like levels. generic multiscales now rechunks the coarsened dataset to the spatial chunk target (min(spatial_chunk, dim) per dimension) before deriving the encoding, matching the native levels' policy and the spec-level plan's uniform rule. The snapshots are regenerated (the only other change is the omission of null dimension_names, which current pydantic-zarr no longer serializes), and the plan tests drop their generated-level chunk masking: the whole tree is now pinned. Assisted-by: ClaudeCode:claude-fable-5 Co-Authored-By: Claude Fable 5 --- .../s2_optimization/s2_multiscale.py | 14 +++-- ...041_N0511_R122_T32TQM_20251008T122613.json | 53 +++++-------------- ...309_N0511_R108_T32TLQ_20250113T122458.json | 16 ------ ...131_N0511_R037_T29TPF_20250811T152216.json | 53 +++++-------------- tests/test_data_api/test_s2_plan.py | 38 +------------ 5 files changed, 37 insertions(+), 137 deletions(-) diff --git a/src/eopf_geozarr/s2_optimization/s2_multiscale.py b/src/eopf_geozarr/s2_optimization/s2_multiscale.py index ee74534e..4d1f8df4 100644 --- a/src/eopf_geozarr/s2_optimization/s2_multiscale.py +++ b/src/eopf_geozarr/s2_optimization/s2_multiscale.py @@ -404,6 +404,7 @@ def generic_multiscales( enable_sharding: bool = True, crs: CRS | None = None, scale_offset_codec: bool = False, + spatial_chunk: int = 1024, ) -> dict[str, Any]: base_path, scale_levels = spec.base_path, spec.scale_levels finest_dataset_key = spec.finest_key @@ -477,9 +478,14 @@ def generic_multiscales( log.info("Creating level with resolution", level=dest_level_name, resolution=dest_level) - # Create downsampled dataset by coarsening - downsampled_dataset = create_downsampled_resolution_group( - source_ds, factor=downsample_factor + # Create downsampled dataset by coarsening, then rechunk + # uniformly before deriving the encoding: coarsening divides + # whatever dask chunks the source happens to have, which + # previously leaked incidental chunk shapes into the stored + # encoding (inner chunks of 915, 512 and 1830 for like levels). + downsampled_dataset = utils._rechunk_ds( + create_downsampled_resolution_group(source_ds, factor=downsample_factor), + spatial_chunk, ) log.info("Writing level to path", level=dest_level_name, output_path=dest_level_path) @@ -792,6 +798,7 @@ def create_multiscale_from_datatree( enable_sharding=enable_sharding, crs=crs, scale_offset_codec=scale_offset_codec, + spatial_chunk=spatial_chunk, ) ) @@ -808,6 +815,7 @@ def create_multiscale_from_datatree( enable_sharding=enable_sharding, crs=crs, scale_offset_codec=scale_offset_codec, + spatial_chunk=spatial_chunk, ) # update processed groups with multiscale included groups, old instances of dataset are replaced, diff --git a/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json b/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json index 6e2ba561..8e165597 100644 --- a/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json +++ b/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json @@ -994,7 +994,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -1744,7 +1743,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -2209,7 +2207,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -2636,7 +2633,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -2914,7 +2910,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -3199,7 +3194,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -3477,7 +3471,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -3842,8 +3835,8 @@ "chunk_grid": { "configuration": { "chunk_shape": [ - 1024, - 1024 + 915, + 915 ] }, "name": "regular" @@ -3858,8 +3851,8 @@ { "configuration": { "chunk_shape": [ - 512, - 512 + 915, + 915 ], "codecs": [ { @@ -3947,7 +3940,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -4249,7 +4241,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -4544,7 +4535,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -4846,7 +4836,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -5141,7 +5130,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -7933,7 +7921,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -9342,7 +9329,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -10655,7 +10641,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -12064,7 +12049,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -13480,7 +13464,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -14889,7 +14872,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -15179,7 +15161,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -15551,7 +15532,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -15923,7 +15903,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -16666,7 +16645,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -17536,7 +17514,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -18061,7 +18038,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -18597,7 +18573,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -18965,7 +18940,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -19326,7 +19300,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -19488,8 +19461,8 @@ "chunk_grid": { "configuration": { "chunk_shape": [ - 1830, - 1830 + 2048, + 2048 ] }, "name": "regular" @@ -19504,8 +19477,8 @@ { "configuration": { "chunk_shape": [ - 1830, - 1830 + 1024, + 1024 ], "codecs": [ { @@ -19582,8 +19555,8 @@ "chunk_grid": { "configuration": { "chunk_shape": [ - 1830, - 1830 + 2048, + 2048 ] }, "name": "regular" @@ -19598,8 +19571,8 @@ { "configuration": { "chunk_shape": [ - 1830, - 1830 + 1024, + 1024 ], "codecs": [ { @@ -19687,7 +19660,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -20048,7 +20020,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], diff --git a/tests/_test_data/optimized_geozarr_examples/S2B_MSIL1C_20250113T103309_N0511_R108_T32TLQ_20250113T122458.json b/tests/_test_data/optimized_geozarr_examples/S2B_MSIL1C_20250113T103309_N0511_R108_T32TLQ_20250113T122458.json index aa1ecf49..288ef61f 100644 --- a/tests/_test_data/optimized_geozarr_examples/S2B_MSIL1C_20250113T103309_N0511_R108_T32TLQ_20250113T122458.json +++ b/tests/_test_data/optimized_geozarr_examples/S2B_MSIL1C_20250113T103309_N0511_R108_T32TLQ_20250113T122458.json @@ -994,7 +994,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -1744,7 +1743,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -2209,7 +2207,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -2636,7 +2633,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -2914,7 +2910,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -3199,7 +3194,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -3477,7 +3471,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -6269,7 +6262,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -7781,7 +7773,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -8991,7 +8982,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -10503,7 +10493,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -12022,7 +12011,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -13534,7 +13522,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -14188,7 +14175,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -15058,7 +15044,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -15583,7 +15568,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], diff --git a/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json b/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json index 738cb492..9a6f31c8 100644 --- a/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json +++ b/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json @@ -994,7 +994,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -1744,7 +1743,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -2209,7 +2207,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -2636,7 +2633,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -2914,7 +2910,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -3199,7 +3194,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -3477,7 +3471,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -3842,8 +3835,8 @@ "chunk_grid": { "configuration": { "chunk_shape": [ - 1024, - 1024 + 915, + 915 ] }, "name": "regular" @@ -3858,8 +3851,8 @@ { "configuration": { "chunk_shape": [ - 512, - 512 + 915, + 915 ], "codecs": [ { @@ -3947,7 +3940,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -4249,7 +4241,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -4544,7 +4535,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -4846,7 +4836,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -5141,7 +5130,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -7933,7 +7921,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -9342,7 +9329,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -10655,7 +10641,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -12064,7 +12049,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -13480,7 +13464,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -14889,7 +14872,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -15179,7 +15161,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -15551,7 +15532,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -15923,7 +15903,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -16666,7 +16645,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -17536,7 +17514,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -18061,7 +18038,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -18597,7 +18573,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -18965,7 +18940,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -19326,7 +19300,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -19488,8 +19461,8 @@ "chunk_grid": { "configuration": { "chunk_shape": [ - 1830, - 1830 + 2048, + 2048 ] }, "name": "regular" @@ -19504,8 +19477,8 @@ { "configuration": { "chunk_shape": [ - 1830, - 1830 + 1024, + 1024 ], "codecs": [ { @@ -19582,8 +19555,8 @@ "chunk_grid": { "configuration": { "chunk_shape": [ - 1830, - 1830 + 2048, + 2048 ] }, "name": "regular" @@ -19598,8 +19571,8 @@ { "configuration": { "chunk_shape": [ - 1830, - 1830 + 1024, + 1024 ], "codecs": [ { @@ -19687,7 +19660,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -20048,7 +20020,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], diff --git a/tests/test_data_api/test_s2_plan.py b/tests/test_data_api/test_s2_plan.py index afb28801..682c57ff 100644 --- a/tests/test_data_api/test_s2_plan.py +++ b/tests/test_data_api/test_s2_plan.py @@ -76,36 +76,6 @@ def _mask_harness_georef(node: dict[str, Any]) -> None: _mask_harness_georef(member) -def _mask_generated_aux_chunking(node: dict[str, Any], input_doc: dict[str, Any]) -> None: - """ - Blank the chunk and shard shapes of the *generated* aux pyramid levels - (in place). The converter derives them from the dask chunking of whatever - object the level was coarsened from, which is incoherent across products - (inner chunks of 915, 512 and 1830 for the same situation); the plan uses - its uniform rule, so these values cannot be pinned by the snapshots. - """ - from eopf_geozarr.data_api.s2_plan import AUX_MULTISCALE_LEVELS - - for group_path in AUX_MULTISCALE_LEVELS: - planned_group: dict[str, Any] | None = node - input_group: dict[str, Any] | None = input_doc - for part in group_path.split("/"): - planned_group = (planned_group or {}).get("members", {}).get(part) - input_group = (input_group or {}).get("members", {}).get(part) - if planned_group is None or input_group is None: - continue - for level_name, level in planned_group.get("members", {}).items(): - if level_name in input_group.get("members", {}): - continue # a native level: its chunking is pinned - for name, member in level.get("members", {}).items(): - if name in ("x", "y", "spatial_ref") or "shape" not in member: - continue - member.pop("chunk_grid", None) - codecs = member.get("codecs") - if codecs and codecs[0].get("name") == "sharding_indexed": - codecs[0]["configuration"].pop("chunk_shape", None) - - @pytest.mark.parametrize("path", _INPUT_PATHS, ids=lambda p: p.stem[:26]) def test_plan_matches_snapshot(path: pathlib.Path) -> None: """ @@ -113,17 +83,13 @@ def test_plan_matches_snapshot(path: pathlib.Path) -> None: tree, every array document (shapes, dtypes, shards, codecs, dimension names) and every attribute, across measurements, conditions and quality — except the georeferencing values the snapshot harness injects from its - synthetic tile (pinned to the product's own metadata by the - self-consistency test instead), and the chunk shapes of the generated aux - pyramid levels (incoherent in the snapshots; see - `_mask_generated_aux_chunking`). + synthetic tile, which the self-consistency test pins to the product's own + metadata instead. """ - input_doc = _read(path) planned = _planned_root(path) expected = _snapshot_root(path) for tree in (planned, expected): _mask_harness_georef(tree) - _mask_generated_aux_chunking(tree, input_doc) assert planned == expected From 178a1a72ce4ce7b488c70daa326f0721603045a5 Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Wed, 28 Oct 2026 18:39:21 +0100 Subject: [PATCH 06/45] chore(deps): bump pydantic-zarr to main at 9f2e847 Picks up the unreleased extra-fields support (consolidated root documents now validate, carried in extra_fields and refused by to_zarr), the typed to_metadata_json / to_stored_metadata_json exports, the always-complete GroupSpec hierarchy, and whole-document validation for Zarr V2 arrays. Whole-repo pyright and the full non-network suite are green against it. Assisted-by: ClaudeCode:claude-fable-5 Co-Authored-By: Claude Fable 5 --- uv.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/uv.lock b/uv.lock index 3f11ec02..bf28b859 100644 --- a/uv.lock +++ b/uv.lock @@ -4496,8 +4496,8 @@ wheels = [ [[package]] name = "pydantic-zarr" -version = "0.10.1.dev34+g66cf23990" -source = { git = "https://github.com/zarr-developers/pydantic-zarr.git?rev=main#66cf23990b122f2d4272829243095bce6b9ca233" } +version = "0.10.1.dev41+g9f2e847ce" +source = { git = "https://github.com/zarr-developers/pydantic-zarr.git?rev=main#9f2e847ce7fe2c98119699ddcf3e090fba688e1f" } dependencies = [ { name = "numpy", version = "2.4.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.13'" }, { name = "numpy", version = "2.5.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.13'" }, From 17a49ebf25e9c1c8bb02d16d3305f9264580f6c4 Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Wed, 28 Oct 2026 20:20:34 +0100 Subject: [PATCH 07/45] refactor(data-api): type the plan's metadata documents with zarr-metadata and zarr-cm Every zarr metadata field the Sentinel-2 plan writes now carries its published type: zarr-metadata's *Object TypedDicts for the extension points (regular chunk grid, default chunk key encoding, and the bytes, blosc, zstd, crc32c and sharding_indexed codecs), zarr-cm's convention types for the zarr-conventions attributes (the CMO declarations replace the hand-written registry dicts, and layout entries are LayoutObject with the spatial convention's keys as typed extra items), and dedicated TypedDicts for the fixed-shape documents the plan builds itself: GridMappingAttrs (narrowed at runtime from pyproj's CF output via zarr_metadata.typed_json.check), SpatialGroupAttrs, MultiscaleGroupAttrs, and FixedLengthUtf32Object in the GeoZarr scope. Function-scoped imports move to the top of their modules. No runtime change: the stored snapshots are byte-identical. Assisted-by: ClaudeCode:claude-fable-5 Co-Authored-By: Claude Fable 5 --- src/eopf_geozarr/data_api/geozarr/scope.py | 11 + src/eopf_geozarr/data_api/s2_plan.py | 257 +++++++++++++-------- tests/test_data_api/test_s2_plan.py | 3 +- 3 files changed, 173 insertions(+), 98 deletions(-) diff --git a/src/eopf_geozarr/data_api/geozarr/scope.py b/src/eopf_geozarr/data_api/geozarr/scope.py index bd4d6694..30741ba2 100644 --- a/src/eopf_geozarr/data_api/geozarr/scope.py +++ b/src/eopf_geozarr/data_api/geozarr/scope.py @@ -14,6 +14,8 @@ from __future__ import annotations +from typing import Literal, NotRequired + from typing_extensions import TypedDict from zarr_metadata.v3.definition import CORE_AND_EXTENSIONS, DataTypeDefinition @@ -24,6 +26,15 @@ class FixedLengthUtf32Configuration(TypedDict, closed=True): length_bytes: int +class FixedLengthUtf32Object(TypedDict, closed=True): + """``fixed_length_utf32`` data type metadata in object form, mirroring the + shape of ``zarr-metadata``'s per-extension ``*Object`` types.""" + + name: Literal["fixed_length_utf32"] + configuration: FixedLengthUtf32Configuration + must_understand: NotRequired[bool] + + FIXED_LENGTH_UTF32 = DataTypeDefinition( name="fixed_length_utf32", configuration=FixedLengthUtf32Configuration, diff --git a/src/eopf_geozarr/data_api/s2_plan.py b/src/eopf_geozarr/data_api/s2_plan.py index 3b537084..04637d84 100644 --- a/src/eopf_geozarr/data_api/s2_plan.py +++ b/src/eopf_geozarr/data_api/s2_plan.py @@ -36,18 +36,38 @@ import struct from collections.abc import Mapping from math import ceil -from typing import TYPE_CHECKING, Any, Literal +from typing import TYPE_CHECKING, Any, Final, Literal import numpy as np +from pydantic_zarr.v2 import GroupSpec as GroupSpecV2 from pydantic_zarr.v3 import ArraySpec as ArraySpecV3 from pydantic_zarr.v3 import GroupSpec as GroupSpecV3 +from pyproj import CRS +from typing_extensions import TypedDict +from zarr_cm import ConventionMetadataObject +from zarr_cm.multiscales import CMO as MULTISCALES_CMO +from zarr_cm.multiscales import MultiscalesAttrs +from zarr_cm.proj import CMO as PROJ_CMO +from zarr_cm.spatial import CMO as SPATIAL_CMO +from zarr_metadata.typed_json import check from eopf_geozarr.data_api.geozarr.v3 import DataArray from eopf_geozarr.data_api.s2 import Sentinel2Root +from eopf_geozarr.s2_optimization.s2_multiscale import SCL_ATTRS, SCL_NODATA if TYPE_CHECKING: import zarr - from pydantic_zarr.v3 import AnyGroupSpec + from pydantic_zarr.v3 import AnyGroupSpec, FillValue + from zarr_cm.multiscales import LayoutObject + from zarr_metadata.v3.chunk_grid.regular import RegularChunkGridObject + from zarr_metadata.v3.chunk_key_encoding.default import DefaultChunkKeyEncodingObject + from zarr_metadata.v3.codec.blosc import BloscCodecObject + from zarr_metadata.v3.codec.bytes import BytesCodecObject + from zarr_metadata.v3.codec.crc32c import Crc32cCodecObject + from zarr_metadata.v3.codec.sharding_indexed import ShardingIndexedCodecObject + from zarr_metadata.v3.codec.zstd import ZstdCodecObject + + from eopf_geozarr.data_api.geozarr.scope import FixedLengthUtf32Object S2Level = Literal["L1C", "L2A"] @@ -88,31 +108,16 @@ # stores for the float coordinate arrays _NAN_FLOAT64_B64 = base64.b64encode(struct.pack(" bytes codec of every planned array. +_BYTES_LITTLE: Final[BytesCodecObject] = {"name": "bytes", "configuration": {"endian": "little"}} + +_CRC32C: Final[Crc32cCodecObject] = {"name": "crc32c"} + def load_sentinel2(group: zarr.Group) -> Sentinel2Root: """ @@ -123,8 +128,6 @@ def load_sentinel2(group: zarr.Group) -> Sentinel2Root: closed TypedDicts, attributes by the attribute models). Raises `pydantic.ValidationError` when the group is not a Sentinel-2 product. """ - from pydantic_zarr.v2 import GroupSpec as GroupSpecV2 - return Sentinel2Root.model_validate(GroupSpecV2.from_zarr(group).model_dump()) @@ -163,11 +166,16 @@ def _shard_and_inner(shape: tuple[int, ...]) -> tuple[tuple[int, ...], tuple[int return shard, inner +def _regular_grid(chunk_shape: tuple[int, ...]) -> RegularChunkGridObject: + """The regular chunk grid metadata for one chunk shape.""" + return {"name": "regular", "configuration": {"chunk_shape": chunk_shape}} + + def _plan_band( source_attrs: Mapping[str, object], shape: tuple[int, ...], data_type: str, - fill_value: object, + fill_value: FillValue, dimension_names: tuple[str, ...], typesize: int, ) -> DataArray: @@ -186,47 +194,41 @@ def _plan_band( def _band_array( attributes: dict[str, object], shape: tuple[int, ...], - data_type: str | dict[str, object], - fill_value: object, + data_type: str | FixedLengthUtf32Object, + fill_value: FillValue, dimension_names: tuple[str, ...], typesize: int, ) -> DataArray: """One band array document: sharded uint16 with the blosc policy.""" shard, inner = _shard_and_inner(shape) + compressor: BloscCodecObject = { + "name": "blosc", + "configuration": { + "typesize": typesize, + "cname": "zstd", + "clevel": 3, + "shuffle": "shuffle", + "blocksize": 0, + }, + } + sharding: ShardingIndexedCodecObject = { + "name": "sharding_indexed", + "configuration": { + "chunk_shape": inner, + "codecs": (_BYTES_LITTLE, compressor), + "index_codecs": (_BYTES_LITTLE, _CRC32C), + "index_location": "end", + }, + } return DataArray.model_validate( { "attributes": attributes, "shape": shape, "data_type": data_type, - "chunk_grid": {"name": "regular", "configuration": {"chunk_shape": shard}}, + "chunk_grid": _regular_grid(shard), "chunk_key_encoding": _CHUNK_KEY_ENCODING, "fill_value": fill_value, - "codecs": ( - { - "name": "sharding_indexed", - "configuration": { - "chunk_shape": inner, - "codecs": ( - {"name": "bytes", "configuration": {"endian": "little"}}, - { - "name": "blosc", - "configuration": { - "typesize": typesize, - "cname": "zstd", - "clevel": 3, - "shuffle": "shuffle", - "blocksize": 0, - }, - }, - ), - "index_codecs": ( - {"name": "bytes", "configuration": {"endian": "little"}}, - {"name": "crc32c"}, - ), - "index_location": "end", - }, - }, - ), + "codecs": (sharding,), "dimension_names": dimension_names, } ) @@ -239,23 +241,47 @@ def _plan_coordinate(name: str, size: int) -> DataArray: "attributes": {"_FillValue": _NAN_FLOAT64_B64}, "shape": (size,), "data_type": "float64", - "chunk_grid": {"name": "regular", "configuration": {"chunk_shape": (size,)}}, + "chunk_grid": _regular_grid((size,)), "chunk_key_encoding": _CHUNK_KEY_ENCODING, "fill_value": "NaN", - "codecs": ({"name": "bytes", "configuration": {"endian": "little"}},), + "codecs": (_BYTES_LITTLE,), "dimension_names": (name,), } ) -def _grid_mapping_attributes(wkt2: str) -> dict[str, object]: +class GridMappingAttrs(TypedDict, closed=True): + """ + The attributes of a Sentinel-2 `spatial_ref` grid-mapping array: pyproj's + CF encoding of the tile's UTM (transverse mercator) CRS, plus the WKT1 + spellings rioxarray stores (CF's `crs_wkt` and GDAL's `spatial_ref`). + """ + + crs_wkt: str + false_easting: float + false_northing: float + geographic_crs_name: str + grid_mapping_name: str + horizontal_datum_name: str + inverse_flattening: float + latitude_of_projection_origin: float + longitude_of_central_meridian: float + longitude_of_prime_meridian: float + prime_meridian_name: str + projected_crs_name: str + reference_ellipsoid_name: str + scale_factor_at_central_meridian: float + semi_major_axis: float + semi_minor_axis: float + spatial_ref: str + + +def _grid_mapping_attributes(wkt2: str) -> GridMappingAttrs: """ The CF grid-mapping attributes of a CRS, rioxarray-style, derived from the product's own `proj:wkt2` (rather than re-deriving from the EPSG code, which is hostage to the installed PROJ database's naming). """ - from pyproj import CRS - # round-trip through CF: the stored grid mapping is exactly what a reader # reconstructs from the CF attributes, with the authority bookkeeping the # CF form cannot carry dropped from the WKT @@ -264,7 +290,12 @@ def _grid_mapping_attributes(wkt2: str) -> dict[str, object]: wkt = crs.to_wkt("WKT1_GDAL") attributes["crs_wkt"] = wkt attributes["spatial_ref"] = wkt - return attributes + checked, problems = check(attributes, GridMappingAttrs) + if checked is None or problems: + details = "; ".join(f"{'.'.join(map(str, p.loc))}: {p.message}" for p in problems) + msg = f"The product CRS is not the expected transverse-mercator grid mapping: {details}" + raise ValueError(msg) + return checked def _plan_spatial_ref(wkt2: str, *, native: bool) -> ArraySpecV3: @@ -276,9 +307,7 @@ def _plan_spatial_ref(wkt2: str, *, native: bool) -> ArraySpecV3: The levels written natively carry a zstd codec; the coarsened levels are written uncompressed (mirroring the two write paths of the converter). """ - codecs: tuple[Mapping[str, object], ...] = ( - {"name": "bytes", "configuration": {"endian": "little"}}, - ) + codecs: tuple[BytesCodecObject | ZstdCodecObject, ...] = (_BYTES_LITTLE,) if native: codecs = (*codecs, {"name": "zstd", "configuration": {"level": 0, "checksum": False}}) return ArraySpecV3.model_validate( @@ -286,7 +315,7 @@ def _plan_spatial_ref(wkt2: str, *, native: bool) -> ArraySpecV3: "attributes": _grid_mapping_attributes(wkt2), "shape": (), "data_type": "int64", - "chunk_grid": {"name": "regular", "configuration": {"chunk_shape": ()}}, + "chunk_grid": _regular_grid(()), "chunk_key_encoding": _CHUNK_KEY_ENCODING, "fill_value": 0, "codecs": codecs, @@ -294,11 +323,45 @@ def _plan_spatial_ref(wkt2: str, *, native: bool) -> ArraySpecV3: ) +SpatialGroupAttrs = TypedDict( + "SpatialGroupAttrs", + { + "grid_mapping": str, + "proj:code": str, + "spatial:bbox": list[float], + "spatial:dimensions": list[str], + "spatial:registration": str, + "spatial:shape": list[int], + "spatial:transform": list[float], + "zarr_conventions": list[ConventionMetadataObject], + }, +) +"""The spatial/proj convention attributes of one georeferenced group (a +resolution dataset or a pyramid level), which always carries every key; +the per-key value types are zarr-cm's.""" + +MultiscaleGroupAttrs = TypedDict( + "MultiscaleGroupAttrs", + { + "multiscales": MultiscalesAttrs, + "proj:code": str, + "spatial:bbox": list[float], + "spatial:dimensions": list[str], + "spatial:registration": str, + "spatial:transform": list[float], + "zarr_conventions": list[ConventionMetadataObject], + }, +) +"""The attributes of a multiscale pyramid's root group: zarr-cm's multiscales +attributes plus the finest level's georeferencing (no `grid_mapping` or +`spatial:shape`, which belong to the level groups).""" + + def _spatial_dataset_attributes( transform: tuple[float, float, float, float, float, float], shape: tuple[int, ...], epsg: int, -) -> dict[str, object]: +) -> SpatialGroupAttrs: """The spatial/proj convention attributes of one spatial dataset's group.""" res_x, _, x0, _, res_y, y0 = transform rows, cols = shape @@ -310,7 +373,7 @@ def _spatial_dataset_attributes( "spatial:registration": "pixel", "spatial:shape": list(shape), "spatial:transform": list(transform), - "zarr_conventions": [_SPATIAL_CONVENTION, _PROJ_CONVENTION], + "zarr_conventions": [SPATIAL_CMO, PROJ_CMO], } @@ -320,7 +383,7 @@ def _level_spatial_attributes( shape: tuple[int, ...], origin: tuple[float, float], epsg: int, -) -> dict[str, object]: +) -> SpatialGroupAttrs: """The spatial/proj convention attributes of one pyramid level's group.""" x0, y0 = origin resolution = float(meters) @@ -363,9 +426,9 @@ def plan_reflectance(root: Sentinel2Root) -> AnyGroupSpec: # per-level planned bands: name -> (source attrs, shape, dtype itemsize) planned_levels: dict[int, dict[str, DataArray]] = {} - level_attributes: dict[int, dict[str, object]] = {} + level_attributes: dict[int, SpatialGroupAttrs] = {} previous_meters: int | None = None - layout: list[dict[str, object]] = [] + layout: list[LayoutObject] = [] members_out: dict[str, AnyGroupSpec] = {} for meters in REFLECTANCE_SCALE_LEVELS: @@ -442,18 +505,20 @@ def plan_reflectance(root: Sentinel2Root) -> AnyGroupSpec: members=level_members, ) - entry: dict[str, object] = { + level_shape2d = list(shape2d) + level_transform = [float(meters), 0.0, origin[0], 0.0, -float(meters), origin[1]] + entry: LayoutObject = { "asset": f"r{meters}m", - "spatial:shape": list(shape2d), - "spatial:transform": [float(meters), 0.0, origin[0], 0.0, -float(meters), origin[1]], + "spatial:shape": level_shape2d, + "spatial:transform": level_transform, } if previous_meters is not None: factor = meters // previous_meters entry = { - "asset": entry["asset"], + "asset": f"r{meters}m", "derived_from": f"r{previous_meters}m", - "spatial:shape": entry["spatial:shape"], - "spatial:transform": entry["spatial:transform"], + "spatial:shape": level_shape2d, + "spatial:transform": level_transform, "transform": {"scale": [factor, factor], "translation": [0.0, 0.0]}, } layout.append(entry) @@ -461,7 +526,7 @@ def plan_reflectance(root: Sentinel2Root) -> AnyGroupSpec: finest_meters = REFLECTANCE_SCALE_LEVELS[0] finest_level_attrs = level_attributes[min(input_levels)] - group_attributes: dict[str, object] = { + group_attributes: MultiscaleGroupAttrs = { "multiscales": {"layout": layout, "resampling_method": "average"}, "proj:code": f"EPSG:{epsg}", "spatial:bbox": finest_level_attrs["spatial:bbox"], @@ -475,7 +540,7 @@ def plan_reflectance(root: Sentinel2Root) -> AnyGroupSpec: -float(finest_meters), origin[1], ], - "zarr_conventions": [_MULTISCALES_CONVENTION, _SPATIAL_CONVENTION, _PROJ_CONVENTION], + "zarr_conventions": [MULTISCALES_CMO, SPATIAL_CMO, PROJ_CMO], } return GroupSpecV3(attributes=group_attributes, members=members_out) @@ -520,7 +585,7 @@ def _doc_attrs(doc: Mapping[str, Any]) -> Mapping[str, object]: return attributes -def _v3_data_type(dtype_v2: str) -> str | dict[str, object]: +def _v3_data_type(dtype_v2: str) -> str | FixedLengthUtf32Object: """The Zarr V3 data type of a Zarr V2 dtype string.""" parsed = np.dtype(dtype_v2) if parsed.kind == "U": @@ -543,8 +608,6 @@ def _carried_array_attributes( out["grid_mapping"] = "spatial_ref" if name == "scl": # the converter's SCL flag table and NO_DATA fill declaration - from eopf_geozarr.s2_optimization.s2_multiscale import SCL_ATTRS, SCL_NODATA - out.update(SCL_ATTRS) out["_FillValue"] = SCL_NODATA return out @@ -568,7 +631,7 @@ def _plan_carried_array(name: str, doc: _ArrayDoc, *, spatial: bool) -> DataArra return _plan_coordinate(name, shape[0]) parsed = np.dtype(str(doc["dtype"])) data_type = _v3_data_type(str(doc["dtype"])) - fill_value: object = "NaN" if parsed.kind == "f" else "" if parsed.kind == "U" else 0 + fill_value: FillValue = "NaN" if parsed.kind == "f" else "" if parsed.kind == "U" else 0 attributes = _carried_array_attributes( attrs, is_float=parsed.kind == "f", @@ -582,10 +645,10 @@ def _plan_carried_array(name: str, doc: _ArrayDoc, *, spatial: bool) -> DataArra "attributes": attributes, "shape": shape, "data_type": data_type, - "chunk_grid": {"name": "regular", "configuration": {"chunk_shape": shape}}, + "chunk_grid": _regular_grid(shape), "chunk_key_encoding": _CHUNK_KEY_ENCODING, "fill_value": fill_value, - "codecs": ({"name": "bytes", "configuration": {"endian": "little"}},), + "codecs": (_BYTES_LITTLE,), "dimension_names": dims, } ) @@ -686,9 +749,9 @@ def _plan_aux_multiscale( origin = (transform[2], transform[5]) planned_levels: dict[int, dict[str, DataArray]] = {} - level_attributes: dict[int, dict[str, object]] = {} + level_attributes: dict[int, SpatialGroupAttrs] = {} members_out: dict[str, AnyGroupSpec] = {} - layout: list[dict[str, object]] = [] + layout: list[LayoutObject] = [] previous_meters: int | None = None uses_flags = False @@ -745,25 +808,27 @@ def _plan_aux_multiscale( attributes=level_attributes[meters], members=level_members ) - entry: dict[str, object] = { + level_shape2d = [rows, cols] + level_transform = [float(meters), 0.0, origin[0], 0.0, -float(meters), origin[1]] + entry: LayoutObject = { "asset": f"r{meters}m", - "spatial:shape": [rows, cols], - "spatial:transform": [float(meters), 0.0, origin[0], 0.0, -float(meters), origin[1]], + "spatial:shape": level_shape2d, + "spatial:transform": level_transform, } if previous_meters is not None: factor = meters // previous_meters entry = { - "asset": entry["asset"], + "asset": f"r{meters}m", "derived_from": f"r{previous_meters}m", - "spatial:shape": entry["spatial:shape"], - "spatial:transform": entry["spatial:transform"], + "spatial:shape": level_shape2d, + "spatial:transform": level_transform, "transform": {"scale": [factor, factor], "translation": [0.0, 0.0]}, } layout.append(entry) previous_meters = meters finest_meters = scale_levels[0] - group_attributes: dict[str, object] = { + group_attributes: MultiscaleGroupAttrs = { "multiscales": { "layout": layout, "resampling_method": "nearest" if uses_flags else "average", @@ -780,7 +845,7 @@ def _plan_aux_multiscale( -float(finest_meters), origin[1], ], - "zarr_conventions": [_MULTISCALES_CONVENTION, _SPATIAL_CONVENTION, _PROJ_CONVENTION], + "zarr_conventions": [MULTISCALES_CMO, SPATIAL_CMO, PROJ_CMO], } return GroupSpecV3(attributes=group_attributes, members=members_out) diff --git a/tests/test_data_api/test_s2_plan.py b/tests/test_data_api/test_s2_plan.py index 682c57ff..5e46d50b 100644 --- a/tests/test_data_api/test_s2_plan.py +++ b/tests/test_data_api/test_s2_plan.py @@ -11,6 +11,7 @@ from pydantic import ValidationError from pydantic_zarr.v2 import GroupSpec as GroupSpecV2 from pydantic_zarr.v3 import GroupSpec as GroupSpecV3 +from pyproj import CRS from eopf_geozarr.data_api.s2 import Sentinel2Root from eopf_geozarr.data_api.s2_plan import ( @@ -111,8 +112,6 @@ def test_plan_georeferencing_is_self_consistent(path: pathlib.Path) -> None: band's origin, the bbox is the transform applied to the level shape, and the grid-mapping array holds the band's own CRS. """ - from pyproj import CRS - planned = _planned_reflectance(path) finest = planned["members"][f"r{REFLECTANCE_SCALE_LEVELS[0]}m"] band = next(v for k, v in finest["members"].items() if k.startswith("b")) From 04c8771a48ac7e5ea6ec0024fb7d13fe31fa39d2 Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Wed, 28 Oct 2026 20:55:56 +0100 Subject: [PATCH 08/45] feat(data-api): write the planned hierarchy without the DataTree writer Adds data_api/s2_write.py: write_geozarr realizes the plan with zarr-python and numpy alone. The planned metadata documents are written first (pydantic-zarr to_zarr, so every stored document is exactly the plan), then the chunk data is filled in: native arrays copied from the input store, injected bands block-resampled from the finest input level that holds them, generated pyramid levels chained from the level before them with the converter's arithmetic (nodata-masked rounded block mean, window-centre subsampling for classifications, window means for the coordinates), and grid-mapping arrays set to zero. Product-level publication (root attributes, consolidation, STAC) stays the converter pipeline's separate final step. The parity test runs write_geozarr and create_multiscale_from_datatree on the same seeded input (each product's own proj:transform drives the coordinates; small arrays and the scene classifications carry patterned values) and compares the stores file by file: identical file sets, identical metadata documents, and byte-identical chunks, for all three fixture products. Assisted-by: ClaudeCode:claude-fable-5 Co-Authored-By: Claude Fable 5 --- src/eopf_geozarr/data_api/s2_write.py | 295 ++++++++++++++++++++++++++ tests/test_data_api/test_s2_write.py | 178 ++++++++++++++++ 2 files changed, 473 insertions(+) create mode 100644 src/eopf_geozarr/data_api/s2_write.py create mode 100644 tests/test_data_api/test_s2_write.py diff --git a/src/eopf_geozarr/data_api/s2_write.py b/src/eopf_geozarr/data_api/s2_write.py new file mode 100644 index 00000000..400226e1 --- /dev/null +++ b/src/eopf_geozarr/data_api/s2_write.py @@ -0,0 +1,295 @@ +""" +Realize the Sentinel-2 GeoZarr plan: the data plane. + +`write_geozarr` writes the hierarchy that `eopf_geozarr.data_api.s2_plan` +describes, without xarray's DataTree writer. The planned metadata documents +are written first, via pydantic-zarr's `to_zarr`, so every stored document is +exactly the plan; the chunk data is then filled in with zarr-python alone. +Native arrays are copied from the input store, and the derived arrays are +block-resampled with the converter's arithmetic: injected bands come from the +finest input level that holds them, generated pyramid levels are chained from +the level before them, measurements and probabilities are reduced by the +nodata-masked block mean (rounded for integer data), classification masks +take the window-centre pixel, and coordinates take the window mean. + +The write order is metadata first, per array: a reader that opens the store +mid-write sees complete, valid documents (absent chunks read as the fill +value). Product-level publication — root attributes, consolidated metadata, +the STAC item — is not written here and stays the converter pipeline's final, +separate step, so consumers that discover the product through the root never +see a partially filled store. +""" + +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING + +import numpy as np +import zarr +from pydantic_zarr.v3 import is_group_spec + +from eopf_geozarr.data_api.s2_plan import plan_geozarr +from eopf_geozarr.s2_optimization.s2_resampling import determine_variable_type + +if TYPE_CHECKING: + from pydantic_zarr.v3 import AnyArraySpec, AnyGroupSpec + from zarr.abc.store import Store + + from eopf_geozarr.data_api.s2 import Sentinel2Root + +#: Rows per stripe for the streamed block mean (a multiple of the coarsening +#: factor is taken per stripe, so windows never straddle a stripe boundary). +_MEAN_STRIPE_ROWS = 2048 + + +def write_geozarr(root: Sentinel2Root, source: zarr.Group, store: Store | str) -> AnyGroupSpec: + """ + Write the GeoZarr hierarchy planned from `root` to `store`, copying and + resampling chunk data from `source` (the Zarr V2 input store `root` was + read from). Returns the plan that was written. + """ + plan = plan_geozarr(root) + # the metadata plane: every group and array document, exactly as planned + output = plan.to_zarr(store, path="") # type: ignore[arg-type] + _fill_group(plan, source, output, "") + return plan + + +def _fill_group(spec: AnyGroupSpec, source: zarr.Group, output: zarr.Group, path: str) -> None: + """Fill the data of every array under one planned group (recursively).""" + for name, member in spec.members.items(): + member_path = f"{path}/{name}".lstrip("/") + if is_group_spec(member): + attributes = member.attributes + if isinstance(attributes, Mapping) and "multiscales" in attributes: + _fill_pyramid(member, source, output, member_path) + else: + _fill_group(member, source, output, member_path) + else: + _fill_carried_array(source, output, member_path) + + +def _fill_carried_array(source: zarr.Group, output: zarr.Group, path: str) -> None: + """Copy one carried array's data from the input store (grid mappings hold 0).""" + out_array = _output_array(output, path) + if path.rsplit("/", 1)[-1] == "spatial_ref": + out_array[...] = 0 + return + src_array = _input_array(source, path) + if src_array is None: + msg = f"The input store holds no array at {path!r}" + raise ValueError(msg) + out_array[...] = src_array[:] + + +def _fill_pyramid(spec: AnyGroupSpec, source: zarr.Group, output: zarr.Group, path: str) -> None: + """ + Fill one multiscale subtree, finest level first: native levels are copied + from the input store (with their injected bands resampled from the finest + input level that holds them), and generated levels are chained from the + data of the level before them, as the converter chains them. + """ + levels = sorted(spec.members, key=_level_meters) + previous_data: dict[str, np.ndarray] = {} + previous_coords: dict[str, np.ndarray] = {} + previous_meters: int | None = None + for level_name in levels: + level_spec = spec.members[level_name] + if not is_group_spec(level_spec): + msg = f"Planned pyramid member {path}/{level_name} is not a group" + raise TypeError(msg) + meters = _level_meters(level_name) + level_path = f"{path}/{level_name}" + native = _input_group(source, level_path) is not None + data: dict[str, np.ndarray] = {} + coords: dict[str, np.ndarray] = {} + for var, member in level_spec.members.items(): + if var == "spatial_ref": + continue + if var in ("x", "y"): + coords[var] = _level_coordinate( + source, + f"{level_path}/{var}", + previous_coords.get(var), + meters, + previous_meters, + native=native, + ) + else: + data[var] = _level_variable( + member, + source, + var, + path, + level_path, + meters, + previous_meters, + previous_data, + native=native, + ) + for var, values in {**data, **coords}.items(): + _output_array(output, f"{level_path}/{var}")[...] = values + if "spatial_ref" in level_spec.members: + _output_array(output, f"{level_path}/spatial_ref")[...] = 0 + previous_data, previous_coords, previous_meters = data, coords, meters + + +def _level_variable( + member: AnyArraySpec | AnyGroupSpec, + source: zarr.Group, + var: str, + base_path: str, + level_path: str, + meters: int, + previous_meters: int | None, + previous_data: dict[str, np.ndarray], + *, + native: bool, +) -> np.ndarray: + """The data of one pyramid-level variable: copied, injected, or chained.""" + if native: + src_array = _input_array(source, f"{level_path}/{var}") + if src_array is not None: + return np.asarray(src_array[:]) + # an injected band: resample from the finest input level that holds it + injected = _finest_input_source(source, base_path, var, meters) + if injected is None: + msg = f"No input level finer than {meters} m holds the injected band {var!r}" + raise ValueError(msg) + src_array, src_meters = injected + return _coarsen(np.asarray(src_array[:]), meters // src_meters, var, _integer_fill(member)) + if previous_meters is None: + msg = f"The finest planned level {level_path} is missing from the input store" + raise ValueError(msg) + if var not in previous_data: + msg = f"Variable {var!r} of generated level {level_path} is missing from the previous level" + raise ValueError(msg) + return _coarsen(previous_data[var], meters // previous_meters, var, _integer_fill(member)) + + +def _level_coordinate( + source: zarr.Group, + coord_path: str, + previous: np.ndarray | None, + meters: int, + previous_meters: int | None, + *, + native: bool, +) -> np.ndarray: + """A level's x/y values: the input's at native levels, window means after.""" + if native: + src_array = _input_array(source, coord_path) + if src_array is None: + msg = f"The input store holds no coordinate array at {coord_path!r}" + raise ValueError(msg) + return np.asarray(src_array[:]) + if previous is None or previous_meters is None: + msg = f"No previous level to derive the coordinate at {coord_path!r} from" + raise ValueError(msg) + factor = meters // previous_meters + size = previous.shape[0] // factor + return previous[: size * factor].reshape(size, factor).mean(axis=1) + + +def _coarsen(values: np.ndarray, factor: int, var: str, fill: int | None) -> np.ndarray: + """ + Downsample one variable by `factor`, with the converter's arithmetic: + classification masks take the window-centre pixel; everything else takes + the block mean — NaN-skipping for floats, nodata-masked and rounded for + integers (an all-nodata window keeps the fill value). + """ + kind = determine_variable_type(var) + rows = values.shape[0] // factor * factor + cols = values.shape[1] // factor * factor + trimmed = values[:rows, :cols] + if kind == "classification": + offset = factor // 2 + return trimmed[offset::factor, offset::factor] + if kind not in ("reflectance", "probability"): + msg = f"Unknown/Unapplicable variable type {kind} for {var!r}" + raise ValueError(msg) + out = np.empty((rows // factor, cols // factor), dtype=values.dtype) + stripe = factor * max(1, _MEAN_STRIPE_ROWS // factor) + for row in range(0, rows, stripe): + block = trimmed[row : row + stripe] + windows = block.reshape(block.shape[0] // factor, factor, cols // factor, factor) + out[row // factor : (row + block.shape[0]) // factor] = _window_mean(windows, fill) + return out + + +def _window_mean(windows: np.ndarray, fill: int | None) -> np.ndarray: + """The converter's block-mean reduction over one (i, factor, j, factor) view.""" + if np.issubdtype(windows.dtype, np.floating): + # decoded values: nodata is NaN, and the NaN-skipping mean excludes it + total = np.nansum(windows.astype("float64"), axis=(1, 3)) + count = np.sum(~np.isnan(windows), axis=(1, 3)) + return (total / np.maximum(count, 1)).astype(windows.dtype) + as_float = windows.astype("float64") + if fill is None: + return np.round(as_float.mean(axis=(1, 3))).astype(windows.dtype) + # raw integers: mask nodata, average, round (a plain cast truncates), and + # keep the fill where a window holds nothing but nodata + mask = windows != fill + total = np.where(mask, as_float, 0.0).sum(axis=(1, 3)) + count = mask.sum(axis=(1, 3)) + mean = np.round(total / np.maximum(count, 1)) + return np.where(count > 0, mean, fill).astype(windows.dtype) + + +def _finest_input_source( + source: zarr.Group, base_path: str, var: str, meters: int +) -> tuple[zarr.Array, int] | None: + """The finest input level of this subtree holding `var`, with its metres.""" + base = _input_group(source, base_path) + if base is None: + return None + candidates = sorted( + (name for name in base.group_keys() if _is_level_name(name)), key=_level_meters + ) + for name in candidates: + src_meters = _level_meters(name) + if src_meters >= meters: + return None + member = _input_array(source, f"{base_path}/{name}/{var}") + if member is not None: + return member, src_meters + return None + + +def _integer_fill(member: AnyArraySpec | AnyGroupSpec) -> int | None: + """The planned array's fill value, when it is the integer-nodata kind.""" + fill = getattr(member, "fill_value", None) + return fill if isinstance(fill, int) else None + + +def _level_meters(name: str) -> int: + return int(name[1:-1]) + + +def _is_level_name(name: str) -> bool: + return name.startswith("r") and name.endswith("m") and name[1:-1].isdigit() + + +def _input_group(source: zarr.Group, path: str) -> zarr.Group | None: + try: + member = source[path] + except KeyError: + return None + return member if isinstance(member, zarr.Group) else None + + +def _input_array(source: zarr.Group, path: str) -> zarr.Array | None: + try: + member = source[path] + except KeyError: + return None + return member if isinstance(member, zarr.Array) else None + + +def _output_array(output: zarr.Group, path: str) -> zarr.Array: + member = output[path] + if not isinstance(member, zarr.Array): + msg = f"The planned store holds no array at {path!r}" + raise TypeError(msg) + return member diff --git a/tests/test_data_api/test_s2_write.py b/tests/test_data_api/test_s2_write.py new file mode 100644 index 00000000..ac68d22b --- /dev/null +++ b/tests/test_data_api/test_s2_write.py @@ -0,0 +1,178 @@ +""" +Parity tests for the plan-driven writer (`eopf_geozarr.data_api.s2_write`): +the store it writes is compared file by file against the store the DataTree +writer (`create_multiscale_from_datatree`) produces from the same input. +""" + +from __future__ import annotations + +import json +from typing import TYPE_CHECKING + +import numpy as np +import pytest +import xarray as xr +import zarr +from pyproj import CRS +from structlog.testing import capture_logs + +if TYPE_CHECKING: + import pathlib + +from eopf_geozarr.data_api.s2_plan import load_sentinel2 +from eopf_geozarr.data_api.s2_write import write_geozarr +from eopf_geozarr.s2_optimization.s2_multiscale import create_multiscale_from_datatree + +from ..conftest import create_zarrv2_group_from_json, get_stem, s2_example_json_paths + +# Fallback footprint for coordinate arrays in groups that carry no proj +# attributes (geometry, meteorology), where both writers only copy the values. +_TILE_X_MIN = 300000.0 +_TILE_Y_MAX = 5000040.0 +_TILE_EXTENT = 109800.0 + +#: Arrays at most this many elements get deterministic test data, so the +#: resampling arithmetic is exercised on values, not only on nodata fill. +_PATTERN_MAX_ELEMENTS = 1830 * 1830 + +#: Larger arrays seeded anyway: the scene classifications, so the +#: window-centre subsampling is exercised on real values. +_PATTERNED_PATHS = ( + "conditions/mask/l2a_classification/r20m/scl", + "conditions/mask/l1c_classification/r60m/b00", +) + + +def _walk_groups(group: zarr.Group, prefix: str = "") -> list[tuple[str, zarr.Group]]: + found: list[tuple[str, zarr.Group]] = [(prefix, group)] + for name, subgroup in group.groups(): + found.extend(_walk_groups(subgroup, f"{prefix}{name}/")) + return found + + +def _group_transform(group: zarr.Group) -> tuple[float, ...] | None: + """The proj:transform any of the group's arrays carries, if any.""" + for _, array in group.arrays(): + transform = array.attrs.get("proj:transform") + if not isinstance(transform, (list, tuple)) or len(transform) < 6: + continue + values = [value for value in transform[:6] if isinstance(value, (int, float))] + if len(values) == 6: + return tuple(float(value) for value in values) + return None + + +def _seed_input_store(group: zarr.Group) -> None: + """Give the metadata-only fixture store coordinates and array values. + + Coordinates are the pixel centres of each group's own `proj:transform` + (the georeferencing the plan derives from attributes, and the DataTree + writer re-derives from these values), and real products store them as + float64, so the fixtures' int64 declarations are recreated in that form. + """ + patterned = set(_PATTERNED_PATHS) + for group_path, subgroup in _walk_groups(group): + transform = _group_transform(subgroup) + for name, array in subgroup.arrays(): + path = f"{group_path}{name}" + if name in ("x", "y") and array.ndim == 1: + centers = np.arange(array.shape[0]) + 0.5 + if transform is not None: + res_x, _, x0, _, res_y, y0 = transform + values = x0 + centers * res_x if name == "x" else y0 + centers * res_y + else: + res = _TILE_EXTENT / array.shape[0] + values = ( + _TILE_X_MIN + centers * res if name == "x" else _TILE_Y_MAX - centers * res + ) + replacement = zarr.create_array( + group.store, + name=path, + shape=array.shape, + dtype="float64", + chunks=array.chunks, + zarr_format=2, + fill_value=float("nan"), + attributes=dict(array.attrs), + overwrite=True, + ) + replacement[:] = values + elif array.ndim == 2 and np.issubdtype(array.dtype, np.integer): + if array.size <= _PATTERN_MAX_ELEMENTS or path in patterned: + modulus = min(999, int(np.iinfo(array.dtype).max)) + array[...] = (np.arange(array.size) % modulus).reshape(array.shape) + + +def _store_files(root: pathlib.Path) -> set[str]: + return {str(p.relative_to(root)) for p in root.rglob("*") if p.is_file()} + + +@pytest.mark.filterwarnings("ignore:.*:RuntimeWarning") +@pytest.mark.filterwarnings("ignore:.*:FutureWarning") +@pytest.mark.filterwarnings("ignore:.*:UserWarning") +@pytest.mark.parametrize("source_path", s2_example_json_paths, ids=get_stem) +def test_write_geozarr_matches_datatree_writer( + source_path: pathlib.Path, tmp_path: pathlib.Path +) -> None: + """ + `write_geozarr` reproduces the DataTree writer's store from the same + input: the same files (so the same chunk existence), the same metadata + documents, and the same bytes in every chunk — across the copied native + levels, the injected bands, the generated pyramid levels (mean and + window-centre resampling exercised on seeded values), the coordinates, + and the carried conditions/quality datasets. + """ + input_path = create_zarrv2_group_from_json(source_path, tmp_path) + _seed_input_store(zarr.open_group(input_path, mode="r+", zarr_format=2)) + input_group = zarr.open_group(input_path, mode="r", zarr_format=2) + + band = input_group["measurements/reflectance/r10m/b02"] + assert isinstance(band, zarr.Array) + crs = CRS.from_epsg(int(band.attrs["proj:epsg"])) # type: ignore[arg-type] + + datatree_path = tmp_path / "datatree.zarr" + dt_input = xr.open_datatree( + input_group.store, # pyright: ignore[reportArgumentType] + engine="zarr", + chunks={}, + mask_and_scale=False, + decode_coords="all", + ) + with capture_logs(): + create_multiscale_from_datatree( + dt_input, + output_group=zarr.create_group(str(datatree_path)), + enable_sharding=True, + spatial_chunk=1024, + crs=crs, + ) + + planned_path = tmp_path / "planned.zarr" + write_geozarr(load_sentinel2(input_group), input_group, str(planned_path)) + + datatree_files = _store_files(datatree_path) + planned_files = _store_files(planned_path) + assert sorted(planned_files) == sorted(datatree_files) + + mismatched = [] + for key in sorted(datatree_files): + expected = (datatree_path / key).read_bytes() + observed = (planned_path / key).read_bytes() + if key.rsplit("/", 1)[-1] == "zarr.json": + if json.loads(observed) != json.loads(expected): + mismatched.append(key) + elif observed != expected: + mismatched.append(key) + assert mismatched == [] + + +def test_write_geozarr_refuses_a_source_missing_the_planned_arrays( + tmp_path: pathlib.Path, +) -> None: + """A source store that lacks a planned array's data is refused.""" + input_path = create_zarrv2_group_from_json(s2_example_json_paths[0], tmp_path) + input_group = zarr.open_group(input_path, mode="r", zarr_format=2) + root = load_sentinel2(input_group) + empty_source = zarr.create_group(tmp_path / "empty.zarr", zarr_format=2) + with pytest.raises(ValueError, match="input store"): + write_geozarr(root, empty_source, str(tmp_path / "out.zarr")) From 85f1638dcbcf5cf2f36bfd986402b2bde6572dbf Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Wed, 28 Oct 2026 20:55:56 +0100 Subject: [PATCH 09/45] style(pyz): declare the wrapper generics with PEP 695 type parameters Converts the pyz GroupSpec/ArraySpec wrappers from Generic[...] bases with module-level TypeVars to PEP 695 type parameters (ruff UP046), and drops an unused import this branch had left in geozarr/v3.py. Assisted-by: ClaudeCode:claude-fable-5 Co-Authored-By: Claude Fable 5 --- src/eopf_geozarr/data_api/geozarr/v3.py | 2 +- src/eopf_geozarr/data_api/s3_olci.py | 6 ++++-- src/eopf_geozarr/pyz/v2.py | 10 +++------- src/eopf_geozarr/pyz/v3.py | 10 +++------- 4 files changed, 11 insertions(+), 17 deletions(-) diff --git a/src/eopf_geozarr/data_api/geozarr/v3.py b/src/eopf_geozarr/data_api/geozarr/v3.py index ee3f9431..02bdc7c2 100644 --- a/src/eopf_geozarr/data_api/geozarr/v3.py +++ b/src/eopf_geozarr/data_api/geozarr/v3.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, Self, cast +from typing import Self, cast from pydantic import model_validator from pydantic_zarr.v3 import AnyGroupSpec, ArraySpec, GroupSpec diff --git a/src/eopf_geozarr/data_api/s3_olci.py b/src/eopf_geozarr/data_api/s3_olci.py index 23b7c7bc..8c2eceb7 100644 --- a/src/eopf_geozarr/data_api/s3_olci.py +++ b/src/eopf_geozarr/data_api/s3_olci.py @@ -70,14 +70,16 @@ class Sentinel3OlciRootMembers(TypedDict, closed=True, total=False): Mapping[str, object], Mapping[ str, - GroupSpec[Mapping[str, object], Mapping[str, ArraySpec[Mapping[str, object]]]] | ArraySpec[Mapping[str, object]], + GroupSpec[Mapping[str, object], Mapping[str, ArraySpec[Mapping[str, object]]]] + | ArraySpec[Mapping[str, object]], ], ] conditions: GroupSpec[ Mapping[str, object], Mapping[ str, - GroupSpec[Mapping[str, object], Mapping[str, ArraySpec[Mapping[str, object]]]] | ArraySpec[Mapping[str, object]], + GroupSpec[Mapping[str, object], Mapping[str, ArraySpec[Mapping[str, object]]]] + | ArraySpec[Mapping[str, object]], ], ] diff --git a/src/eopf_geozarr/pyz/v2.py b/src/eopf_geozarr/pyz/v2.py index 242d648d..7229d71c 100644 --- a/src/eopf_geozarr/pyz/v2.py +++ b/src/eopf_geozarr/pyz/v2.py @@ -20,10 +20,9 @@ class MyGroup(GroupSpec[Any, MyMembers]) from __future__ import annotations from collections.abc import Mapping -from typing import Any, Generic, TypeAlias, TypeVar, Union +from typing import Any, TypeAlias, Union from pydantic import Field - from pydantic_zarr.v2 import ArraySpec as ArraySpecV2 from pydantic_zarr.v2 import GroupSpec as GroupSpecV2 from pydantic_zarr.v2 import TBaseItem as TBaseItemV2 @@ -38,11 +37,8 @@ class MyGroup(GroupSpec[Any, MyMembers]) TBaseMember: TypeAlias = Mapping[str, Union["GroupSpec[Any, Any]", "ArraySpec[Any]"]] # noqa: UP040 -TAttr = TypeVar("TAttr", bound=TBaseAttr) -TMembers = TypeVar("TMembers", bound=TBaseMember) - -class GroupSpec(GroupSpecV2[TAttr, TBaseItemV2], Generic[TAttr, TMembers]): +class GroupSpec[TAttr: TBaseAttr, TMembers: TBaseMember](GroupSpecV2[TAttr, TBaseItemV2]): # The parent is parameterized at its widest member type, and TMembers (the # full members mapping, e.g. a closed TypedDict) narrows the *field*: a # legal override, since pydantic-zarr's parameters are covariant and the @@ -72,7 +68,7 @@ def _repr_html_(self) -> str: ) -class ArraySpec(ArraySpecV2[TAttr], Generic[TAttr]): +class ArraySpec[TAttr: TBaseAttr](ArraySpecV2[TAttr]): """ Zarr V2 ArraySpec with enhanced HTML representation for Jupyter/IPython. diff --git a/src/eopf_geozarr/pyz/v3.py b/src/eopf_geozarr/pyz/v3.py index 50347a4e..39963531 100644 --- a/src/eopf_geozarr/pyz/v3.py +++ b/src/eopf_geozarr/pyz/v3.py @@ -20,10 +20,9 @@ class MyGroup(GroupSpec[Any, MyMembers]) from __future__ import annotations from collections.abc import Mapping -from typing import Any, Generic, TypeAlias, TypeVar, Union +from typing import Any, TypeAlias, Union from pydantic import Field - from pydantic_zarr.v3 import ArraySpec as ArraySpecV3 from pydantic_zarr.v3 import GroupSpec as GroupSpecV3 from pydantic_zarr.v3 import TBaseItem as TBaseItemV3 @@ -38,11 +37,8 @@ class MyGroup(GroupSpec[Any, MyMembers]) TBaseMember: TypeAlias = Mapping[str, Union["GroupSpec[Any, Any]", "ArraySpec[Any]"]] # noqa: UP040 -TAttr = TypeVar("TAttr", bound=TBaseAttr) -TMembers = TypeVar("TMembers", bound=TBaseMember) - -class GroupSpec(GroupSpecV3[TAttr, TBaseItemV3], Generic[TAttr, TMembers]): +class GroupSpec[TAttr: TBaseAttr, TMembers: TBaseMember](GroupSpecV3[TAttr, TBaseItemV3]): # The parent is parameterized at its widest member type, and TMembers (the # full members mapping, e.g. a closed TypedDict) narrows the *field*: a # legal override, since pydantic-zarr's parameters are covariant and the @@ -72,7 +68,7 @@ def _repr_html_(self) -> str: ) -class ArraySpec(ArraySpecV3[TAttr], Generic[TAttr]): +class ArraySpec[TAttr: TBaseAttr](ArraySpecV3[TAttr]): """ Zarr V3 ArraySpec with enhanced HTML representation for Jupyter/IPython. From aaad976c2978b5e865430e5baba63a2b43297db9 Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Wed, 28 Oct 2026 21:49:07 +0100 Subject: [PATCH 10/45] feat(s2-optimization)!: drive convert_s2_optimized by the plan and remove the DataTree writer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit convert_s2_optimized now validates the input store into Sentinel2Root, plans the output with plan_geozarr, and writes it with write_geozarr — metadata documents first, chunks after, root consolidation and STAC unchanged as the final step, fed by a dataset index derived from the plan. The DataTree-based write path (create_multiscale_from_datatree, generic_multiscales, stream_write_s2dataset, inject_missing_bands, the coarsening kernels and write_geo_metadata) is removed, after the plan-driven writer reproduced its stores byte for byte; s2_multiscale keeps only the declarative policy tables and the SCL vocabulary. The write policy is the plan's fixed policy (sharding on, 1024-pixel inner chunks, blosc-zstd level 3, ESA packed-integer layout): deviating option values are refused with a message naming them, the layout flags are gone from the convert-s2-optimized CLI command and ignored on the auto-detect convert path, and the CPM writer forwards only the options the S2 pipeline still interprets. The migration also widens the inputs the plan accepts, which the DataTree path tolerated and the Zarr V3 (N0512) fixtures exercise: a tree with no backing store or a non-V2 backing store is materialized to a scratch V2 store (minus its per-variable zarr storage encoding), conditions/meteorology is optional in the input model, georeferencing falls back to the product-level stac_discovery proj declaration when the band and mask arrays carry none, and numpy S dtypes map to zarr-python's null_terminated_bytes, now claimed by the GeoZarr scope. Tests: the writer tests pin plan realization and the resampling semantics against independently formulated references (the byte parity against the DataTree writer was proven before its removal); snapshot regeneration moves to the plan tests; the multiscale tests keep the encoding and end-to-end structural coverage; the geo-metadata unit tests go with the code they tested. Assisted-by: ClaudeCode:claude-fable-5 Co-Authored-By: Claude Fable 5 --- src/eopf_geozarr/cli.py | 33 +- src/eopf_geozarr/cpm/writer.py | 9 +- src/eopf_geozarr/data_api/geozarr/scope.py | 30 +- src/eopf_geozarr/data_api/s2.py | 6 +- src/eopf_geozarr/data_api/s2_plan.py | 95 +- .../s2_optimization/s2_converter.py | 299 +++-- .../s2_optimization/s2_multiscale.py | 1006 +---------------- tests/test_cpm_writer.py | 29 +- tests/test_data_api/test_s2_plan.py | 8 + tests/test_data_api/test_s2_write.py | 195 ++-- tests/test_s2_converter_simplified.py | 121 +- tests/test_s2_multiscale.py | 668 +---------- tests/test_s2_multiscale_geo_metadata.py | 424 ------- tests/test_titiler_integration.py | 8 +- 14 files changed, 488 insertions(+), 2443 deletions(-) delete mode 100644 tests/test_s2_multiscale_geo_metadata.py diff --git a/src/eopf_geozarr/cli.py b/src/eopf_geozarr/cli.py index 283b6cf5..a5d16cf6 100755 --- a/src/eopf_geozarr/cli.py +++ b/src/eopf_geozarr/cli.py @@ -220,14 +220,12 @@ def convert_command(args: argparse.Namespace) -> None: log.info( "Detected Sentinel-2 input; using optimized flat multiscale layout " "(per-group options such as --groups/--crs-groups/--gcp-group/--min-dimension " - "do not apply; pass --no-s2-optimized to force the generic path)" + "do not apply, and the layout options --spatial-chunk/--enable-sharding are " + "fixed by the S2 write policy; pass --no-s2-optimized to force the generic path)" ) dt_geozarr = convert_s2_optimized( dt_input=dt, output_path=output_path, - enable_sharding=args.enable_sharding, - spatial_chunk=args.spatial_chunk, - compression_level=3, validate_output=True, max_retries=args.max_retries, ) @@ -1395,31 +1393,8 @@ def add_s2_optimization_commands(subparsers: argparse._SubParsersAction) -> None "input_path", type=str, help="Path to input Sentinel-2 dataset (Zarr format)" ) s2_parser.add_argument("output_path", type=str, help="Path for output optimized dataset") - s2_parser.add_argument( - "--spatial-chunk", - type=int, - default=256, - help="Spatial chunk size (default: 256)", - ) - s2_parser.add_argument("--enable-sharding", action="store_true", help="Enable Zarr v3 sharding") - s2_parser.add_argument( - "--compression-level", - type=int, - default=3, - choices=range(1, 10), - help="Compression level 1-9 (default: 3)", - ) s2_parser.add_argument("--skip-validation", action="store_true", help="Skip output validation") s2_parser.add_argument("--verbose", action="store_true", help="Enable verbose output") - s2_parser.add_argument( - "--scale-offset-codec", - action="store_true", - help=( - "Pack reflectance with the Zarr scale_offset + cast_value codecs. By default it " - "is written as in the ESA product: source integers with CF " - "scale_factor/add_offset/_FillValue and STAC raster:scale/raster:offset/nodata." - ), - ) s2_parser.add_argument( "--dask-cluster", action="store_true", @@ -1444,11 +1419,7 @@ def convert_s2_optimized_command(args: argparse.Namespace) -> None: convert_s2_optimized( dt_input=dt_input, output_path=args.output_path, - enable_sharding=args.enable_sharding, - spatial_chunk=args.spatial_chunk, - compression_level=args.compression_level, validate_output=not args.skip_validation, - scale_offset_codec=args.scale_offset_codec, ) log.info("S2 optimization completed", output_path=args.output_path) diff --git a/src/eopf_geozarr/cpm/writer.py b/src/eopf_geozarr/cpm/writer.py index bda6476a..87f7628e 100644 --- a/src/eopf_geozarr/cpm/writer.py +++ b/src/eopf_geozarr/cpm/writer.py @@ -71,7 +71,7 @@ #: Default spatial chunk size per pipeline, matching the eopf-geozarr CLI. _DEFAULT_SPATIAL_CHUNK = { - "s2-optimized": 256, + "s2-optimized": 1024, "s3-olci-optimized": 1024, "generic": 4096, "generic-rechunker": 1024, @@ -255,12 +255,13 @@ def write( ) if selected_pipeline == "s2-optimized": + # The plan-driven S2 writer has a fixed write policy, so the + # layout options (enable_sharding, spatial_chunk, + # compression_level) are not forwarded; scale_offset_codec is, + # so an explicit True is refused with the policy message. return convert_s2_optimized( dt_input=dtree, output_path=output_path, - enable_sharding=enable_sharding, - spatial_chunk=resolved_spatial_chunk, - compression_level=compression_level, validate_output=validate_output, scale_offset_codec=scale_offset_codec, max_retries=max_retries, diff --git a/src/eopf_geozarr/data_api/geozarr/scope.py b/src/eopf_geozarr/data_api/geozarr/scope.py index 30741ba2..6f2cf0a4 100644 --- a/src/eopf_geozarr/data_api/geozarr/scope.py +++ b/src/eopf_geozarr/data_api/geozarr/scope.py @@ -35,6 +35,20 @@ class FixedLengthUtf32Object(TypedDict, closed=True): must_understand: NotRequired[bool] +class NullTerminatedBytesConfiguration(TypedDict, closed=True): + """The configuration of zarr-python's ``null_terminated_bytes`` data type.""" + + length_bytes: int + + +class NullTerminatedBytesObject(TypedDict, closed=True): + """``null_terminated_bytes`` data type metadata in object form.""" + + name: Literal["null_terminated_bytes"] + configuration: NullTerminatedBytesConfiguration + must_understand: NotRequired[bool] + + FIXED_LENGTH_UTF32 = DataTypeDefinition( name="fixed_length_utf32", configuration=FixedLengthUtf32Configuration, @@ -42,9 +56,21 @@ class FixedLengthUtf32Object(TypedDict, closed=True): ) """zarr-python's provisional fixed-length unicode data type (numpy's ``U``).""" +NULL_TERMINATED_BYTES = DataTypeDefinition( + name="null_terminated_bytes", + configuration=NullTerminatedBytesConfiguration, + fill_value=str, +) +"""zarr-python's provisional fixed-length bytes data type (numpy's ``S``); +the fill value is the base64 spelling of the bytes.""" + GEOZARR_SCOPE = CORE_AND_EXTENSIONS.update( - # update() replaces a slot whole, so splice the new definition in after + # update() replaces a slot whole, so splice the new definitions in after # the default scope's own data types - data_types=[*CORE_AND_EXTENSIONS.data_types.values(), FIXED_LENGTH_UTF32], + data_types=[ + *CORE_AND_EXTENSIONS.data_types.values(), + FIXED_LENGTH_UTF32, + NULL_TERMINATED_BYTES, + ], ) """The default scope plus the data types zarr-python writes that it lacks.""" diff --git a/src/eopf_geozarr/data_api/s2.py b/src/eopf_geozarr/data_api/s2.py index c86c48a7..7e0bf4da 100644 --- a/src/eopf_geozarr/data_api/s2.py +++ b/src/eopf_geozarr/data_api/s2.py @@ -6,7 +6,7 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Annotated, Any, Literal +from typing import TYPE_CHECKING, Annotated, Any, Literal, NotRequired from pydantic import BaseModel, Field from typing_extensions import TypedDict @@ -621,11 +621,13 @@ class Sentinel2ConditionsMembers(TypedDict, closed=True): """Members for conditions group. Closed TypedDict - only geometry, mask, meteorology keys are allowed. + `meteorology` is optional: not every processing baseline carries it + (e.g. the N0512 Zarr V3 products). """ geometry: Sentinel2GeometryGroup mask: Sentinel2ConditionsMaskGroup - meteorology: Sentinel2MeteorologyGroup + meteorology: NotRequired[Sentinel2MeteorologyGroup] class Sentinel2ConditionsGroup(GroupSpec[DatasetAttrs, Sentinel2ConditionsMembers]): diff --git a/src/eopf_geozarr/data_api/s2_plan.py b/src/eopf_geozarr/data_api/s2_plan.py index 04637d84..d0e58dba 100644 --- a/src/eopf_geozarr/data_api/s2_plan.py +++ b/src/eopf_geozarr/data_api/s2_plan.py @@ -67,7 +67,10 @@ from zarr_metadata.v3.codec.sharding_indexed import ShardingIndexedCodecObject from zarr_metadata.v3.codec.zstd import ZstdCodecObject - from eopf_geozarr.data_api.geozarr.scope import FixedLengthUtf32Object + from eopf_geozarr.data_api.geozarr.scope import ( + FixedLengthUtf32Object, + NullTerminatedBytesObject, + ) S2Level = Literal["L1C", "L2A"] @@ -153,6 +156,31 @@ def product_level(root: Sentinel2Root) -> S2Level: raise ValueError(msg) +def _product_proj(root: Sentinel2Root) -> tuple[tuple[float, float], int, str] | None: + """ + The product-level georeferencing, as (origin, EPSG, WKT2), from the + `proj:*` keys of `stac_discovery` `properties` — the only place the Zarr + V3 baselines (N0512) declare it. The origin is the bbox's (min-x, max-y) + corner. Returns None when any of the three is missing or malformed. + """ + properties = root.attributes.stac_discovery.get("properties") + if not isinstance(properties, dict): + return None + bbox = properties.get("proj:bbox") + code = properties.get("proj:code") + wkt2 = properties.get("proj:wkt2") + if ( + not isinstance(bbox, (list, tuple)) + or len(bbox) < 4 + or not all(isinstance(value, (int, float)) for value in bbox[:4]) + or not isinstance(code, str) + or not code.startswith("EPSG:") + or not isinstance(wkt2, str) + ): + return None + return (float(bbox[0]), float(bbox[3])), int(code.removeprefix("EPSG:")), wkt2 + + def _shard_and_inner(shape: tuple[int, ...]) -> tuple[tuple[int, ...], tuple[int, ...]]: """ The (shard, inner chunk) shapes for a band array: inner chunks of @@ -194,7 +222,7 @@ def _plan_band( def _band_array( attributes: dict[str, object], shape: tuple[int, ...], - data_type: str | FixedLengthUtf32Object, + data_type: str | FixedLengthUtf32Object | NullTerminatedBytesObject, fill_value: FillValue, dimension_names: tuple[str, ...], typesize: int, @@ -412,17 +440,26 @@ def plan_reflectance(root: Sentinel2Root) -> AnyGroupSpec: msg = "The product's reflectance group holds none of the known resolution datasets" raise ValueError(msg) - # the georeferencing of the pyramid: origin and EPSG from any finest-level band + # the georeferencing of the pyramid: origin and EPSG from any finest-level + # band, else from the product-level declaration (Zarr V3 baselines carry + # proj attributes only on stac_discovery, not on the band arrays) finest = input_levels[min(input_levels)] first_band_name = next(k for k in finest.members if k.startswith("b")) first_band_attrs: Mapping[str, object] = finest.members[first_band_name].attributes - transform = first_band_attrs["proj:transform"] - if not isinstance(transform, (list, tuple)) or len(transform) < 6: - msg = f"Band {first_band_name!r} carries no usable proj:transform" - raise ValueError(msg) - origin = (float(transform[2]), float(transform[5])) - epsg = int(first_band_attrs["proj:epsg"]) # type: ignore[call-overload] - wkt2 = str(first_band_attrs["proj:wkt2"]) + transform = first_band_attrs.get("proj:transform") + if isinstance(transform, (list, tuple)) and len(transform) >= 6: + origin = (float(transform[2]), float(transform[5])) + epsg = int(first_band_attrs["proj:epsg"]) # type: ignore[call-overload] + wkt2 = str(first_band_attrs["proj:wkt2"]) + else: + product = _product_proj(root) + if product is None: + msg = ( + f"Band {first_band_name!r} carries no usable proj:transform and the " + "product declares no stac_discovery proj georeferencing" + ) + raise ValueError(msg) + origin, epsg, wkt2 = product # per-level planned bands: name -> (source attrs, shape, dtype itemsize) planned_levels: dict[int, dict[str, DataArray]] = {} @@ -585,7 +622,7 @@ def _doc_attrs(doc: Mapping[str, Any]) -> Mapping[str, object]: return attributes -def _v3_data_type(dtype_v2: str) -> str | FixedLengthUtf32Object: +def _v3_data_type(dtype_v2: str) -> str | FixedLengthUtf32Object | NullTerminatedBytesObject: """The Zarr V3 data type of a Zarr V2 dtype string.""" parsed = np.dtype(dtype_v2) if parsed.kind == "U": @@ -593,6 +630,11 @@ def _v3_data_type(dtype_v2: str) -> str | FixedLengthUtf32Object: "name": "fixed_length_utf32", "configuration": {"length_bytes": parsed.itemsize}, } + if parsed.kind == "S": + return { + "name": "null_terminated_bytes", + "configuration": {"length_bytes": parsed.itemsize}, + } return parsed.name @@ -631,7 +673,7 @@ def _plan_carried_array(name: str, doc: _ArrayDoc, *, spatial: bool) -> DataArra return _plan_coordinate(name, shape[0]) parsed = np.dtype(str(doc["dtype"])) data_type = _v3_data_type(str(doc["dtype"])) - fill_value: FillValue = "NaN" if parsed.kind == "f" else "" if parsed.kind == "U" else 0 + fill_value: FillValue = "NaN" if parsed.kind == "f" else "" if parsed.kind in "US" else 0 attributes = _carried_array_attributes( attrs, is_float=parsed.kind == "f", @@ -717,7 +759,10 @@ def _plan_dataset(group: _GroupDoc, path: str) -> AnyGroupSpec | None: def _plan_aux_multiscale( - group: _GroupDoc, path: str, scale_levels: tuple[int, ...] + group: _GroupDoc, + path: str, + scale_levels: tuple[int, ...], + product_proj: tuple[tuple[float, float], int, str] | None = None, ) -> AnyGroupSpec: """ Plan an auxiliary multiscale group (a classification mask or the cloud @@ -742,11 +787,16 @@ def _plan_aux_multiscale( if name not in ("x", "y") } anchor = _spatial_anchor(finest_arrays) - if anchor is None: + if anchor is not None: + transform, epsg, wkt2 = _proj_of(*anchor) + origin = (transform[2], transform[5]) + elif product_proj is not None: + # Zarr V3 baselines carry no proj attributes on the mask arrays; the + # pyramid is georeferenced from the product-level declaration instead + origin, epsg, wkt2 = product_proj + else: msg = f"The {path} group's finest level carries no proj attributes" raise ValueError(msg) - transform, epsg, wkt2 = _proj_of(*anchor) - origin = (transform[2], transform[5]) planned_levels: dict[int, dict[str, DataArray]] = {} level_attributes: dict[int, SpatialGroupAttrs] = {} @@ -850,7 +900,11 @@ def _plan_aux_multiscale( return GroupSpecV3(attributes=group_attributes, members=members_out) -def _plan_subtree(group: _GroupDoc, path: str) -> AnyGroupSpec | None: +def _plan_subtree( + group: _GroupDoc, + path: str, + product_proj: tuple[tuple[float, float], int, str] | None = None, +) -> AnyGroupSpec | None: """ Plan one conditions/quality subtree: aux multiscale groups by their specs, leaf datasets carried, dropped and empty groups skipped. @@ -858,7 +912,7 @@ def _plan_subtree(group: _GroupDoc, path: str) -> AnyGroupSpec | None: if path in _DROPPED_GROUPS: return None if path in AUX_MULTISCALE_LEVELS: - return _plan_aux_multiscale(group, path, AUX_MULTISCALE_LEVELS[path]) + return _plan_aux_multiscale(group, path, AUX_MULTISCALE_LEVELS[path], product_proj) members = group.get("members") or {} subgroups = { name: member @@ -869,7 +923,7 @@ def _plan_subtree(group: _GroupDoc, path: str) -> AnyGroupSpec | None: return _plan_dataset(group, path) planned: dict[str, AnyGroupSpec] = {} for name, member in subgroups.items(): - sub = _plan_subtree(member, f"{path}/{name}") + sub = _plan_subtree(member, f"{path}/{name}", product_proj) if sub is not None: planned[name] = sub if not planned: @@ -890,11 +944,12 @@ def plan_geozarr(root: Sentinel2Root) -> AnyGroupSpec: members: dict[str, AnyGroupSpec] = { "measurements": GroupSpecV3(attributes={}, members={"reflectance": plan_reflectance(root)}), } + product_proj = _product_proj(root) for top in ("conditions", "quality"): member = root.members.get(top) if member is None: continue - planned = _plan_subtree(member.model_dump(), top) + planned = _plan_subtree(member.model_dump(), top, product_proj) if planned is not None: members[top] = planned return GroupSpecV3(attributes={}, members=members) diff --git a/src/eopf_geozarr/s2_optimization/s2_converter.py b/src/eopf_geozarr/s2_optimization/s2_converter.py index 0ab6e0f7..b7a50ddb 100644 --- a/src/eopf_geozarr/s2_optimization/s2_converter.py +++ b/src/eopf_geozarr/s2_optimization/s2_converter.py @@ -4,13 +4,17 @@ from __future__ import annotations +import tempfile import time +from collections.abc import Mapping +from pathlib import Path from typing import TYPE_CHECKING, Any, TypedDict, cast import structlog import xarray as xr import zarr from pydantic import TypeAdapter +from pydantic_zarr.v3 import is_array_spec, is_group_spec from pyproj import CRS from eopf_geozarr.conversion import utils @@ -18,11 +22,15 @@ from eopf_geozarr.conversion.geozarr import get_zarr_group from eopf_geozarr.data_api.s1 import Sentinel1Root from eopf_geozarr.data_api.s2 import Sentinel2Root +from eopf_geozarr.data_api.s2_plan import load_sentinel2 +from eopf_geozarr.data_api.s2_write import write_geozarr -from .s2_multiscale import _AUX_MULTISCALES, create_multiscale_from_datatree +from .s2_multiscale import _AUX_MULTISCALES if TYPE_CHECKING: - from collections.abc import Hashable, Mapping + from collections.abc import Hashable, Sequence + + from pydantic_zarr.v3 import AnyGroupSpec log = structlog.get_logger() @@ -135,71 +143,6 @@ def _validate_s2_input(dt_input: xr.DataTree) -> None: raise ValueError("Input dataset is not a Sentinel-2 product") -def convert_s2( - dt_input: xr.DataTree, - output_path: str, - validate_output: bool, - enable_sharding: bool, - spatial_chunk: int, -) -> xr.DataTree: - """ - Convert S2 dataset to optimized structure. - - Args: - dt_input: Input Sentinel-2 DataTree - output_path: Output path for optimized dataset - validate_output: Whether to validate the output - verbose: Enable verbose logging - - Returns: - Optimized DataTree - """ - start_time = time.time() - - log.info( - "Starting S2 optimized conversion", - num_groups=len(dt_input.groups), - output_path=output_path, - ) - - _validate_s2_input(dt_input) - - # Step 1: Process data while preserving original structure - log.info("Step 1: Processing data with original structure preserved") - - # Step 2: Create multiscale pyramids for each group in the original structure - log.info("Step 2: Creating multiscale pyramids (preserving original hierarchy)") - datasets = create_multiscale_from_datatree( - dt_input, - output_group=zarr.open_group(output_path), - spatial_chunk=spatial_chunk, - enable_sharding=enable_sharding, - ) - - log.info("Created multiscale pyramids", num_groups=len(datasets)) - - # Step 3: Root-level consolidation - log.info("Step 3: Final root-level metadata consolidation") - simple_root_consolidation(output_path, datasets, dt_input) - - # Step 4: Validation - if validate_output: - log.info("Step 4: Validating optimized dataset") - validation_results = validate_optimized_dataset(output_path) - if not validation_results["is_valid"]: - log.warning("Validation issues found", issues=validation_results["issues"]) - - # Create result DataTree - result_dt = utils.create_result_datatree(output_path) - - total_time = time.time() - start_time - log.info("Optimization complete", duration_seconds=round(total_time, 2)) - - utils.optimization_summary(dt_input, result_dt, output_path) - - return result_dt - - class ConvertS2Params(TypedDict): enable_sharding: bool spatial_chunk: int @@ -207,32 +150,48 @@ class ConvertS2Params(TypedDict): max_retries: int +#: The write policy the spec-level plan fixes; `convert_s2_optimized` refuses +#: option values that deviate from it. +_PLAN_POLICY = ( + "sharding enabled, 1024-pixel inner chunks, blosc-zstd level 3, " + "and the ESA packed-integer layout (no scale_offset codec)" +) + + def convert_s2_optimized( dt_input: xr.DataTree, *, output_path: str, - enable_sharding: bool, - spatial_chunk: int, - compression_level: int, - validate_output: bool, + enable_sharding: bool = True, + spatial_chunk: int = 1024, + compression_level: int = 3, + validate_output: bool = True, scale_offset_codec: bool = False, max_retries: int = 3, ) -> xr.DataTree: """ - Convenience function for S2 optimization. + Convert a Sentinel-2 product to the optimized GeoZarr layout. + + The conversion is plan-driven: the input store is validated into the + `Sentinel2Root` model, `plan_geozarr` derives the output hierarchy from + the model's own metadata, and `write_geozarr` writes the planned + documents first and then fills in the chunk data. The write policy is + the plan's fixed policy, so the layout options must hold their default + values; a deviating value is refused. Args: - dt_input: Input Sentinel-2 DataTree + dt_input: Input Sentinel-2 DataTree. A tree opened from a Zarr store + is read through its backing store; a tree built in memory (the + CPM SAFE reader) is first materialized to a scratch store. output_path: Output path - enable_sharding: Enable Zarr v3 sharding - spatial_chunk: Spatial chunk size - compression_level: Compression level 1-9 + enable_sharding: Must be True (the plan's policy). + spatial_chunk: Must be 1024 (the plan's policy). + compression_level: Must be 3 (the plan's policy). validate_output: Whether to validate the output - scale_offset_codec: Pack reflectance with the Zarr `scale_offset` + - `cast_value` codecs. By default it is written as in the ESA - product: packed integers with CF `scale_factor` / `add_offset` / - `_FillValue` and STAC `raster:scale` / `raster:offset` / `nodata`. - max_retries: Maximum number of retries for network operations + scale_offset_codec: Must be False: the output is written as in the + ESA product (packed integers with CF `scale_factor` / + `add_offset` / `_FillValue`). + max_retries: Accepted for compatibility; unused. Returns: Optimized DataTree @@ -245,34 +204,63 @@ def convert_s2_optimized( num_groups=len(dt_input.groups), output_path=output_path, ) + + deviations = [ + name + for name, held in ( + ("enable_sharding=False", not enable_sharding), + (f"spatial_chunk={spatial_chunk}", spatial_chunk != 1024), + (f"compression_level={compression_level}", compression_level != 3), + ("scale_offset_codec=True", scale_offset_codec), + ) + if held + ] + if deviations: + msg = ( + f"The plan-driven S2 writer has a fixed write policy ({_PLAN_POLICY}); " + f"unsupported option(s): {', '.join(deviations)}" + ) + raise ValueError(msg) + _validate_s2_input(dt_input) # Initialize CRS from dataset crs = initialize_crs_from_dataset(dt_input) - # Step 1: Process data while preserving original structure - log.info("Step 1: Processing data with original structure preserved") - - # Step 2: Create multiscale pyramids for each group in the original structure - log.info("Step 2: Creating multiscale pyramids (preserving original hierarchy)") - - output_group = zarr.open_group(output_path) + with tempfile.TemporaryDirectory() as scratch: + try: + source: zarr.Group | None = get_zarr_group(dt_input) + except TypeError: + # A tree built in memory (the CPM SAFE reader) has no backing store. + source = None + if source is not None and source.metadata.zarr_format != 2: + # The Sentinel-2 input model reads Zarr V2 EOPF products; a tree + # backed by another format goes through the same scratch copy as + # an in-memory tree (reading V3 inputs natively is a follow-up on + # the input model). + source = None + if source is None: + log.info("Materializing the input to a scratch Zarr V2 store for the plan-driven writer") + scratch_path = str(Path(scratch) / "input.zarr") + _without_zarr_storage_encoding(dt_input).to_zarr( + scratch_path, zarr_format=2, consolidated=False + ) + source = zarr.open_group(scratch_path, mode="r", zarr_format=2) - datasets = create_multiscale_from_datatree( - dt_input, - output_group=output_group, - spatial_chunk=spatial_chunk, - enable_sharding=enable_sharding, - crs=crs, - scale_offset_codec=scale_offset_codec, - ) + log.info("Step 1: Validating the input against the Sentinel-2 model") + root = load_sentinel2(source) - log.info("Created multiscale pyramids", num_groups=len(datasets)) + log.info("Step 2: Writing the planned GeoZarr hierarchy") + plan = write_geozarr(root, source, output_path) # Step 3: Root-level consolidation log.info("Step 3: Final root-level metadata consolidation") simple_root_consolidation( - output_path, datasets, dt_input, crs=crs, scale_offset_codec=scale_offset_codec + output_path, + _planned_dataset_index(plan), + dt_input, + crs=crs, + reflectance_shape=_planned_reflectance_shape(plan), ) # Step 4: Validation @@ -293,14 +281,87 @@ def convert_s2_optimized( return result_dt +#: Per-variable encoding keys that tie a variable to its source store's zarr +#: format and layout; everything else (dtype, CF packing, fill) is kept. +_ZARR_STORAGE_ENCODING_KEYS = ( + "chunks", + "preferred_chunks", + "compressor", + "compressors", + "filters", + "serializer", + "shards", +) + + +def _without_zarr_storage_encoding(dt_input: xr.DataTree) -> xr.DataTree: + """Drop the zarr storage encoding a tree read from a store carries, so the + tree can be materialized to a scratch Zarr V2 store whatever format it was + read from (a V3 `serializer`, say, is refused by a V2 write).""" + + def clean(ds: xr.Dataset) -> xr.Dataset: + for variable in ds.variables.values(): + for key in _ZARR_STORAGE_ENCODING_KEYS: + variable.encoding.pop(key, None) + return ds + + return dt_input.map_over_datasets(clean) + + +def _planned_dataset_index(plan: AnyGroupSpec) -> dict[str, tuple[str, ...] | None]: + """ + The planned dataset paths, each mapped to its data variable names (an + array that is not a coordinate or the grid mapping), with multiscale + roots mapped to None — the bookkeeping `simple_root_consolidation` reads, + matching what the DataTree writer's `processed_groups` carried. + """ + index: dict[str, tuple[str, ...] | None] = {} + + def walk(spec: AnyGroupSpec, path: str) -> None: + attributes = spec.attributes + if path and isinstance(attributes, Mapping) and "multiscales" in attributes: + index[path] = None + names = tuple( + name + for name, member in spec.members.items() + if is_array_spec(member) + and name != "spatial_ref" + and (member.dimension_names or ()) != (name,) + ) + if names: + index[path] = names + for name, member in spec.members.items(): + if is_group_spec(member): + walk(member, f"{path}/{name}") + + walk(plan, "") + return index + + +def _planned_reflectance_shape(plan: AnyGroupSpec) -> tuple[int, ...] | None: + """The (rows, cols) of the finest planned reflectance level, if present.""" + level = plan.get_path("measurements/reflectance/r10m") + if not is_group_spec(level): + return None + for member in level.members.values(): + if is_array_spec(member) and len(member.shape) == 2: + return tuple(member.shape) + return None + + def simple_root_consolidation( output_path: str, - datasets: Mapping[str, object], + datasets: Mapping[str, Sequence[str] | None], dt_input: xr.DataTree | None = None, crs: CRS | None = None, - scale_offset_codec: bool = False, + reflectance_shape: tuple[int, ...] | None = None, ) -> None: - """Simple root-level metadata consolidation with proper zarr group creation.""" + """Simple root-level metadata consolidation with proper zarr group creation. + + `datasets` maps every written dataset group path to its data variable + names (multiscale roots map to None), and `reflectance_shape` is the + finest reflectance level's (rows, cols) for the STAC asset's proj:shape. + """ # create missing intermediary groups (/conditions, /quality, etc.) # using the keys of the datasets dict @@ -369,9 +430,8 @@ def simple_root_consolidation( if crs is not None and crs.to_epsg() is not None: reflectance_asset.update(utils.proj_attrs_for_crs(crs)) - base = datasets.get("/measurements/reflectance/r10m") - if isinstance(base, xr.Dataset): - reflectance_asset["proj:shape"] = [base.sizes["y"], base.sizes["x"]] + if reflectance_shape is not None: + reflectance_asset["proj:shape"] = list(reflectance_shape) stac.setdefault("assets", {})["reflectance"] = reflectance_asset @@ -393,7 +453,7 @@ def simple_root_consolidation( def add_multiscale_pyramids_to_stac_metadata( - datasets: Mapping[str, object], dt_attributes: dict[Hashable, Any] + datasets: Mapping[str, Sequence[str] | None], dt_attributes: dict[Hashable, Any] ) -> dict[Hashable, Any]: stac_attrs = dt_attributes.get("stac_discovery", {}).get("assets") if not stac_attrs: @@ -402,24 +462,17 @@ def add_multiscale_pyramids_to_stac_metadata( # a bit messy but effective split to get group parent from stac attrs existing_group_paths = {"/".join(v["href"].split("/")[:-1]) for v in stac_attrs.values()} - # gEt mismatched ones -> we need pyramids not present - missing_group_paths = [ - path for path, ds in datasets.items() if path not in existing_group_paths and ds is not None - ] - - for group_path in missing_group_paths: - ds = datasets[group_path] - - # catch object != datAset for typing - if isinstance(ds, xr.Dataset): - resolution = group_path.rsplit("/", 1)[-1] # "r120m" - for var_name in ds.data_vars: - if var_name == "spatial_ref": - continue - asset_key = f"{var_name}_{resolution}" - stac_attrs[asset_key] = {"href": f"{group_path}/{var_name}", "title": asset_key} - else: - log.warning("Found non-dataset object in datasets!", dataset=ds) + for group_path, var_names in datasets.items(): + # datasets the input's own assets reference need no new entries, and + # multiscale roots (mapped to None) hold no variables of their own + if group_path in existing_group_paths or var_names is None: + continue + resolution = group_path.rsplit("/", 1)[-1] # "r120m" + for var_name in var_names: + if var_name == "spatial_ref": + continue + asset_key = f"{var_name}_{resolution}" + stac_attrs[asset_key] = {"href": f"{group_path}/{var_name}", "title": asset_key} return dt_attributes diff --git a/src/eopf_geozarr/s2_optimization/s2_multiscale.py b/src/eopf_geozarr/s2_optimization/s2_multiscale.py index 4d1f8df4..fa9da8df 100644 --- a/src/eopf_geozarr/s2_optimization/s2_multiscale.py +++ b/src/eopf_geozarr/s2_optimization/s2_multiscale.py @@ -1,43 +1,24 @@ """ -Streaming multiscale pyramid creation for optimized S2 structure. -Uses lazy evaluation to minimize memory usage during dataset preparation. +The Sentinel-2 multiscale policy tables. + +This module holds the declarative side of the S2 multiscale layout: which +groups get a pyramid (`REFLECTANCE_MULTISCALE`, `_AUX_MULTISCALES`), at which +scale levels, and the SCL flag vocabulary. The pyramids themselves are planned +by `eopf_geozarr.data_api.s2_plan` and written by +`eopf_geozarr.data_api.s2_write`; the former DataTree-based write path was +removed once the plan-driven writer reproduced its stores byte for byte. """ from __future__ import annotations from dataclasses import dataclass from enum import StrEnum -from itertools import pairwise -from typing import TYPE_CHECKING, Any, Literal, cast +from typing import TYPE_CHECKING, Any -import numpy as np -import rasterio.transform -import rioxarray # noqa: F401 # enables the .rio accessor -import structlog -import xarray as xr -import zarr -from affine import Affine -from pyproj import CRS -from zarr_cm import LayoutObject, MultiscalesAttrs, SpatialAttrs, Transform - -from eopf_geozarr.conversion import encoding_utils, utils -from eopf_geozarr.conversion.constants import ZARR_FORMAT -from eopf_geozarr.conversion.fs_utils import sanitize_dataset_attributes from eopf_geozarr.cpm.routing import product_type_of -from eopf_geozarr.s2_optimization import s2_resampling -from eopf_geozarr.s2_optimization.common import DISTRIBUTED_AVAILABLE -from eopf_geozarr.s2_optimization.s2_band_mapping import BAND_INFO - -from .s2_resampling import determine_variable_type if TYPE_CHECKING: - from zarr.core.common import JSON - from zarr_cm import spatial as spatial_cm - - from eopf_geozarr.data_api.geozarr.types import ( - XarrayDataArrayEncoding, - ) - + import xarray as xr SCL_VALUES = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] SCL_LABELS = [ @@ -62,17 +43,6 @@ SCL_NODATA = SCL_VALUES[SCL_LABELS.index("NO_DATA")] -def _declare_scl_nodata(dataset: xr.Dataset) -> xr.Dataset: - """Set the SCL NO_DATA class as `_FillValue` when the source declares no nodata value. - - Not all products declare one on SCL (e.g. Zarr v2 products and the r60m SCL of - Zarr v3 products), but some clients require a CF `_FillValue`. - """ - if "scl" in dataset.data_vars and encoding_utils.find_fill_value(dataset["scl"]) is None: - dataset["scl"].encoding["_FillValue"] = SCL_NODATA - return dataset - - class S2Type(StrEnum): L1C = "L1C" L2A = "L2A" @@ -95,12 +65,9 @@ def from_datatree(cls, dt: xr.DataTree) -> S2Type | None: return cls.from_filename(product_type_of(dt)) or cls.from_filename(dt.name) -log = structlog.get_logger() - - @dataclass(frozen=True) class MultiscaleSpec: - """A group that gets a multiscale pyramid, as input to `generic_multiscales`.""" + """A group that gets a multiscale pyramid.""" base_path: str """Group holding the pyramid levels, e.g. `/measurements/reflectance`.""" @@ -128,7 +95,7 @@ def applies_to(self, s2_type: S2Type | None) -> bool: scale_levels=(10, 20, 60, 120, 360, 720), ) -# Auxiliary (non-reflectance) groups. Groups missing from the input are skipped with a warning. +# Auxiliary (non-reflectance) groups. Groups missing from the input are skipped. _AUX_MULTISCALES: tuple[MultiscaleSpec, ...] = ( MultiscaleSpec( base_path="/conditions/mask/l2a_classification", @@ -146,952 +113,3 @@ def applies_to(self, s2_type: S2Type | None) -> bool: scale_levels=(60, 120, 360, 720), ), ) - -MultiscalesFlavor = Literal["experimental_multiscales_convention"] - - -def _transform_from_coordinates( - dataset: xr.Dataset, -) -> tuple[float, float, float, float, float, float] | None: - """Construct an affine transform from dataset coordinates when possible.""" - if "x" not in dataset.coords or "y" not in dataset.coords: - return None - - x_coords = dataset.coords["x"].values - y_coords = dataset.coords["y"].values - if len(x_coords) < 2 or len(y_coords) < 2: - return None - - pixel_size_x = float(np.abs(x_coords[1] - x_coords[0])) - pixel_size_y = float(np.abs(y_coords[1] - y_coords[0])) - # Coordinates are pixel centres; the transform origin is the outer pixel edge. - x_min = float(x_coords.min()) - pixel_size_x / 2 - y_max = float(y_coords.max()) + pixel_size_y / 2 - return (pixel_size_x, 0.0, x_min, 0.0, -pixel_size_y, y_max) - - -def _bbox_from_coordinates(dataset: xr.Dataset) -> list[float]: - """Outer pixel edges ``[xmin, ymin, xmax, ymax]`` of the dataset's x/y grid. - - Falls back to the coordinate extent when the grid has fewer than two pixels - along an axis, because the pixel size is then unknown. - """ - transform = _transform_from_coordinates(dataset) - if transform is None: - x_coords = dataset.coords["x"].values - y_coords = dataset.coords["y"].values - return [ - float(x_coords.min()), - float(y_coords.min()), - float(x_coords.max()), - float(y_coords.max()), - ] - - pixel_size_x, _, x_min, _, neg_pixel_size_y, y_max = transform - x_max = x_min + dataset.sizes["x"] * pixel_size_x - y_min = y_max + dataset.sizes["y"] * neg_pixel_size_y - return [x_min, y_min, x_max, y_max] - - -def _rio_transform_matches_coordinates( - transform: tuple[float, float, float, float, float, float] | None, - coordinate_transform: tuple[float, float, float, float, float, float] | None, -) -> bool: - """Check whether rio-derived metadata matches the current x/y grid.""" - if transform is None or coordinate_transform is None: - return False - - return all(np.isclose(a, b) for a, b in zip(transform, coordinate_transform, strict=False)) - - -def _preferred_spatial_transform( - dataset: xr.Dataset, -) -> tuple[float, float, float, float, float, float] | None: - """Prefer rio metadata only when it matches the current coordinate grid.""" - coordinate_transform = _transform_from_coordinates(dataset) - rio_transform: tuple[float, float, float, float, float, float] | None = None - - if hasattr(dataset, "rio") and hasattr(dataset.rio, "transform"): - try: - rio_value = dataset.rio.transform - if callable(rio_value): - rio_value = rio_value() - # rio transform value is dynamically typed; it is iterable at runtime. - rio_iter = cast("tuple[float, ...]", tuple(rio_value)) # pyright: ignore[reportArgumentType] - rio_values = tuple(float(value) for value in rio_iter[:6]) - if len(rio_values) == 6: - rio_transform = ( - rio_values[0], - rio_values[1], - rio_values[2], - rio_values[3], - rio_values[4], - rio_values[5], - ) - except (AttributeError, TypeError, ValueError): - rio_transform = None - - if ( - rio_transform is not None - and not all(value == 0 for value in rio_transform) - and _rio_transform_matches_coordinates(rio_transform, coordinate_transform) - ): - return rio_transform - - return coordinate_transform or rio_transform - - -def _spatial_level_attrs(dataset: xr.Dataset) -> dict[str, list[float] | list[int]]: - """`spatial:shape` and `spatial:transform` for a multiscales layout entry. - - `write_geo_metadata` leaves out an all-zero transform, but the minispec requires - `spatial:transform` on every layout entry, so fall back to the coordinate grid. - """ - transform = dataset.attrs.get("spatial:transform") - if transform is None: - transform = list(_preferred_spatial_transform(dataset) or ()) - return {"spatial:shape": dataset.attrs["spatial:shape"], "spatial:transform": transform} - - -def _coarsen_variable(var_name: str, var_data: xr.DataArray, factor: int) -> xr.DataArray: - """Coarsen a single variable using type-aware resampling. - - Dispatches to the appropriate coarsen reduction (mean, max, subsample) - based on `determine_variable_type`. Preserves encoding and dtype. - """ - var_type = determine_variable_type(var_name) - - coarsened = var_data.coarsen({"x": factor, "y": factor}, boundary="trim") - if var_type in ("reflectance", "probability"): - if np.issubdtype(var_data.dtype, np.floating): - # Decoded values: nodata is NaN, so skipping NaN excludes it from the mean. - result = coarsened.mean(skipna=True) # type: ignore[attr-defined] - else: - # Raw integers: mask nodata, average, and round before the integer cast - # (a plain cast truncates). - fill_value = encoding_utils.find_fill_value(var_data) - if fill_value is None: - result = coarsened.mean().round() # type: ignore[attr-defined] - else: - result = ( - var_data.where(var_data != fill_value) - .coarsen({"x": factor, "y": factor}, boundary="trim") - .mean(skipna=True) # type: ignore[attr-defined] - .round() - .fillna(fill_value) - ) - elif var_type == "classification": - result = coarsened.reduce(subsample_2) - else: - raise ValueError(f"Unknown/Unapplicable variable type {var_type}") - - # `xr.DataArray.astype` clears `.encoding`, so we capture it first and - # restore it on the cast result. Without this, downstream code that - # inspects encoding (e.g. to push CF scale-offset into a codec pipeline) - # would see an empty encoding on every coarsened level. - # The attributes can carry the CF packing (ESA layout), so keep them too: - # `where` and the arithmetic above do not always do so. - encoding = var_data.encoding - cast_result: xr.DataArray = result.astype(var_data.dtype) - cast_result.encoding = encoding - cast_result.attrs = dict(var_data.attrs) - return cast_result - - -def inject_missing_bands( - dataset: xr.Dataset, - dt_input: xr.DataTree, - target_resolution: int, - spatial_chunk: int, - *, - bands: set[str] | None = None, - scale_offset_codec: bool = False, -) -> xr.Dataset: - """Inject bands whose native resolution is finer than `target_resolution`. - - For each spectral band defined in `BAND_INFO` whose native resolution is - finer than `target_resolution`, this function checks whether the band is - already present in `dataset`. If not, it looks for the band in the - appropriate source group (e.g. `/measurements/reflectance/r10m`), - downsamples it by the coarsening operation aligned to ESA's S2-PDGS-MPC-ATBD-L2A - (block-mean), and merges it into `dataset`. - - Args: - dataset: The target-resolution dataset (e.g. the r20m or r60m - reflectance group). - dt_input: The full input DataTree (used to locate finer-resolution - source bands). - target_resolution: Target resolution in metres (e.g. 20 or 60). - spatial_chunk: Spatial chunk size - bands: If provided, only inject these band names. If `None` - (default), inject every eligible band from `BAND_INFO`. - scale_offset_codec: Encoding mode (see `normalize_packed`). It selects - the form of the injected packed bands: decoded float32 for the - Zarr codecs, packed integers for the ESA layout. - - Returns: - `dataset` with any missing finer-resolution bands added. - """ - for band_name, info in BAND_INFO.items(): - if bands is not None and band_name not in bands: - continue - native_res = info.native_resolution # type: ignore[attr-defined] - if native_res >= target_resolution: - continue - if band_name in dataset.data_vars: - continue - - source_path = f"/measurements/reflectance/r{native_res}m" - if source_path not in dt_input.groups: - continue - - source_ds = dt_input[source_path].to_dataset() - - if band_name not in source_ds.data_vars: - continue - - band_src = source_ds[band_name] - packing = encoding_utils.packing_of(band_src) - if packing is not None: - # Use the form of the encoding mode, so the injected band has the same - # dtype as the other bands and the mean skips nodata in both input forms. - band_src = encoding_utils.normalize_packed( - band_src, packing, scale_offset_codec=scale_offset_codec - ) - factor = target_resolution // native_res - band_ds = _coarsen_variable(band_name, band_src, factor) - - # Replace coordinates with the target dataset's coordinates so that - # xarray.Dataset.assign does not try to align on mismatched values. - band_ds = xr.DataArray( - band_ds.values, - dims=band_ds.dims, - coords={d: dataset.coords[d] for d in band_ds.dims if d in dataset.coords}, - attrs=band_src.attrs, - name=band_name, - ) - - # Preserve source encoding so downstream encoding logic can inspect it - band_ds.encoding = band_src.encoding.copy() - - dataset = dataset.assign({band_name: band_ds}) - log.info( - "Injected downsampled band from finer resolution", - band=band_name, - source=f"r{native_res}m", - target=f"r{target_resolution}m", - shape=band_ds.shape, - ) - - return utils._rechunk_ds(dataset, spatial_chunk) - - -def select_unique_variable_type(ds: xr.Dataset) -> str: - variable_types = { - s2_resampling.determine_variable_type(str(data_var)) for data_var in ds.data_vars - } - if len(variable_types) > 1: - err_msg = f"The given dataset contains multiple data variable types: {variable_types}. It is not possible to map them to a single variable type." - raise ValueError(err_msg) - - return next(iter(variable_types)) - - -def generic_multiscales( - spec: MultiscaleSpec, - src_processed_groups: dict[str, Any], - output_group: zarr.Group, - enable_sharding: bool = True, - crs: CRS | None = None, - scale_offset_codec: bool = False, - spatial_chunk: int = 1024, -) -> dict[str, Any]: - base_path, scale_levels = spec.base_path, spec.scale_levels - finest_dataset_key = spec.finest_key - additional_attributes = spec.additional_attributes - # Create downsampled resolution groups - if finest_dataset_key not in src_processed_groups: - raise KeyError( - f"The given `finest_dataset_key` {finest_dataset_key} is not present in `src_processed_groups` {list(src_processed_groups.keys())} which is required for the correct calculation of multiscales." - ) - - # iterate over pre-defined pyramid-dict (or smth) and generate layout data -> use LayoutObject/... - current_level_name: str = finest_dataset_key - fine_base: xr.Dataset = src_processed_groups[finest_dataset_key] - - # determine variable type and subsequent resampling method for MS layout - variable_type = select_unique_variable_type(fine_base) - resampling_method = ( - "average" - if variable_type in ("reflectance", "probability") - else "nearest" - if variable_type == "classification" - else None - ) - - # only accept ('reflectance', 'probability', or 'classification') which arr covered by determine_variable_type(..) loudly fail for other input types, as they are not safely implemented yet - if resampling_method is None: - raise ValueError( - f"resampling method for MS generation is derived from variable_type {variable_type} and didnt match any from ('reflectance', 'probability', or 'classification')" - ) - - spatial_levels: dict[str, dict[str, list[float] | list[int]]] = { - finest_dataset_key: _spatial_level_attrs(fine_base) - } - - # predefined layout asset - layout_: list[dict[str, Any]] = [ - { - "asset": finest_dataset_key, - **spatial_levels[finest_dataset_key], - } - ] - - dst_processed_groups: dict[str, Any] = {f"{base_path}/{finest_dataset_key}": fine_base} - - # iterate over source, dest pairs: (60, 120), (120, 360), ... - for source_level, dest_level in pairwise(scale_levels): - src_level_name = f"r{source_level}m" - src_level_path = f"{base_path}/{src_level_name}" - - dest_level_name = f"r{dest_level}m" - dest_level_path = f"{base_path}/{dest_level_name}" - - # each step must be an exact integer factor (20->60 = 3, 60->120 = 2, ...) - if dest_level % source_level: - raise ValueError(f"{dest_level} m is not an integer multiple of {source_level} m") - downsample_factor = dest_level // source_level - - if dest_level_name in src_processed_groups: - # reuse the native group (e.g. reflectance r20m/r60m), no coarsening needed. - # Fails loudly afterwards if its geo metadata is missing. - ds_out = src_processed_groups[dest_level_name] - - # Store results - dst_processed_groups[dest_level_path] = ds_out - else: - source_ds = ( - src_processed_groups[src_level_name] - if src_level_name in src_processed_groups - else dst_processed_groups[src_level_path] - ) - - log.info("Creating level with resolution", level=dest_level_name, resolution=dest_level) - - # Create downsampled dataset by coarsening, then rechunk - # uniformly before deriving the encoding: coarsening divides - # whatever dask chunks the source happens to have, which - # previously leaked incidental chunk shapes into the stored - # encoding (inner chunks of 915, 512 and 1830 for like levels). - downsampled_dataset = utils._rechunk_ds( - create_downsampled_resolution_group(source_ds, factor=downsample_factor), - spatial_chunk, - ) - - log.info("Writing level to path", level=dest_level_name, output_path=dest_level_path) - - # Create encoding - encoding = utils.create_uniform_encoding( - downsampled_dataset, - enable_sharding=enable_sharding, - scale_offset_codec=scale_offset_codec, - ) - - # add geo metadata - write_geo_metadata(downsampled_dataset, crs=crs) - - # Write dataset - ds_out = stream_write_s2dataset( - downsampled_dataset, - path=dest_level_path, - group=output_group, - encoding=encoding, - enable_sharding=enable_sharding, - crs=crs, - ) - - # Store results - dst_processed_groups[dest_level_path] = ds_out - - # determine multiscale metadata for all datasets - spatial_levels[dest_level_path] = _spatial_level_attrs(ds_out) - - # Nominal factor (ratio of pixel spacings), not the ratio of shapes: boundary="trim" - # gives e.g. 305 -> 152 px at r720m. Intentional, see #313. - transform: Transform = { - "scale": [downsample_factor, downsample_factor], - "translation": [0.0, 0.0], - } - lo = { - "asset": dest_level_name, - "derived_from": current_level_name, - "transform": transform, - **spatial_levels[dest_level_path], - } - - layout_.append(lo) - - current_level_name = dest_level_name - - # Step 3: Add multiscales metadata to parent groups - log.info("Adding multiscales metadata to parent groups") - - # Get the parent group (it was created when writing the resolution groups). - # `output_group[base_path]` is typed `Array | Group`; `base_path` always - # addresses a group (the reflectance parent), so verify that at runtime. - parent_group = output_group[base_path] - if not isinstance(parent_group, zarr.Group): - raise TypeError( - f"expected a zarr.Group at {base_path!r}, got {type(parent_group).__name__}" - ) - - # LayoutObject is a TypedDict (no validation); zarr_cm validates in build_convention_attrs - layout: list[LayoutObject] = [LayoutObject(**lo) for lo in layout_] - ms: MultiscalesAttrs = {"layout": layout, "resampling_method": resampling_method} - - # add geozarr attrs to base of /multiscales - fine_base_spatial = grid_spatial_attrs( - transform=Affine(*spatial_levels[finest_dataset_key]["spatial:transform"]), - shape=(fine_base.sizes["y"], fine_base.sizes["x"]), - ) - - conv = utils.build_convention_attrs(multiscales=ms, spatial=fine_base_spatial, crs=crs) - parent_group.attrs.update(cast("dict[str, JSON]", conv)) - - # Add `additional_attributes` to every level in one place. The finest level and - # levels reused from the source were written before this function ran, so the - # arrays on disk are updated as well as the in-memory datasets. - if additional_attributes is not None: - for level_path, level_ds in dst_processed_groups.items(): - for data_var in level_ds.data_vars: - level_ds[data_var].attrs.update(additional_attributes) - level_array = output_group[f"{level_path.lstrip('/')}/{data_var}"] - level_array.attrs.update(cast("dict[str, JSON]", additional_attributes)) - - # add it as none here to be recognized later and can be created as a zarr root with necessary metadata - dst_processed_groups[base_path] = None - - return dst_processed_groups - - -def grid_spatial_attrs(transform: Affine, shape: tuple[int, int]) -> SpatialAttrs: - """Spatial-convention data for a regular grid with an affine *transform*. - - *shape* is ``(height, width)``. Emits ``spatial:dimensions`` ``["y","x"]``, - pixel registration, the bounding box, and the 6-element row-major affine - transform. - """ - height, width = shape - left, bottom, right, top = rasterio.transform.array_bounds(height, width, transform) - return { - "spatial:dimensions": ["y", "x"], - "spatial:registration": "pixel", - "spatial:bbox": [float(left), float(bottom), float(right), float(top)], - "spatial:transform": [ - float(transform.a), - float(transform.b), - float(transform.c), - float(transform.d), - float(transform.e), - float(transform.f), - ], - } - - -def create_multiscale_from_datatree( - dt_input: xr.DataTree, - *, - output_group: zarr.Group, - enable_sharding: bool, - spatial_chunk: int, - crs: CRS | None = None, - scale_offset_codec: bool = False, -) -> dict[str, dict]: - """ - Create multiscale versions preserving original structure. - Keeps all original groups, adds r120m, r360m, r720m downsampled versions. - - Args: - dt_input: Input DataTree with original structure - output_path: Base output path - enable_sharding: Enable Zarr v3 sharding - spatial_chunk: Spatial chunk size - crs: Coordinate Reference System for datasets - scale_offset_codec: Pack packed variables with the Zarr scale-offset - codecs. By default they are written with CF attributes, as in the - ESA product. - - Returns: - Dictionary of processed groups - """ - processed_groups: dict[str, Any] = {} - # The scale levels in the output data. 10, 20, 60 already exist in the source data. - - s2_type = S2Type.from_datatree(dt_input) - if s2_type is None: - log.warning( - "Could not determine S2 product level (L1C/L2A); no bands are injected", - product_type=product_type_of(dt_input), - name=dt_input.name, - ) - - # Step 1: Copy all original groups as-is - for group_path in dt_input.groups: - if group_path == ".": - continue - - # Skip the quicklook groups (`/quality/l1c_quicklook`, `/quality/l2a_quicklook`). - # They duplicate RGB data that downstream consumers can derive from the - # reflectance bands, so dropping them shrinks the output store and - # speeds up conversion. See EOPF-Explorer/data-model#81. - if group_path.startswith(("/quality/l1c_quicklook", "/quality/l2a_quicklook")): - log.info("Skipping quicklook group", group_path=group_path) - continue - - group_node = dt_input[group_path] - - # Skip parent groups that have children (only process leaf groups) - if hasattr(group_node, "children") and len(group_node.children) > 0: - continue - - base_dataset = group_node.to_dataset() - - # Skip empty groups - if not base_dataset.data_vars: - log.info("Skipping empty group", group_path=group_path) - continue - - log.info("Copying original group", group_path=group_path) - - dataset = _declare_scl_nodata(utils._rechunk_ds(base_dataset, spatial_chunk)) - - # Determine if this is a measurement-related resolution group - group_name = group_path.split("/")[-1] - is_measurement_group = ( - group_name.startswith("r") - and group_name.endswith("m") - and "/measurements/" in group_path - ) - - if is_measurement_group: - # Inject bands whose native resolution is finer than this group's - # (e.g. b08 native at 10m into r20m/r60m) so they propagate through - # the full overview chain (r120m … r720m). - if group_path.startswith("/measurements/reflectance/"): - try: - group_resolution = int(group_name[1:-1]) - except ValueError: - group_resolution = 0 - - # just add the b08 band - if s2_type == "L2A": - if group_resolution > 10: - dataset = inject_missing_bands( - dataset, - dt_input, - group_resolution, - spatial_chunk, - scale_offset_codec=scale_offset_codec, - bands={"b08"}, - ) - - # add all lower level bands here! - elif s2_type == "L1C": - if group_resolution == 20: - dataset = inject_missing_bands( - dataset, - dt_input, - group_resolution, - spatial_chunk, - scale_offset_codec=scale_offset_codec, - bands={ - "b02", - "b03", - "b04", - "b08", - }, - ) - elif group_resolution == 60: - dataset = inject_missing_bands( - dataset, - dt_input, - group_resolution, - spatial_chunk, - scale_offset_codec=scale_offset_codec, - bands={ - "b02", - "b03", - "b04", - "b08", - "b05", - "b06", - "b07", - "b8a", - "b11", - "b12", - }, - ) - - # Measurement groups: apply custom encoding - encoding = utils.create_uniform_encoding( - dataset, - enable_sharding=enable_sharding, - scale_offset_codec=scale_offset_codec, - ) - # convert float64 arrays to float32. `xr.DataArray.astype` clears - # encoding, so we capture and restore it — downstream pyramid - # levels are coarsened from this dataset and rely on the encoding - # to drive CF packing / codec filter generation. - for data_var in dataset.data_vars: - if dataset[data_var].dtype in (np.dtype("f8")): - var_encoding = dataset[data_var].encoding - dataset[data_var] = dataset[data_var].astype("float32") - dataset[data_var].encoding = var_encoding - else: - # Non-measurement groups: preserve original encoding - encoding = utils.create_uniform_encoding( - dataset, - enable_sharding=enable_sharding, - scale_offset_codec=scale_offset_codec, - ) - - # Drop scalar (0-D) coordinates such as a source `band` label: the - # minispec's DataArray rules forbid scalar arrays in a GeoZarr dataset. - scalar_coords = [name for name, coord in dataset.coords.items() if coord.ndim == 0] - if scalar_coords: - dataset = dataset.drop_vars(scalar_coords) - for name in scalar_coords: - encoding.pop(str(name), None) - - ds_out = stream_write_s2dataset( - dataset, - path=group_path, - group=output_group, - encoding=encoding, - enable_sharding=enable_sharding, - crs=crs, - ) - processed_groups[group_path] = ds_out - - # iterate over auxiliary multisacles to generate non-measurement MS - for aux in _AUX_MULTISCALES: - if not aux.applies_to(s2_type): - continue - base_path, finest_key = aux.base_path, aux.finest_key - src_path = f"{base_path}/{finest_key}" - # Not every processing baseline carries every auxiliary group: skip, don't fail. - if src_path not in processed_groups: - log.warning( - "Skipping S2 auxiliary multiscales: source group missing from input", - base_path=base_path, - src_path=src_path, - product_level=s2_type, - ) - continue - - log.info("Adding multiscales for S2 auxiliary group", base_path=base_path) - processed_groups.update( - generic_multiscales( - aux, - src_processed_groups={finest_key: processed_groups[src_path]}, - output_group=output_group, - enable_sharding=enable_sharding, - crs=crs, - scale_offset_codec=scale_offset_codec, - spatial_chunk=spatial_chunk, - ) - ) - - # generate multiscales for "/measurements/reflectance" from its native r10m/r20m/r60m levels - reflectance_path = REFLECTANCE_MULTISCALE.base_path - log.info("Adding multiscales for S2 reflectance", base_path=reflectance_path) - measurement_processed_groups: dict[str, Any] = { - key: processed_groups[f"{reflectance_path}/{key}"] for key in ("r10m", "r20m", "r60m") - } - ms_measurement_processed_groups = generic_multiscales( - REFLECTANCE_MULTISCALE, - src_processed_groups=measurement_processed_groups, - output_group=output_group, - enable_sharding=enable_sharding, - crs=crs, - scale_offset_codec=scale_offset_codec, - spatial_chunk=spatial_chunk, - ) - - # update processed groups with multiscale included groups, old instances of dataset are replaced, - # which is no issue as they were not touched - processed_groups.update(ms_measurement_processed_groups) - - return processed_groups - - -def calculate_aligned_chunk_size(dimension_size: int, target_chunk: int) -> int: - """ - Calculate aligned chunk size following geozarr.py logic. - - This ensures good chunk alignment without complex calculations. - """ - if target_chunk >= dimension_size: - return dimension_size - - # Find the largest divisor of dimension_size that's close to target_chunk - best_chunk = target_chunk - for chunk_candidate in range(target_chunk, max(target_chunk // 2, 1), -1): - if dimension_size % chunk_candidate == 0: - best_chunk = chunk_candidate - break - - return best_chunk - - -def calculate_simple_shard_dimensions( - data_shape: tuple[int, ...], chunks: tuple[int, ...] -) -> tuple[int, ...]: - """ - Calculate shard dimensions that are compatible with chunk dimensions. - - Shard dimensions must be evenly divisible by chunk dimensions for Zarr v3. - When possible, shards should match x/y dimensions exactly as required. - """ - shards = [] - - for i, (dim_size, chunk_size) in enumerate(zip(data_shape, chunks, strict=False)): - if i == 0 and len(data_shape) == 3: - # First dimension in 3D data (time) - use single time slice per shard - shards.append(1) - else: - # For x/y dimensions, try to use full dimension size - # But ensure it's divisible by chunk size - if dim_size % chunk_size == 0: - # Perfect: full dimension is divisible by chunk - shards.append(dim_size) - else: - # Find the largest multiple of chunk_size that fits - num_chunks = dim_size // chunk_size - if num_chunks > 0: - shard_size = num_chunks * chunk_size - shards.append(shard_size) - else: - # Fallback: use chunk size itself - shards.append(chunk_size) - - return tuple(shards) - - -def create_downsampled_resolution_group(source_dataset: xr.Dataset, factor: int) -> xr.Dataset: - """Create a downsampled version of a dataset by given factor.""" - if not source_dataset or len(source_dataset.data_vars) == 0: - return xr.Dataset() - - # Get reference dimensions - ref_var = next(iter(source_dataset.data_vars.values())) - if ref_var.ndim < 2: - return xr.Dataset() - - current_height, current_width = ref_var.shape[-2:] - target_height = current_height // factor - target_width = current_width // factor - - if target_height < 1 or target_width < 1: - return xr.Dataset() - - # Downsample all variables using existing lazy operations - lazy_vars = {} - for var_name, var_data in source_dataset.data_vars.items(): - if var_data.ndim < 2: - continue - lazy_vars[var_name] = _coarsen_variable(str(var_name), var_data, factor) - - if not lazy_vars: - return xr.Dataset() - - # Create dataset with lazy variables and coordinates - return xr.Dataset(lazy_vars, attrs=source_dataset.attrs) - - -def subsample_2(a: xr.DataArray, axis: tuple[int, ...] | None = None) -> xr.DataArray: - """Pick the centre pixel of each coarsening window (nearest-neighbour). - - `coarsen` places the output coordinates at the window centres, so the - centre pixel keeps classification aligned with the averaged bands. For an - even window there is no single centre pixel and the lower-right one of the - middle four is taken. - """ - if axis is None: - axis = tuple(range(a.ndim)) - indexer = [a.shape[i] // 2 if i in axis else slice(None) for i in range(a.ndim)] - return a[tuple(indexer)] - - -def stream_write_s2dataset( - dataset: xr.Dataset, - *, - path: str, - group: zarr.Group, - encoding: dict[str, XarrayDataArrayEncoding], - enable_sharding: bool, - crs: CRS | None = None, -) -> xr.Dataset: - """ - Stream write a lazy dataset with advanced chunking and sharding. - - This is where the magic happens: all the lazy downsampling operations - are executed as the data is streamed to storage with optimal performance. - - Args: - dataset: Dataset to write - dataset_path: Output path for dataset - encoding: Encoding dictionary for variables - enable_sharding: Enable Zarr v3 sharding - crs: Coordinate Reference System for geographic metadata - - Returns: - Written dataset - """ - # Check if level already exists - if path in group: - log.info( - "Level path {} already exists. Skipping write.", - dataset_path=path, - ) - # The zarr backend accepts a zarr `Store` here at runtime, but xarray's - # `open_dataset` stub only types the first arg as path/buffer/datastore. - return xr.open_dataset( - group.store, # type: ignore[arg-type] - engine="zarr", - chunks={}, - decode_coords="all", - group=path, - ) - - log.info("Streaming computation and write to {}", dataset_path=path) - log.info("Variables", variables=list(dataset.data_vars.keys())) - - # Rechunk dataset to align with encoding - dataset = utils.rechunk_dataset_for_encoding(dataset, encoding) - - # Add the geo metadata before writing for - # - /measurements/ groups - # - /quality/ groups - # - /consitions/mask groups - if "/measurements/" in path or "/quality/" in path or "/conditions/mask" in path: - write_geo_metadata(dataset, crs=crs) - - # Sanitize NaN values in dataset attributes before writing - dataset = sanitize_dataset_attributes(dataset) - - # Write with streaming computation and progress tracking - # The to_zarr operation will trigger all lazy computations - write_job = dataset.to_zarr( - group.store, - mode="w", - consolidated=False, - zarr_format=ZARR_FORMAT, - encoding=encoding, - group=path, - compute=False, # Create job first for progress tracking - ) - write_job = write_job.persist() - - if DISTRIBUTED_AVAILABLE: - try: - import distributed - - # Try to get current client for better status monitoring - try: - client = distributed.Client.current() - # client.compute is untyped (returns Any); verify we got a - # Future rather than asserting it with a cast. - future = client.compute(write_job) - if not isinstance(future, distributed.Future): - raise TypeError(f"expected a distributed.Future, got {type(future).__name__}") - log.info("Using distributed client for write job monitoring") - - try: - distributed.progress(future, notebook=False) - except Exception as progress_error: - log.warning("Could not display progress bar: {}", e=progress_error) - - # Get result and raise if computation failed - future.result() - except ValueError: - # No current client, fall back to regular distributed.progress - log.info("No distributed client available, using regular progress") - distributed.progress(write_job, notebook=False) - write_job.compute() - - except Exception as e: - log.warning("Could not use distributed features: {}", e=e) - write_job.compute() - else: - log.info("Writing zarr file...") - write_job.compute() - - log.info("Streaming write complete for dataset {}", dataset_path=path) - return dataset - - -def write_geo_metadata( - dataset: xr.Dataset, - grid_mapping_var_name: str = "spatial_ref", - crs: CRS | None = None, -) -> None: - """ - Write geographic metadata to the dataset. - - Args: - dataset: Dataset to write metadata to - grid_mapping_var_name: Name for grid mapping variable - crs: Coordinate Reference System to use (if None, attempts to detect from dataset) - """ - # Use provided CRS or try to detect from dataset - if crs is None: - for var in dataset.data_vars.values(): - if hasattr(var, "rio") and var.rio.crs: - crs = var.rio.crs - break - if "proj:epsg" in var.attrs: - epsg = var.attrs["proj:epsg"] - crs = CRS.from_epsg(epsg) - break - - if crs is not None: - # Write CRS using rioxarray - # NOTE: for now rioxarray only supports writing grid mapping using CF conventions - dataset.rio.write_crs(crs, grid_mapping_name=grid_mapping_var_name, inplace=True) - dataset.rio.write_grid_mapping(grid_mapping_var_name, inplace=True) - dataset.attrs["grid_mapping"] = grid_mapping_var_name - - for var in dataset.data_vars.values(): - var.rio.write_grid_mapping(grid_mapping_var_name, inplace=True) - var.attrs["grid_mapping"] = grid_mapping_var_name - - # Also add proj: and spatial: zarr conventions at dataset level - # TODO : Remove once rioxarray supports writing these conventions directly - # https://github.com/corteva/rioxarray/pull/883 - - # Assemble spatial convention data - spatial_data: spatial_cm.SpatialAttrs = { - "spatial:dimensions": ["y", "x"], # Required field - "spatial:registration": "pixel", # Default registration type - } - - # Calculate and add spatial bbox if coordinates are available - if "x" in dataset.coords and "y" in dataset.coords: - spatial_data["spatial:bbox"] = _bbox_from_coordinates(dataset) - - spatial_transform = _preferred_spatial_transform(dataset) - - # Only add spatial:transform if we have valid transform data (not all zeros) - if spatial_transform is not None and not all(t == 0 for t in spatial_transform): - spatial_data["spatial:transform"] = list(spatial_transform) - - # Add spatial shape if data variables exist - if dataset.data_vars: - first_var = next(iter(dataset.data_vars.values())) - if first_var.ndim >= 2: - height, width = first_var.shape[-2:] - spatial_data["spatial:shape"] = [height, width] - - # Build validated spatial + proj convention attrs (data + CMOs) via zarr-cm - dataset.attrs.update(utils.build_convention_attrs(spatial=spatial_data, crs=crs)) diff --git a/tests/test_cpm_writer.py b/tests/test_cpm_writer.py index 2d63eaf5..50c26d9c 100644 --- a/tests/test_cpm_writer.py +++ b/tests/test_cpm_writer.py @@ -103,26 +103,21 @@ def test_write_s2_default_writes_esa_layout(tmp_path: pathlib.Path) -> None: assert asset["gsd"] == 10 -def test_write_s2_scale_offset_codec(tmp_path: pathlib.Path) -> None: - """`scale_offset_codec=True` stores the packing in Zarr codecs, without CF or STAC scale fields.""" - root = _write_s2(tmp_path, scale_offset_codec=True) - b04 = root["measurements/reflectance/r10m/b04"] - assert isinstance(b04, zarr.Array) - assert b04.dtype == np.float32 - assert {"ScaleOffset", "CastValue"} <= set(_codec_names(b04)) - assert "scale_factor" not in b04.attrs - asset = _reflectance_asset(root) - assert "raster:scale" not in asset +def test_write_s2_scale_offset_codec_is_refused(tmp_path: pathlib.Path) -> None: + """`scale_offset_codec=True` deviates from the plan-driven S2 writer's + fixed policy (the ESA packed-integer layout) and is refused.""" + with pytest.raises(ValueError, match="fixed write policy"): + _write_s2(tmp_path, scale_offset_codec=True) def test_write_s2_keep_scale_offset_is_deprecated(tmp_path: pathlib.Path) -> None: - """`keep_scale_offset` still works for one release; `False` selects the codecs.""" - with pytest.warns(DeprecationWarning, match="scale_offset_codec"): - root = _write_s2(tmp_path, keep_scale_offset=False) - b04 = root["measurements/reflectance/r10m/b04"] - assert isinstance(b04, zarr.Array) - assert b04.dtype == np.float32 - assert {"ScaleOffset", "CastValue"} <= set(_codec_names(b04)) + """`keep_scale_offset=False` still maps to `scale_offset_codec=True` with a + deprecation warning, which the S2 write policy then refuses.""" + with ( + pytest.warns(DeprecationWarning, match="scale_offset_codec"), + pytest.raises(ValueError, match="fixed write policy"), + ): + _write_s2(tmp_path, keep_scale_offset=False) def test_write_olci_end_to_end(tmp_path: pathlib.Path) -> None: diff --git a/tests/test_data_api/test_s2_plan.py b/tests/test_data_api/test_s2_plan.py index 5e46d50b..2c653c2f 100644 --- a/tests/test_data_api/test_s2_plan.py +++ b/tests/test_data_api/test_s2_plan.py @@ -3,6 +3,7 @@ from __future__ import annotations import json +import os import pathlib from typing import Any @@ -88,6 +89,13 @@ def test_plan_matches_snapshot(path: pathlib.Path) -> None: metadata instead. """ planned = _planned_root(path) + if os.environ.get("REGENERATE_SNAPSHOTS"): + # The plan is the snapshots' source of truth now that the writer + # realizes it directly. Note that regenerating replaces the historical + # harness-tile georeferencing with each product's own, after which the + # masking below (and `_EXACT_PRODUCT`) can be retired. + snapshot_path = _SNAPSHOT_DIR / path.name + snapshot_path.write_text(json.dumps(planned, indent=2, sort_keys=True) + "\n") expected = _snapshot_root(path) for tree in (planned, expected): _mask_harness_georef(tree) diff --git a/tests/test_data_api/test_s2_write.py b/tests/test_data_api/test_s2_write.py index ac68d22b..6963fce4 100644 --- a/tests/test_data_api/test_s2_write.py +++ b/tests/test_data_api/test_s2_write.py @@ -1,32 +1,34 @@ """ -Parity tests for the plan-driven writer (`eopf_geozarr.data_api.s2_write`): -the store it writes is compared file by file against the store the DataTree -writer (`create_multiscale_from_datatree`) produces from the same input. +Tests for the plan-driven writer (`eopf_geozarr.data_api.s2_write`). + +`write_geozarr` replaced the DataTree-based writer after reproducing its +stores byte for byte, file by file, on these fixtures (the parity test lived +here until that writer was removed). These tests pin what the writer +guarantees on its own: the stored documents are exactly the plan, and the +chunk data follows the copy / inject / coarsen semantics, checked against +independently formulated references. """ from __future__ import annotations -import json +import warnings from typing import TYPE_CHECKING import numpy as np import pytest -import xarray as xr import zarr -from pyproj import CRS -from structlog.testing import capture_logs - -if TYPE_CHECKING: - import pathlib +from pydantic_zarr.v3 import GroupSpec as GroupSpecV3 from eopf_geozarr.data_api.s2_plan import load_sentinel2 -from eopf_geozarr.data_api.s2_write import write_geozarr -from eopf_geozarr.s2_optimization.s2_multiscale import create_multiscale_from_datatree +from eopf_geozarr.data_api.s2_write import _coarsen, write_geozarr from ..conftest import create_zarrv2_group_from_json, get_stem, s2_example_json_paths +if TYPE_CHECKING: + import pathlib + # Fallback footprint for coordinate arrays in groups that carry no proj -# attributes (geometry, meteorology), where both writers only copy the values. +# attributes (geometry, meteorology), where the writer only copies the values. _TILE_X_MIN = 300000.0 _TILE_Y_MAX = 5000040.0 _TILE_EXTENT = 109800.0 @@ -35,13 +37,18 @@ #: resampling arithmetic is exercised on values, not only on nodata fill. _PATTERN_MAX_ELEMENTS = 1830 * 1830 -#: Larger arrays seeded anyway: the scene classifications, so the -#: window-centre subsampling is exercised on real values. +#: Larger arrays seeded anyway: the scene classification and one finest band, +#: so the window-centre subsampling and the band injection are exercised on +#: real values. _PATTERNED_PATHS = ( "conditions/mask/l2a_classification/r20m/scl", "conditions/mask/l1c_classification/r60m/b00", + "measurements/reflectance/r10m/b08", ) +#: The L2A product used for the value-semantics checks. +_L2A_PATH = next(path for path in s2_example_json_paths if "MSIL2A" in path.stem) + def _walk_groups(group: zarr.Group, prefix: str = "") -> list[tuple[str, zarr.Group]]: found: list[tuple[str, zarr.Group]] = [(prefix, group)] @@ -62,13 +69,20 @@ def _group_transform(group: zarr.Group) -> tuple[float, ...] | None: return None +def _pattern(shape: tuple[int, ...], dtype: np.dtype) -> np.ndarray: + """Deterministic 2-D test values, with occasional zeros (the nodata fill).""" + modulus = min(999, int(np.iinfo(dtype).max)) + rows = np.arange(shape[0], dtype="uint16")[:, None] + cols = np.arange(shape[1], dtype="uint16")[None, :] + return ((rows * np.uint16(7) + cols) % np.uint16(modulus)).astype(dtype) + + def _seed_input_store(group: zarr.Group) -> None: """Give the metadata-only fixture store coordinates and array values. Coordinates are the pixel centres of each group's own `proj:transform` - (the georeferencing the plan derives from attributes, and the DataTree - writer re-derives from these values), and real products store them as - float64, so the fixtures' int64 declarations are recreated in that form. + (real products store them as float64, so the fixtures' int64 declarations + are recreated in that form), and selected arrays get deterministic values. """ patterned = set(_PATTERNED_PATHS) for group_path, subgroup in _walk_groups(group): @@ -99,71 +113,104 @@ def _seed_input_store(group: zarr.Group) -> None: replacement[:] = values elif array.ndim == 2 and np.issubdtype(array.dtype, np.integer): if array.size <= _PATTERN_MAX_ELEMENTS or path in patterned: - modulus = min(999, int(np.iinfo(array.dtype).max)) - array[...] = (np.arange(array.size) % modulus).reshape(array.shape) + array[...] = _pattern(array.shape, array.dtype) + + +def _written_store(source_path: pathlib.Path, tmp_path: pathlib.Path): + """Seed the fixture store, write it with `write_geozarr`, open both.""" + input_path = create_zarrv2_group_from_json(source_path, tmp_path) + _seed_input_store(zarr.open_group(input_path, mode="r+", zarr_format=2)) + source = zarr.open_group(input_path, mode="r", zarr_format=2) + output_path = tmp_path / "planned.zarr" + plan = write_geozarr(load_sentinel2(source), source, str(output_path)) + return plan, source, zarr.open_group(output_path, mode="r", use_consolidated=False) -def _store_files(root: pathlib.Path) -> set[str]: - return {str(p.relative_to(root)) for p in root.rglob("*") if p.is_file()} +def _reference_block_mean(values: np.ndarray, factor: int, fill: int) -> np.ndarray: + """The converter's masked block mean, formulated independently (nanmean).""" + rows = values.shape[0] // factor * factor + cols = values.shape[1] // factor * factor + windows = values[:rows, :cols].reshape(rows // factor, factor, cols // factor, factor) + masked = np.where(windows == fill, np.nan, windows.astype("float64")) + with warnings.catch_warnings(): + warnings.simplefilter("ignore", RuntimeWarning) + mean = np.nanmean(masked, axis=(1, 3)) + return np.where(np.isnan(mean), fill, np.round(mean)).astype(values.dtype) -@pytest.mark.filterwarnings("ignore:.*:RuntimeWarning") -@pytest.mark.filterwarnings("ignore:.*:FutureWarning") -@pytest.mark.filterwarnings("ignore:.*:UserWarning") @pytest.mark.parametrize("source_path", s2_example_json_paths, ids=get_stem) -def test_write_geozarr_matches_datatree_writer( - source_path: pathlib.Path, tmp_path: pathlib.Path -) -> None: +def test_write_geozarr_realizes_the_plan(source_path: pathlib.Path, tmp_path: pathlib.Path) -> None: """ - `write_geozarr` reproduces the DataTree writer's store from the same - input: the same files (so the same chunk existence), the same metadata - documents, and the same bytes in every chunk — across the copied native - levels, the injected bands, the generated pyramid levels (mean and - window-centre resampling exercised on seeded values), the coordinates, - and the carried conditions/quality datasets. + The written store holds exactly the planned hierarchy: reading it back + gives documents equal to the plan, for every group and array. """ - input_path = create_zarrv2_group_from_json(source_path, tmp_path) - _seed_input_store(zarr.open_group(input_path, mode="r+", zarr_format=2)) - input_group = zarr.open_group(input_path, mode="r", zarr_format=2) + plan, _, output = _written_store(source_path, tmp_path) + observed = GroupSpecV3.from_zarr(output).model_dump(mode="json") + assert observed == plan.model_dump(mode="json") + - band = input_group["measurements/reflectance/r10m/b02"] - assert isinstance(band, zarr.Array) - crs = CRS.from_epsg(int(band.attrs["proj:epsg"])) # type: ignore[arg-type] - - datatree_path = tmp_path / "datatree.zarr" - dt_input = xr.open_datatree( - input_group.store, # pyright: ignore[reportArgumentType] - engine="zarr", - chunks={}, - mask_and_scale=False, - decode_coords="all", +def test_write_geozarr_data_semantics(tmp_path: pathlib.Path) -> None: + """ + The written chunk data follows the writer's semantics, checked on seeded + values: native arrays are copied, injected bands are the masked block + mean of the finest input level holding them, generated levels chain from + the previous level (mean for bands and probabilities, window-centre pixel + for the classification), coordinates take window means, and grid-mapping + arrays hold zero. + """ + _, source, output = _written_store(_L2A_PATH, tmp_path) + + def read(group: zarr.Group, path: str) -> np.ndarray: + member = group[path] + assert isinstance(member, zarr.Array) + return np.asarray(member[...]) + + # a native array is copied (b01 r60m is small enough to carry the pattern) + native = read(output, "measurements/reflectance/r60m/b01") + np.testing.assert_array_equal(native, read(source, "measurements/reflectance/r60m/b01")) + + # an injected band is the masked block mean of its finest input level + injected = read(output, "measurements/reflectance/r60m/b08") + reference = _reference_block_mean(read(source, "measurements/reflectance/r10m/b08"), 6, 0) + np.testing.assert_array_equal(injected, reference) + + # a generated band level is the masked block mean of the previous level + generated = read(output, "measurements/reflectance/r120m/b01") + np.testing.assert_array_equal(generated, _reference_block_mean(native, 2, 0)) + + # a generated classification level takes each window's centre pixel + scl_native = read(output, "conditions/mask/l2a_classification/r60m/scl") + scl_generated = read(output, "conditions/mask/l2a_classification/r120m/scl") + np.testing.assert_array_equal(scl_generated, scl_native[1::2, 1::2]) + + # a generated level's coordinates are the window means of the previous level's + x_native = read(output, "measurements/reflectance/r60m/x") + x_generated = read(output, "measurements/reflectance/r120m/x") + np.testing.assert_array_equal( + x_generated, x_native[: x_generated.shape[0] * 2].reshape(-1, 2).mean(axis=1) ) - with capture_logs(): - create_multiscale_from_datatree( - dt_input, - output_group=zarr.create_group(str(datatree_path)), - enable_sharding=True, - spatial_chunk=1024, - crs=crs, - ) - - planned_path = tmp_path / "planned.zarr" - write_geozarr(load_sentinel2(input_group), input_group, str(planned_path)) - - datatree_files = _store_files(datatree_path) - planned_files = _store_files(planned_path) - assert sorted(planned_files) == sorted(datatree_files) - - mismatched = [] - for key in sorted(datatree_files): - expected = (datatree_path / key).read_bytes() - observed = (planned_path / key).read_bytes() - if key.rsplit("/", 1)[-1] == "zarr.json": - if json.loads(observed) != json.loads(expected): - mismatched.append(key) - elif observed != expected: - mismatched.append(key) - assert mismatched == [] + + # grid-mapping arrays hold zero + assert read(output, "measurements/reflectance/r120m/spatial_ref") == 0 + + +@pytest.mark.parametrize("factor", [2, 3]) +@pytest.mark.parametrize("var_name", ["scl", "b00"]) +def test_coarsen_classification_takes_the_window_centre(var_name: str, factor: int) -> None: + """Classification variables (SCL, L1C cloud bitmask) take the centre pixel + of each window; for an even factor, the lower-right of the middle pixels.""" + size = 2 * factor + data = np.arange(size * size, dtype="uint8").reshape(size, size) + result = _coarsen(data, factor, var_name, fill=0) + centre = factor // 2 + np.testing.assert_array_equal(result, data[centre::factor, centre::factor]) + + +def test_coarsen_refuses_quality_masks() -> None: + """Quality-mask downsampling is not implemented, so it is refused.""" + data = np.zeros((4, 4), dtype="uint8") + with pytest.raises(ValueError, match="quality_mask"): + _coarsen(data, 2, "quality_cirrus", fill=0) def test_write_geozarr_refuses_a_source_missing_the_planned_arrays( diff --git a/tests/test_s2_converter_simplified.py b/tests/test_s2_converter_simplified.py index 42b0d8b9..ee403704 100644 --- a/tests/test_s2_converter_simplified.py +++ b/tests/test_s2_converter_simplified.py @@ -7,11 +7,12 @@ import json from pathlib import Path from typing import cast -from unittest.mock import Mock, patch import numpy as np import pytest import xarray as xr +import zarr +from pyproj import CRS from eopf_geozarr.s2_optimization.s2_converter import ( _validate_s2_input, @@ -223,7 +224,7 @@ def test_simple_root_consolidation_success(tmp_path: Path) -> None: measurements/reflectance group, but not for other groups. """ - datasets = { + written = { "/measurements/reflectance/r10m": xr.Dataset(), "/quality/atmosphere": xr.Dataset(), } @@ -235,10 +236,12 @@ def test_simple_root_consolidation_success(tmp_path: Path) -> None: zarr_format=3, consolidated=False, ) - for k, v in datasets.items() + for k, v in written.items() ] - simple_root_consolidation(output_path=str(tmp_path / "test.zarr"), datasets=datasets) + simple_root_consolidation( + output_path=str(tmp_path / "test.zarr"), datasets=dict.fromkeys(written, ()) + ) root_z_meta = json.loads((tmp_path / "test.zarr/zarr.json").read_text()) reflectance_zmeta = json.loads( @@ -275,14 +278,15 @@ def test_simple_root_consolidation_aux_multiscales( """ output_path = tmp_path / "test.zarr" levels = ("r60m", "r120m") - datasets = {"/measurements/reflectance/r10m": xr.Dataset()} + written = {"/measurements/reflectance/r10m": xr.Dataset()} for base_path in aux_groups: for level in levels: - datasets[f"{base_path}/{level}"] = xr.Dataset({"b00": (["y", "x"], np.zeros((2, 2)))}) + written[f"{base_path}/{level}"] = xr.Dataset({"b00": (["y", "x"], np.zeros((2, 2)))}) - for k, v in datasets.items(): + for k, v in written.items(): v.to_zarr(str(output_path) + k, mode="a", zarr_format=3, consolidated=False) + datasets = {path: tuple(str(name) for name in ds.data_vars) for path, ds in written.items()} simple_root_consolidation(output_path=str(output_path), datasets=datasets) for base_path in aux_groups: @@ -306,7 +310,6 @@ def test_simple_root_consolidation_aux_multiscales( def test_write_store_root_bbox_reprojects_utm_to_wgs84(tmp_path: Path) -> None: """Store-root bbox unions child-group bboxes and outputs EPSG:4326 coords.""" - import zarr store_path = tmp_path / "root.zarr" root = zarr.open_group(store_path, mode="w") @@ -334,7 +337,6 @@ def test_write_store_root_bbox_reprojects_utm_to_wgs84(tmp_path: Path) -> None: def test_write_store_root_bbox_unions_multiple_children(tmp_path: Path) -> None: """Store-root bbox is the union across multiple child-group footprints.""" - import zarr store_path = tmp_path / "root.zarr" root = zarr.open_group(store_path, mode="w") @@ -354,7 +356,6 @@ def test_write_store_root_bbox_unions_multiple_children(tmp_path: Path) -> None: def test_write_store_root_bbox_densifies_edges(tmp_path: Path) -> None: """Reprojection uses transform_bounds, not just the two diagonal corners.""" - import zarr store_path = tmp_path / "root.zarr" root = zarr.open_group(store_path, mode="w") @@ -375,8 +376,6 @@ def test_write_store_root_bbox_densifies_edges(tmp_path: Path) -> None: def test_write_store_root_bbox_resolves_wkt2_only_crs(tmp_path: Path) -> None: """A group carrying only proj:wkt2 is reprojected, not assumed to be degrees.""" - import zarr - from pyproj import CRS store_path = tmp_path / "root.zarr" root = zarr.open_group(store_path, mode="w") @@ -393,7 +392,6 @@ def test_write_store_root_bbox_resolves_wkt2_only_crs(tmp_path: Path) -> None: def test_write_store_root_bbox_skips_group_without_crs(tmp_path: Path) -> None: """A bbox with no resolvable CRS must not be unioned as if it were degrees.""" - import zarr store_path = tmp_path / "root.zarr" root = zarr.open_group(store_path, mode="w") @@ -411,7 +409,6 @@ def test_write_store_root_bbox_skips_group_without_crs(tmp_path: Path) -> None: def test_write_store_root_bbox_invalid_code_does_not_raise(tmp_path: Path) -> None: """An unresolvable proj:code is skipped with a warning, never raised.""" - import zarr store_path = tmp_path / "root.zarr" root = zarr.open_group(store_path, mode="w") @@ -430,7 +427,6 @@ def test_write_store_root_bbox_invalid_code_does_not_raise(tmp_path: Path) -> No def test_write_store_root_bbox_antimeridian_falls_back_to_full_range(tmp_path: Path) -> None: """A footprint crossing the antimeridian widens the root bbox to +/-180.""" - import zarr store_path = tmp_path / "root.zarr" root = zarr.open_group(store_path, mode="w") @@ -446,68 +442,29 @@ def test_write_store_root_bbox_antimeridian_falls_back_to_full_range(tmp_path: P assert bbox == [-180.0, bbox[1], 180.0, bbox[3]], bbox -class TestConvenienceFunction: - """Test the convenience function.""" - - @patch("eopf_geozarr.conversion.utils.create_result_datatree") - @patch("eopf_geozarr.s2_optimization.s2_converter.zarr.open_group") - @patch("eopf_geozarr.s2_optimization.s2_converter.initialize_crs_from_dataset") - @patch("eopf_geozarr.s2_optimization.s2_converter.get_zarr_group") - @patch("eopf_geozarr.s2_optimization.s2_converter.is_sentinel2_dataset") - @patch("eopf_geozarr.s2_optimization.s2_converter.create_multiscale_from_datatree") - @patch("eopf_geozarr.s2_optimization.s2_converter.simple_root_consolidation") - def test_convert_s2_optimized_convenience_function( - self, - mock_consolidation: Mock, - mock_multiscale: Mock, - mock_is_s2: Mock, - mock_get_zarr_group: Mock, - mock_init_crs: Mock, - mock_zarr_open_group: Mock, - mock_create_result_datatree: Mock, - ) -> None: - """Test the convenience function parameter passing.""" - # Setup mocks - mock_multiscale.return_value = {} - mock_is_s2.return_value = True - mock_get_zarr_group.return_value = Mock() - mock_init_crs.return_value = None # Return None for CRS - - # Mock zarr.open_group to return a group with proper groups() and members() methods - mock_zarr_group = Mock() - mock_zarr_group.groups.return_value = iter([]) # Return empty iterator for groups - mock_zarr_group.members.return_value = {} # Return empty dict for members - mock_zarr_open_group.return_value = mock_zarr_group - - # Mock create_result_datatree to return a mock DataTree with groups attribute - mock_result_dt = Mock() - mock_result_dt.groups = [] # Empty list for groups - mock_create_result_datatree.return_value = mock_result_dt - - # Test parameter passing - Mock DataTree with groups attribute - dt_input = Mock() - dt_input.groups = ["/measurements/reflectance/r10m"] - output_path = "/test/path" - +@pytest.mark.parametrize( + "deviation", + [ + {"enable_sharding": False}, + {"spatial_chunk": 512}, + {"compression_level": 2}, + {"scale_offset_codec": True}, + ], + ids=lambda d: next(iter(d)), +) +def test_convert_s2_optimized_refuses_non_policy_options(deviation: dict) -> None: + """The plan-driven writer has a fixed write policy; a deviating layout + option is refused before any work happens.""" + with pytest.raises(ValueError, match="fixed write policy"): convert_s2_optimized( - dt_input, - output_path=output_path, - enable_sharding=False, - spatial_chunk=512, - compression_level=2, - max_retries=5, + xr.DataTree(), + output_path="/unused", validate_output=False, + **deviation, ) - # Verify multiscale function was called with correct args - mock_multiscale.assert_called_once() - call_kwargs = mock_multiscale.call_args.kwargs - assert call_kwargs["enable_sharding"] is False - assert call_kwargs["spatial_chunk"] == 512 - def test_simple_root_consolidation_adds_reflectance_stac_asset(tmp_path: Path) -> None: - from pyproj import CRS # initialise an empty dataset to mimic the process and write to tmp r10m = xr.Dataset(coords={"y": np.arange(10), "x": np.arange(20)}) @@ -517,8 +474,6 @@ def test_simple_root_consolidation_adds_reflectance_stac_asset(tmp_path: Path) - zarr_format=3, consolidated=False, ) - datasets = {"/measurements/reflectance/r10m": r10m} - # adding dummy data to dt_input to mimic input reference dtreee dt_input = xr.DataTree(xr.Dataset({"dummy": (["y"], np.zeros(10))})) dt_input.attrs = {"stac_discovery": {"properties": {"mission": "sentinel-2"}}} @@ -526,9 +481,10 @@ def test_simple_root_consolidation_adds_reflectance_stac_asset(tmp_path: Path) - # test execution of func simple_root_consolidation( output_path=str(tmp_path / "test.zarr"), - datasets=datasets, + datasets={"/measurements/reflectance/r10m": ()}, dt_input=dt_input, crs=CRS.from_epsg(32632), + reflectance_shape=(10, 20), ) # read in the consolidated dTree root to cross-check with expected outcome @@ -551,17 +507,12 @@ def test_add_multiscale_pyramids_to_stac_metadata_adds_missing_levels() -> None: """Pyramid levels absent from existing STAC assets get one asset per data variable.""" existing_asset = {"href": "/measurements/reflectance/r10m/b02", "title": "B02"} attrs: dict = {"stac_discovery": {"assets": {"b02": dict(existing_asset)}}} - datasets = { + datasets: dict[str, tuple[str, ...] | None] = { # already referenced by an existing asset -> must not be duplicated - "/measurements/reflectance/r10m": xr.Dataset({"b02": (["y", "x"], np.zeros((4, 4)))}), + "/measurements/reflectance/r10m": ("b02",), # new pyramid level -> assets added, spatial_ref skipped - "/measurements/reflectance/r20m": xr.Dataset( - { - "b02": (["y", "x"], np.zeros((2, 2))), - "b05": (["y", "x"], np.zeros((2, 2))), - "spatial_ref": ((), 0), - } - ), + "/measurements/reflectance/r20m": ("b02", "b05", "spatial_ref"), + # a multiscale root carries no variables of its own "/measurements/reflectance/r60m": None, } @@ -578,9 +529,7 @@ def test_add_multiscale_pyramids_to_stac_metadata_adds_missing_levels() -> None: @pytest.mark.parametrize("attrs", [{}, {"stac_discovery": {}}, {"stac_discovery": {"assets": {}}}]) def test_add_multiscale_pyramids_to_stac_metadata_without_assets_is_noop(attrs: dict) -> None: """Missing stac_discovery/assets returns the attributes unchanged instead of raising.""" - datasets = { - "/measurements/reflectance/r20m": xr.Dataset({"b02": (["y", "x"], np.zeros((2, 2)))}) - } + datasets = {"/measurements/reflectance/r20m": ("b02",)} expected = json.loads(json.dumps(attrs)) assert add_multiscale_pyramids_to_stac_metadata(datasets, attrs) == expected diff --git a/tests/test_s2_multiscale.py b/tests/test_s2_multiscale.py index 638b4632..2611b175 100644 --- a/tests/test_s2_multiscale.py +++ b/tests/test_s2_multiscale.py @@ -1,46 +1,29 @@ """ -Tests for S2 multiscale pyramid creation with xy-aligned sharding. +Tests for the S2 optimized converter pipeline: the uniform encoding it stores +and the structure `convert_s2_optimized` produces end to end. The pyramids +themselves are planned by `data_api.s2_plan` and written by +`data_api.s2_write`, which carry their own tests; the golden snapshots are +pinned by `tests/test_data_api/test_s2_plan.py`. """ -import json -import os import pathlib -from collections.abc import Mapping, Sequence from itertools import pairwise import numpy as np import pytest import xarray as xr import zarr -from affine import Affine -from pydantic_zarr.core import tuplify_json -from pydantic_zarr.v3 import GroupSpec -from pyproj import CRS from structlog.testing import capture_logs from zarr.core.metadata import ArrayV3Metadata from eopf_geozarr.conversion.utils import ( _rechunk_ds, + calculate_aligned_chunk_size, create_uniform_encoding, rechunk_dataset_for_encoding, ) from eopf_geozarr.s2_optimization.s2_converter import convert_s2_optimized -from eopf_geozarr.s2_optimization.s2_multiscale import ( - _AUX_MULTISCALES, - MultiscaleSpec, - S2Type, - _coarsen_variable, - _declare_scl_nodata, - calculate_aligned_chunk_size, - calculate_simple_shard_dimensions, - create_downsampled_resolution_group, - create_multiscale_from_datatree, - generic_multiscales, - inject_missing_bands, - write_geo_metadata, -) - -from .conftest import create_zarrv2_group_from_json, get_stem, s2_example_json_paths +from eopf_geozarr.s2_optimization.s2_multiscale import _AUX_MULTISCALES, S2Type def _codec_names(metadata: ArrayV3Metadata) -> list[str]: @@ -61,110 +44,6 @@ def sample_dataset(s2_group_example: pathlib.Path) -> xr.Dataset: )["measurements/reflectance/r10m"].to_dataset() -def test_create_downsampled_resolution_group_quality_mask() -> None: - """Quality-mask downsampling is disabled, so it should raise.""" - x = np.arange(8) - y = np.arange(6) - quality = xr.DataArray( - np.random.randint(0, 2, (6, 8), dtype=np.uint8), - dims=["y", "x"], - coords={"y": y, "x": x}, - name="quality_clouds", - ) - ds = xr.Dataset({"quality_clouds": quality}) - - with pytest.raises(ValueError, match="quality_mask"): - create_downsampled_resolution_group(ds, factor=2) - - -def test_generic_multiscales_prefers_coordinate_transform_for_inconsistent_rio( - tmp_path: pathlib.Path, -) -> None: - """Derived levels should not reuse the stale rio transform inherited from the finest level.""" - crs = CRS.from_epsg(32631) - size = 24 # 24 px at 10 m -> 12 px at 20 m -> 4 px at 60 m -> 2 px at 120 m - x = 600000.0 + np.arange(size, dtype="float64") * 10 - y = 4900020.0 - np.arange(size, dtype="float64") * 10 - r10m = _rechunk_ds( - xr.Dataset( - {"band": (["y", "x"], np.ones((size, size), dtype=np.uint16))}, - coords={"x": x, "y": y}, - ), - 1024, - ) - write_geo_metadata(r10m, crs=crs) - # A GeoTransform on `spatial_ref` is carried into every coarsened level, where - # the rio transform then no longer matches the coordinate grid. - r10m.rio.write_transform(Affine(10.0, 0.0, 599995.0, 0.0, -10.0, 4900025.0), inplace=True) - - output_path = tmp_path / "multiscales.zarr" - base_path = "/measurements/reflectance" - with capture_logs(): - generic_multiscales( - MultiscaleSpec(base_path=base_path, scale_levels=(10, 20, 60, 120)), - src_processed_groups={"r10m": r10m}, - output_group=zarr.create_group(output_path), - crs=crs, - ) - - parent_group = zarr.open_group(output_path, path=base_path) - multiscales = parent_group.attrs["multiscales"] - assert isinstance(multiscales, Mapping) - layout = multiscales["layout"] - assert isinstance(layout, Sequence) - assert [level["asset"] for level in layout if isinstance(level, Mapping)] == [ - "r10m", - "r20m", - "r60m", - "r120m", - ] - derived_level = next( - level for level in layout if isinstance(level, Mapping) and level["asset"] == "r120m" - ) - assert isinstance(derived_level, Mapping) - assert derived_level["derived_from"] == "r60m" - assert derived_level["spatial:shape"] == [2, 2] - transform = derived_level["spatial:transform"] - assert isinstance(transform, Sequence) - # Origin is the outer pixel edge, half of the 120 m pixel outside the first centre. - assert tuple(transform) == ( - 120.0, - 0.0, - 599995.0, - 0.0, - -120.0, - 4900025.0, - ) - - # The parent footprint covers the pixel edges of the finest level (#266). - assert parent_group.attrs["spatial:bbox"] == [599995.0, 4899785.0, 600235.0, 4900025.0] - - -def test_calculate_simple_shard_dimensions() -> None: - """Test simplified shard dimensions calculation.""" - # Test 3D data (time, y, x) - shards are multiples of chunks - data_shape: tuple[int, ...] = (5, 1024, 1024) - chunks: tuple[int, ...] = (1, 256, 256) - - shard_dims = calculate_simple_shard_dimensions(data_shape, chunks) - - assert len(shard_dims) == 3 - assert shard_dims[0] == 1 # Time dimension should be 1 - assert shard_dims[1] == 1024 # Y dimension matches exactly (divisible by 256) - assert shard_dims[2] == 1024 # X dimension matches exactly (divisible by 256) - - # Test 2D data (y, x) with non-divisible dimensions - data_shape = (1000, 1000) - chunks = (256, 256) - - shard_dims = calculate_simple_shard_dimensions(data_shape, chunks) - - assert len(shard_dims) == 2 - # Should use largest multiple of chunk_size that fits - assert shard_dims[0] == 768 # 3 * 256 = 768 (largest multiple that fits in 1000) - assert shard_dims[1] == 768 # 3 * 256 = 768 - - @pytest.mark.parametrize("mask_and_scale", [False, True], ids=["raw", "decoded"]) @pytest.mark.parametrize("scale_offset_codec", [True, False], ids=["codec", "cf"]) def test_create_measurements_encoding( @@ -273,81 +152,7 @@ def _band_names(group: zarr.Group) -> set[str]: # L1C r60m is filled with every finer band, so it and its overviews carry all 13. _L1C_ALL_BANDS = {f"b{i:02d}" for i in range(1, 13)} | {"b8a"} -# Footprint of an S2 tile (109.8 km square) in UTM, used to give the JSON fixtures -# real coordinates: they carry no chunk data, so every x/y value is the fill value. -_TILE_CRS = CRS.from_epsg(32632) -_TILE_X_MIN = 300000.0 -_TILE_Y_MAX = 5000040.0 -_TILE_EXTENT = 109800.0 - - -def _with_tile_coordinates(ds: xr.Dataset) -> xr.Dataset: - """Replace the x/y coordinates with pixel centres covering `_TILE_EXTENT`.""" - if "x" not in ds.dims or "y" not in ds.dims: - return ds - res_x = _TILE_EXTENT / ds.sizes["x"] - res_y = _TILE_EXTENT / ds.sizes["y"] - return ds.assign_coords( - x=_TILE_X_MIN + (np.arange(ds.sizes["x"]) + 0.5) * res_x, - y=_TILE_Y_MAX - (np.arange(ds.sizes["y"]) + 0.5) * res_y, - ) - -@pytest.mark.filterwarnings("ignore:.*:RuntimeWarning") -@pytest.mark.filterwarnings("ignore:.*:FutureWarning") -@pytest.mark.filterwarnings("ignore:.*:UserWarning") -@pytest.mark.parametrize("source_path", s2_example_json_paths, ids=get_stem) -def test_create_multiscale_from_datatree_snapshot( - source_path: pathlib.Path, tmp_path: pathlib.Path -) -> None: - """Compare the output structure of a Zarr v2 S2 input against a stored snapshot. - - Any change to array metadata (dtype, fill value, chunks, codecs, attributes) - or to the set of arrays shows up here. When a change is intended, regenerate - the snapshots with `REGENERATE_SNAPSHOTS=1 pytest -k snapshot` and review - the JSON diff. - """ - input_group = zarr.open_group(create_zarrv2_group_from_json(source_path, tmp_path)) - dt_input = xr.open_datatree( - input_group.store, # pyright: ignore[reportArgumentType] - engine="zarr", - chunks={}, - mask_and_scale=False, - decode_coords="all", - ).map_over_datasets(_with_tile_coordinates) - output_path = str(tmp_path / "output.zarr") - with capture_logs(): - create_multiscale_from_datatree( - dt_input, - output_group=zarr.create_group(output_path), - enable_sharding=True, - spatial_chunk=1024, - crs=_TILE_CRS, - ) - - observed_json = GroupSpec.from_zarr( - zarr.open_group(output_path, use_consolidated=False) - ).model_dump() - snapshot_path = pathlib.Path("tests/_test_data/optimized_geozarr_examples") / ( - source_path.stem + ".json" - ) - if os.environ.get("REGENERATE_SNAPSHOTS"): - snapshot_path.write_text(json.dumps(observed_json, indent=2, sort_keys=True) + "\n") - - observed = GroupSpec(**tuplify_json(observed_json)).to_flat() - expected = GroupSpec(**tuplify_json(json.loads(snapshot_path.read_text()))).to_flat() - assert set(observed) == set(expected) - - # Compare as JSON: a NaN fill value never equals itself as a float. - def canonical(node: object) -> str: - return json.dumps(node.model_dump(), sort_keys=True) # type: ignore[attr-defined] - - assert [key for key in observed if canonical(observed[key]) != canonical(expected[key])] == [] - - -@pytest.mark.filterwarnings("ignore:.*:RuntimeWarning") -@pytest.mark.filterwarnings("ignore:.*:FutureWarning") -@pytest.mark.filterwarnings("ignore:.*:UserWarning") def test_create_multiscale_from_datatree( s2_group_example: pathlib.Path, tmp_path: pathlib.Path, @@ -504,462 +309,3 @@ def test_create_multiscale_from_datatree( (f"{group_a.path}/{name}::{dtype_a}", f"{group_b.path}/{name}::{dtype_b}") ) assert dtype_mismatch == set() - - -# A 6x6 nodata block in r60m covers r120m[0:3, 0:3] and r360m[0, 0] entirely. -_NODATA_BLOCK = 6 -_SCALE_FACTOR = 0.0001 -_ADD_OFFSET = -0.1 - - -def _make_minimal_s2_datatree(*, raw: bool) -> xr.DataTree: - """Build a tiny reflectance DataTree for behavior tests. - - Three levels (r10m, r20m, r60m), one band each, packed like ESA S2 L2A - reflectance (uint16, `scale_factor` 0.0001, `add_offset` -0.1, nodata 0). - The r60m band has a nodata block of `_NODATA_BLOCK` pixels in its top-left - corner. - - `raw=False` gives decoded floats with the CF values in `.encoding`, as the - CLI opens products. `raw=True` gives the packed integers with the CF values - in `.attrs` and the nodata value only in the EOPF `fill_value` attribute, - as CPM Zarr v3 products opened with `mask_and_scale=False`. - """ - rng = np.random.default_rng(0) - - def _band(size: int, *, nodata_block: int = 0) -> xr.DataArray: - data = rng.uniform(0.0, 1.0, size=(size, size)).astype("float64") - data[:nodata_block, :nodata_block] = np.nan - coords = { - "x": np.arange(size, dtype="float64"), - "y": np.arange(size, dtype="float64"), - } - if raw: - packed = np.round((data - _ADD_OFFSET) / _SCALE_FACTOR) - packed = np.where(np.isnan(data), 0, packed).astype("uint16") - return xr.DataArray( - packed, - dims=["y", "x"], - coords=coords, - attrs={"scale_factor": _SCALE_FACTOR, "add_offset": _ADD_OFFSET, "fill_value": 0}, - ) - da = xr.DataArray(data, dims=["y", "x"], coords=coords) - da.encoding = { - "scale_factor": _SCALE_FACTOR, - "add_offset": _ADD_OFFSET, - "_FillValue": 0, - "dtype": np.dtype("uint16"), - } - return da - - r10m = xr.Dataset({"b02": _band(120)}) - r20m = xr.Dataset({"b05": _band(60)}) - r60m = xr.Dataset({"b01": _band(20, nodata_block=_NODATA_BLOCK)}) - # L1C cloud classification bitmask (OPAQUE | CIRRUS | SNOW_ICE), unpacked uint8 - # on the r60m grid, as in ESA products. Required by `create_multiscale_from_datatree`. - l1c_classification = xr.Dataset( - { - "b00": xr.DataArray( - rng.integers(0, 8, size=(20, 20), dtype="uint8"), - dims=["y", "x"], - coords=r60m.coords, - attrs={"flag_masks": [1, 2, 4], "flag_meanings": ["OPAQUE", "CIRRUS", "SNOW_ICE"]}, - ) - } - ) - - dt = xr.DataTree() - dt["measurements/reflectance/r10m"] = xr.DataTree(r10m) - dt["measurements/reflectance/r20m"] = xr.DataTree(r20m) - dt["measurements/reflectance/r60m"] = xr.DataTree(r60m) - dt["conditions/mask/l1c_classification/r60m"] = xr.DataTree(l1c_classification) - return dt - - -def _decoded(da: xr.DataArray) -> np.ndarray: - """Values of a synthetic band as the source product defines them (NaN for nodata).""" - values = da.values.astype("float64") - if np.issubdtype(da.dtype, np.integer): - return np.where(values == 0, np.nan, values * _SCALE_FACTOR + _ADD_OFFSET) - return values - - -# Spatial chunk small enough that no padding is needed for the 20x20 r60m band. -_BEHAVIOR_SPATIAL_CHUNK = 16 - -# Original groups in the synthetic datatree — those that are packed on input. -_ORIGINAL_GROUPS = { - "measurements/reflectance/r10m": "b02", - "measurements/reflectance/r20m": "b05", - "measurements/reflectance/r60m": "b01", -} - -# Downsampled groups added by `create_multiscale_from_datatree`, derived from the -# r60m level by successive coarsening. `_coarsen_variable` preserves the source -# variable's packing, so these levels are encoded like the original groups. -_DOWNSAMPLED_GROUPS = ( - "measurements/reflectance/r120m", - "measurements/reflectance/r360m", - "measurements/reflectance/r720m", -) - - -@pytest.mark.filterwarnings("ignore:.*:RuntimeWarning") -@pytest.mark.filterwarnings("ignore:.*:FutureWarning") -@pytest.mark.filterwarnings("ignore:.*:UserWarning") -@pytest.mark.parametrize("raw", [False, True], ids=["decoded", "raw"]) -@pytest.mark.parametrize("scale_offset_codec", [True, False], ids=["codec", "cf"]) -def test_create_multiscale_from_datatree_behavior( - scale_offset_codec: bool, - raw: bool, - tmp_path: pathlib.Path, -) -> None: - """Verify both encoding modes on every level of a tiny pyramid, for both input forms. - - * default: every level keeps the source packing in Zarr `scale_offset` + - `cast_value` codecs; the logical dtype is float32 (decoded) and there are - no CF scale attributes. - * `scale_offset_codec=False`: every level is uint16 on disk with the CF - `scale_factor`, `add_offset` and `_FillValue` attributes, as in the ESA - product. - - In both modes, decoded values match the source within one packing step and - nodata stays nodata through the pyramid. - """ - dt_input = _make_minimal_s2_datatree(raw=raw) - output_path = str(tmp_path / "output.zarr") - - with capture_logs(): - create_multiscale_from_datatree( - dt_input, - output_group=zarr.create_group(output_path), - enable_sharding=False, - spatial_chunk=_BEHAVIOR_SPATIAL_CHUNK, - # The spatial convention attrs that the pyramid layout needs are only written with a CRS. - crs=CRS.from_epsg(32632), - scale_offset_codec=scale_offset_codec, - ) - - def _check_array(path: str) -> None: - arr = zarr.open_array(output_path, path=path) - assert isinstance(arr.metadata, ArrayV3Metadata) - codec_names = _codec_names(arr.metadata) - cf_attrs = {"scale_factor", "add_offset"} & set(arr.attrs) - if not scale_offset_codec: - assert arr.dtype == np.uint16, f"{path}: expected uint16 on disk, got {arr.dtype}" - assert "ScaleOffset" not in codec_names - assert "CastValue" not in codec_names - assert arr.attrs["scale_factor"] == pytest.approx(_SCALE_FACTOR) - assert arr.attrs["add_offset"] == pytest.approx(_ADD_OFFSET) - assert arr.attrs["_FillValue"] == 0 - else: - assert arr.dtype == np.float32, ( - f"{path}: expected float32 logical dtype, got {arr.dtype}" - ) - assert "ScaleOffset" in codec_names, f"{path}: codecs={codec_names}" - assert "CastValue" in codec_names, f"{path}: codecs={codec_names}" - assert cf_attrs == set(), f"{path}: unexpected CF attrs {cf_attrs}" - - for group_path, var_name in _ORIGINAL_GROUPS.items(): - _check_array(f"{group_path}/{var_name}") - - parent_group = zarr.open_group(output_path, path="measurements/reflectance") - for group_path in _DOWNSAMPLED_GROUPS: - # All three downsampled levels should exist for the minimal datatree - # (10/20/60 → 120/360/720). - sub = group_path.removeprefix("measurements/reflectance/") - assert sub in dict(parent_group.groups()), f"missing downsampled group {group_path}" - ds = xr.open_dataset(output_path, engine="zarr", group=group_path, decode_coords="all") - assert ds.data_vars, f"{group_path} has no variables" - for name in ds.data_vars: - _check_array(f"{group_path}/{name}") - - # Decoded values match the source, quantised onto the packing grid. - for group_path, var_name in _ORIGINAL_GROUPS.items(): - expected = _decoded(dt_input[group_path].to_dataset()[var_name]) - observed = xr.open_dataset( - output_path, engine="zarr", group=group_path, decode_coords="all" - )[var_name].values - # Quantisation plus the float32 round trip stay within one packing step. - np.testing.assert_allclose(observed, expected, atol=_SCALE_FACTOR, rtol=0) - - # Nodata stays nodata through the pyramid: pixels fully covered by the - # source nodata block decode to NaN, the others do not. - for group_path, nodata_extent in ( - ("measurements/reflectance/r60m", _NODATA_BLOCK), - ("measurements/reflectance/r120m", _NODATA_BLOCK // 2), - ("measurements/reflectance/r360m", _NODATA_BLOCK // 6), - ): - decoded = xr.open_dataset( - output_path, engine="zarr", group=group_path, decode_coords="all" - )["b01"].values - block = decoded[:nodata_extent, :nodata_extent] - assert np.isnan(block).all(), f"{group_path}: nodata block not NaN" - assert np.isnan(decoded).sum() == block.size, f"{group_path}: unexpected NaN outside block" - - -@pytest.mark.filterwarnings("ignore:.*:RuntimeWarning") -@pytest.mark.filterwarnings("ignore:.*:FutureWarning") -@pytest.mark.filterwarnings("ignore:.*:UserWarning") -def test_create_multiscale_reuses_native_reflectance_levels(tmp_path: pathlib.Path) -> None: - """Native r20m/r60m reflectance groups are reused, not coarsened again from r10m. - - The "skip existing path" guard in `stream_write_s2dataset` would hide a - regression on disk, so the created levels are checked through the logs and - the native groups through their variables and values. - """ - dt_input = _make_minimal_s2_datatree(raw=False) - output_path = str(tmp_path / "output.zarr") - - with capture_logs() as logs: - create_multiscale_from_datatree( - dt_input, - output_group=zarr.create_group(output_path), - enable_sharding=False, - spatial_chunk=_BEHAVIOR_SPATIAL_CHUNK, - crs=CRS.from_epsg(32632), - ) - - created = {e["level"] for e in logs if e["event"] == "Creating level with resolution"} - assert created == {"r120m", "r360m", "r720m"} - - # The native levels hold their own band with their own values, not a coarsened r10m band. - for group_path, var_name in _ORIGINAL_GROUPS.items(): - ds = xr.open_dataset(output_path, engine="zarr", group=group_path, decode_coords="all") - assert set(ds.data_vars) == {var_name}, f"{group_path}: {set(ds.data_vars)}" - expected = _decoded(dt_input[group_path].to_dataset()[var_name]) - np.testing.assert_allclose(ds[var_name].values, expected, atol=_SCALE_FACTOR, rtol=0) - - -# --------------------------------------------------------------------------- -# _coarsen_variable -# --------------------------------------------------------------------------- - - -@pytest.mark.parametrize("factor", [2, 3]) -@pytest.mark.parametrize("var_name", ["scl", "b00"]) -def test_coarsen_variable_classification(var_name: str, factor: int) -> None: - """Classification variables (SCL, L1C cloud bitmask) take the centre pixel of each block. - - The output coordinates are the block centres, so the centre pixel keeps the - classes aligned with the averaged bands. For an even factor there is no single - centre pixel and the lower-right one of the middle four is taken. - """ - size = 2 * factor - data = np.arange(size * size, dtype="uint8").reshape(size, size) - coords = {"y": np.arange(float(size)), "x": np.arange(float(size))} - var = xr.DataArray(data, dims=["y", "x"], coords=coords) - result = _coarsen_variable(var_name, var, factor=factor) - assert result.shape == (2, 2) - assert result.dtype == np.uint8 - centre = factor // 2 - np.testing.assert_array_equal(result.values, data[centre::factor, centre::factor]) - # The sampled pixel lies on the block centre for odd factors, half a pixel off for even ones. - block_centres = np.arange(2) * factor + (factor - 1) / 2 - np.testing.assert_array_equal(result["x"].values, block_centres) - np.testing.assert_array_equal(result["y"].values, block_centres) - sampled = coords["x"][centre::factor] - assert np.abs(sampled - block_centres).max() == (0 if factor % 2 else 0.5) - - -@pytest.mark.parametrize( - ("attrs", "expected_fill"), - [({}, 0), ({"fill_value": 255}, None)], - ids=["undeclared", "declared"], -) -def test_declare_scl_nodata(attrs: dict, expected_fill: int | None) -> None: - """SCL gets its NO_DATA class as `_FillValue` only when the source declares no nodata.""" - scl = xr.DataArray(np.zeros((2, 2), dtype="uint8"), dims=["y", "x"], attrs=attrs) - cld = xr.DataArray(np.zeros((2, 2), dtype="uint8"), dims=["y", "x"]) - result = _declare_scl_nodata(xr.Dataset({"scl": scl, "cld": cld})) - assert result["scl"].encoding.get("_FillValue") == expected_fill - # 0 is a valid probability, so other variables are left alone. - assert "_FillValue" not in result["cld"].encoding - - -def test_coarsen_variable_quality_mask() -> None: - """Quality mask downsampling is disabled, so it should raise.""" - data = np.array([[0, 1], [2, 3]], dtype="uint8") - var = xr.DataArray(data, dims=["y", "x"], coords={"y": np.arange(2.0), "x": np.arange(2.0)}) - with pytest.raises(ValueError, match="quality_mask"): - _coarsen_variable("quality_cirrus", var, factor=2) - - -# --------------------------------------------------------------------------- -# inject_missing_bands -# --------------------------------------------------------------------------- - - -def _make_reflectance_datatree() -> xr.DataTree: - """Build a minimal DataTree with /measurements/reflectance/r10m and r20m.""" - size_10m = 120 # must be divisible by 2 (→60) and 6 (→20) - x10 = np.arange(size_10m, dtype="float64") - y10 = np.arange(size_10m, dtype="float64") - - r10m_ds = xr.Dataset( - { - "b02": (["y", "x"], np.ones((size_10m, size_10m), dtype="uint16")), - "b03": (["y", "x"], np.ones((size_10m, size_10m), dtype="uint16")), - "b04": (["y", "x"], np.ones((size_10m, size_10m), dtype="uint16")), - "b08": (["y", "x"], np.full((size_10m, size_10m), 42, dtype="uint16")), - }, - coords={"x": x10, "y": y10}, - ) - - size_20m = size_10m // 2 - x20 = np.arange(size_20m, dtype="float64") - y20 = np.arange(size_20m, dtype="float64") - r20m_ds = xr.Dataset( - { - "b05": (["y", "x"], np.ones((size_20m, size_20m), dtype="uint16")), - }, - coords={"x": x20, "y": y20}, - ) - - dt = xr.DataTree() - dt["measurements/reflectance/r10m"] = xr.DataTree(r10m_ds) - dt["measurements/reflectance/r20m"] = xr.DataTree(r20m_ds) - return dt - - -@pytest.mark.parametrize("scale_offset_codec", [True, False]) -def test_inject_missing_bands_skips_unmasked_nodata(scale_offset_codec: bool) -> None: - """Decoded Zarr v3 input keeps its nodata unmasked; injection must still skip it. - - xarray only masks `_FillValue`, so a decoded CPM Zarr v3 band shows nodata - as `0 * scale_factor + add_offset` and declares it only in the EOPF - `fill_value` attribute. The codec mode injects decoded float32 values; the - ESA layout injects packed integers, with no cast to float. - """ - dt = _make_reflectance_datatree() - decoded = np.full((120, 120), 0.3) - decoded[0, 0] = -0.1 # nodata (DN 0) in the top-left 2x2 block - decoded[2:4, 2:4] = -0.1 # a fully nodata 2x2 block - b08 = xr.DataArray( - decoded, - dims=["y", "x"], - coords=dt["measurements/reflectance/r10m"].to_dataset().coords, - attrs={"fill_value": 0}, - ) - b08.encoding = {"scale_factor": 0.0001, "add_offset": -0.1, "dtype": np.dtype("uint16")} - r10m = dt["measurements/reflectance/r10m"].to_dataset().assign(b08=b08) - dt["measurements/reflectance/r10m"] = xr.DataTree(r10m) - r20m_ds = dt["measurements/reflectance/r20m"].to_dataset() - - result = inject_missing_bands( - r20m_ds, - dt, - target_resolution=20, - bands={"b08"}, - spatial_chunk=1024, - scale_offset_codec=scale_offset_codec, - ) - - values = result["b08"].values - if scale_offset_codec: - assert values.dtype == np.float32 - assert values[0, 0] == pytest.approx(0.3) # the nodata pixel is not averaged in - assert np.isnan(values[1, 1]) # a fully nodata block stays nodata - assert np.isnan(values).sum() == 1 - else: - assert values.dtype == np.uint16 - assert result["b08"].attrs["scale_factor"] == pytest.approx(0.0001) - assert result["b08"].attrs["add_offset"] == pytest.approx(-0.1) - assert result["b08"].encoding["_FillValue"] == 0 - assert values[0, 0] == 4000 # (0.3 + 0.1) / 0.0001: nodata is not averaged in - assert values[1, 1] == 0 # a fully nodata block stays nodata - assert (values == 0).sum() == 1 - - -def test_inject_missing_bands_respects_bands_filter() -> None: - """With bands={"b08"}, only b08 should be injected even when others are eligible.""" - dt = _make_reflectance_datatree() - r20m_ds = dt["measurements/reflectance/r20m"].to_dataset() - - result = inject_missing_bands( - r20m_ds, dt, target_resolution=20, bands={"b08"}, spatial_chunk=1024 - ) - - assert "b08" in result.data_vars - assert result["b08"].shape == (60, 60) - assert result["b08"].dtype == np.uint16 - # b02/b03/b04 are also eligible (10m native, missing from r20m) but excluded - for excluded in ("b02", "b03", "b04"): - assert excluded not in result.data_vars - - -def test_inject_missing_bands_skips_existing() -> None: - """Bands already present in the dataset should not be overwritten.""" - dt = _make_reflectance_datatree() - r20m_ds = dt["measurements/reflectance/r20m"].to_dataset() - - # Pre-populate b08 with a sentinel value so we can verify it is NOT replaced. - sentinel = np.full((60, 60), 999, dtype="uint16") - r20m_ds["b08"] = (["y", "x"], sentinel) - - result = inject_missing_bands( - r20m_ds, dt, target_resolution=20, bands={"b08"}, spatial_chunk=1024 - ) - - # b08 was already present — inject_missing_bands must leave it untouched. - np.testing.assert_array_equal(result["b08"].values, sentinel) - - -def test_inject_missing_bands_noop_when_no_source() -> None: - """If the source group is missing from the DataTree, return dataset unchanged.""" - dt = xr.DataTree() - ds = xr.Dataset({"b05": (["y", "x"], np.ones((60, 60)))}) - - result = inject_missing_bands(ds, dt, target_resolution=20, spatial_chunk=1024) - - assert "b08" not in result.data_vars - - -def test_inject_missing_bands_default_injects_all() -> None: - """With bands=None (default), all eligible finer bands should be injected.""" - size_10m = 120 - x10 = np.arange(size_10m, dtype="float64") - y10 = np.arange(size_10m, dtype="float64") - - r10m_ds = xr.Dataset( - { - "b02": (["y", "x"], np.ones((size_10m, size_10m), dtype="uint16")), - "b03": (["y", "x"], np.ones((size_10m, size_10m), dtype="uint16")), - "b04": (["y", "x"], np.ones((size_10m, size_10m), dtype="uint16")), - "b08": (["y", "x"], np.full((size_10m, size_10m), 42, dtype="uint16")), - }, - coords={"x": x10, "y": y10}, - ) - - size_20m = 60 - x20 = np.arange(size_20m, dtype="float64") - y20 = np.arange(size_20m, dtype="float64") - r20m_ds = xr.Dataset( - { - "b05": (["y", "x"], np.ones((size_20m, size_20m), dtype="uint16")), - "b06": (["y", "x"], np.ones((size_20m, size_20m), dtype="uint16")), - }, - coords={"x": x20, "y": y20}, - ) - - size_60m = 20 - x60 = np.arange(size_60m, dtype="float64") - y60 = np.arange(size_60m, dtype="float64") - r60m_ds = xr.Dataset( - { - "b01": (["y", "x"], np.ones((size_60m, size_60m), dtype="uint16")), - }, - coords={"x": x60, "y": y60}, - ) - - dt = xr.DataTree() - dt["measurements/reflectance/r10m"] = xr.DataTree(r10m_ds) - dt["measurements/reflectance/r20m"] = xr.DataTree(r20m_ds) - dt["measurements/reflectance/r60m"] = xr.DataTree(r60m_ds) - - result = inject_missing_bands(r60m_ds, dt, target_resolution=60, spatial_chunk=1024) - - # All 10m bands (b02, b03, b04, b08) and 20m bands (b05, b06) should be injected - for band in ("b02", "b03", "b04", "b08", "b05", "b06"): - assert band in result.data_vars, f"{band} missing from r60m" - assert result[band].shape == (size_60m, size_60m) diff --git a/tests/test_s2_multiscale_geo_metadata.py b/tests/test_s2_multiscale_geo_metadata.py deleted file mode 100644 index 77143c63..00000000 --- a/tests/test_s2_multiscale_geo_metadata.py +++ /dev/null @@ -1,424 +0,0 @@ -""" -Unit tests for _write_geo_metadata method in S2MultiscalePyramid. - -Tests the geographic metadata writing functionality added to level creation. -""" - -from pathlib import Path -from unittest.mock import patch - -import numpy as np -import pytest -import xarray as xr -import zarr -from zarr_cm import geo_proj -from zarr_cm import spatial as spatial_cm - -from eopf_geozarr.conversion.utils import _rechunk_ds, create_uniform_encoding -from eopf_geozarr.s2_optimization.s2_multiscale import ( - stream_write_s2dataset, - write_geo_metadata, -) - - -@pytest.fixture -def sample_dataset_with_crs() -> xr.Dataset: - """Create a sample dataset with CRS information.""" - coords = { - "x": (["x"], np.linspace(0, 1000, 100)), - "y": (["y"], np.linspace(0, 1000, 100)), - "time": (["time"], [np.datetime64("2023-01-01")]), - } - - data_vars = { - "b02": (["time", "y", "x"], np.random.rand(1, 100, 100)), - "b03": (["time", "y", "x"], np.random.rand(1, 100, 100)), - "b04": (["y", "x"], np.random.rand(100, 100)), - } - - ds = xr.Dataset(data_vars, coords=coords) - - ds["b02"].attrs["proj:epsg"] = 32632 - ds["b03"].attrs["proj:epsg"] = 32632 - ds["b04"].attrs["proj:epsg"] = 32632 - - return ds - - -@pytest.fixture -def sample_dataset_with_epsg_attrs() -> xr.Dataset: - """Create a sample dataset with EPSG in attributes.""" - coords = { - "x": (["x"], np.linspace(0, 1000, 50)), - "y": (["y"], np.linspace(0, 1000, 50)), - } - - data_vars = { - "b05": (["y", "x"], np.random.rand(50, 50)), - "b06": (["y", "x"], np.random.rand(50, 50)), - } - - ds = xr.Dataset(data_vars, coords=coords) - - # Add EPSG to variable attributes - ds["b05"].attrs["proj:epsg"] = 32632 - ds["b06"].attrs["proj:epsg"] = 32632 - - return ds - - -@pytest.fixture -def sample_dataset_no_crs() -> xr.Dataset: - """Create a sample dataset without CRS information.""" - coords = { - "x": (["x"], np.linspace(0, 1000, 25)), - "y": (["y"], np.linspace(0, 1000, 25)), - } - - data_vars = { - "b11": (["y", "x"], np.random.rand(25, 25)), - "b12": (["y", "x"], np.random.rand(25, 25)), - } - - return xr.Dataset(data_vars, coords=coords) - - -class TestWriteGeoMetadata: - """Test the _write_geo_metadata method.""" - - def test_write_geo_metadata_with_rio_crs(self, sample_dataset_with_crs: xr.Dataset) -> None: - """Test _write_geo_metadata with dataset that has rioxarray CRS.""" - - # Call the method - write_geo_metadata(sample_dataset_with_crs) - - # Verify CRS was written - assert hasattr(sample_dataset_with_crs, "rio") - assert sample_dataset_with_crs.rio.crs is not None - assert sample_dataset_with_crs.rio.crs.to_epsg() == 32632 - - def test_write_geo_metadata_with_epsg_attrs( - self, sample_dataset_with_epsg_attrs: xr.Dataset - ) -> None: - """Test _write_geo_metadata with dataset that has EPSG in variable attributes.""" - - # Verify initial state - no CRS - assert ( - not hasattr(sample_dataset_with_epsg_attrs, "rio") - or sample_dataset_with_epsg_attrs.rio.crs is None - ) - - # Call the method - write_geo_metadata(sample_dataset_with_epsg_attrs) - - # Verify CRS was written from attributes - assert hasattr(sample_dataset_with_epsg_attrs, "rio") - assert sample_dataset_with_epsg_attrs.rio.crs is not None - assert sample_dataset_with_epsg_attrs.rio.crs.to_epsg() == 32632 - - def test_write_geo_metadata_no_crs(self, sample_dataset_no_crs: xr.Dataset) -> None: - """Test _write_geo_metadata with dataset that has no CRS information.""" - - # Verify initial state - no CRS - assert not hasattr(sample_dataset_no_crs, "rio") or sample_dataset_no_crs.rio.crs is None - - # Call the method - should not fail but also not add CRS - write_geo_metadata(sample_dataset_no_crs) - - # Verify no CRS was added (method handles gracefully) - # The method should not fail even when no CRS is available - # This tests the robustness of the method - - def test_write_geo_metadata_custom_grid_mapping_name( - self, sample_dataset_with_crs: xr.Dataset - ) -> None: - """Test _write_geo_metadata with custom grid_mapping variable name.""" - - # Call the method with custom grid mapping name - custom_name = "custom_spatial_ref" - write_geo_metadata(sample_dataset_with_crs, custom_name) - - # Verify CRS was written - assert hasattr(sample_dataset_with_crs, "rio") - assert sample_dataset_with_crs.rio.crs is not None - - def test_write_geo_metadata_preserves_existing_data( - self, sample_dataset_with_crs: xr.Dataset - ) -> None: - """Test that _write_geo_metadata preserves existing data variables and coordinates.""" - - # Store original data - original_vars = list(sample_dataset_with_crs.data_vars.keys()) - original_coords = list(sample_dataset_with_crs.coords.keys()) - original_b02_data = sample_dataset_with_crs["b02"].values.copy() - - # Call the method - write_geo_metadata(sample_dataset_with_crs) - - # Verify all original data is preserved - assert list(sample_dataset_with_crs.data_vars.keys()) == original_vars - assert all(coord in sample_dataset_with_crs.coords for coord in original_coords) - assert np.array_equal(sample_dataset_with_crs["b02"].values, original_b02_data) - - def test_write_geo_metadata_empty_dataset(self) -> None: - """An empty dataset has no data variable to detect a CRS from, so - `write_geo_metadata` must no-op rather than raise or write metadata - for a CRS it never found.""" - - # addition of writing geo metadata to empty dataset should be empty - - empty_ds = xr.Dataset({}, coords={}) - - write_geo_metadata(empty_ds) - - assert empty_ds.attrs == {} - - def test_write_geo_metadata_rio_write_crs_called( - self, sample_dataset_with_crs: xr.Dataset - ) -> None: - """Test that rio.write_crs is called correctly.""" - - # Mock the rio.write_crs method - with patch.object(sample_dataset_with_crs.rio, "write_crs") as mock_write_crs: - # Call the method - write_geo_metadata(sample_dataset_with_crs) - - # Verify rio.write_crs was called with correct arguments - mock_write_crs.assert_called_once() - call_args = mock_write_crs.call_args - assert call_args[1]["inplace"] is True # inplace=True should be passed - - def test_write_geo_metadata_crs_from_multiple_sources(self) -> None: - """Test CRS detection from multiple sources in priority order.""" - - # Create dataset with both rio CRS and EPSG attributes - coords = { - "x": (["x"], np.linspace(0, 1000, 50)), - "y": (["y"], np.linspace(0, 1000, 50)), - } - - data_vars = {"b08": (["y", "x"], np.random.rand(50, 50))} - - ds = xr.Dataset(data_vars, coords=coords) - - # Add both rio CRS and EPSG attribute (rio should take priority) - ds = ds.rio.write_crs("EPSG:4326") # Rio CRS - ds["b08"].attrs["proj:epsg"] = 32632 # EPSG attribute - - # Call the method - write_geo_metadata(ds) - - # Verify rio CRS was used (priority over attributes) - assert ds.rio.crs.to_epsg() == 4326 # Should still be 4326, not 32632 - - def test_write_geo_metadata_integration_with_stream_write(self, tmp_path: Path) -> None: - """Test that _write_geo_metadata is properly integrated in _stream_write_dataset.""" - - # Create a simple dataset with CRS - coords = { - "x": (["x"], np.linspace(0, 1000, 100)), - "y": (["y"], np.linspace(0, 1000, 100)), - } - - data_vars = { - "b02": (["y", "x"], np.random.rand(100, 100)), - } - - ds = xr.Dataset(data_vars, coords=coords) - ds = ds.rio.write_crs("EPSG:32632") - - ds = _rechunk_ds(ds, spatial_chunk=1024) - - # Create encoding for the dataset - encoding = create_uniform_encoding(ds, enable_sharding=True) - - # Call _stream_write_dataset (which should call _write_geo_metadata internally) - # Use a measurements path to trigger geo metadata writing - dataset_path = "/measurements/reflectance/r10m" - stream_write_s2dataset( - ds, - path=dataset_path, - group=zarr.create_group(tmp_path), - encoding=encoding, - enable_sharding=True, - ) - - # Re-open the written dataset to verify CRS was persisted - written_ds = xr.open_dataset( - tmp_path, engine="zarr", chunks={}, decode_coords="all", group=dataset_path - ) - - # Verify CRS was written and persisted - assert hasattr(written_ds, "rio") - assert written_ds.rio.crs is not None - assert written_ds.rio.crs.to_epsg() == 32632 - - def test_write_geo_metadata_prefers_coordinate_transform_for_inconsistent_rio(self) -> None: - """Derived datasets should derive spatial:transform from current coordinates.""" - - x = 600030.0 + np.arange(3, dtype="float64") * 120.0 - y = 4899990.0 - np.arange(3, dtype="float64") * 120.0 - ds = xr.Dataset( - {"b01": (["y", "x"], np.ones((3, 3), dtype=np.uint16))}, - coords={"x": x, "y": y}, - ).rio.write_crs("EPSG:32631") - - def stale_transform() -> tuple[float, float, float, float, float, float]: - return (60.0, 0.0, 600030.0, 0.0, -60.0, 4899990.0) - - with patch.object(ds.rio, "transform", stale_transform): - write_geo_metadata(ds) - - # Origin is the outer pixel edge: half of the 120 m pixel outside the first centre. - assert ds.attrs["spatial:transform"] == [120.0, 0.0, 599970.0, 0.0, -120.0, 4900050.0] - assert ds.attrs["spatial:bbox"] == [599970.0, 4899690.0, 600330.0, 4900050.0] - - -class TestWriteGeoMetadataEdgeCases: - """Test edge cases for _write_geo_metadata method.""" - - def test_write_geo_metadata_invalid_crs( - self, - ) -> None: - """Test _write_geo_metadata with invalid CRS data.""" - - coords = { - "x": (["x"], np.linspace(0, 1000, 10)), - "y": (["y"], np.linspace(0, 1000, 10)), - } - - data_vars = {"test_var": (["y", "x"], np.random.rand(10, 10))} - - ds = xr.Dataset(data_vars, coords=coords) - - # Add invalid EPSG code - ds["test_var"].attrs["proj:epsg"] = "invalid_epsg" - - # Method should raise an exception for invalid CRS (normal behavior) - from pyproj.exceptions import CRSError - - with pytest.raises(CRSError): - write_geo_metadata(ds) - - def test_write_geo_metadata_mixed_crs_variables( - self, - ) -> None: - """Test _write_geo_metadata with variables having different CRS information.""" - - coords = { - "x": (["x"], np.linspace(0, 1000, 20)), - "y": (["y"], np.linspace(0, 1000, 20)), - } - - data_vars = { - "var1": (["y", "x"], np.random.rand(20, 20)), - "var2": (["y", "x"], np.random.rand(20, 20)), - } - - ds = xr.Dataset(data_vars, coords=coords) - - # Add different EPSG codes to different variables - ds["var1"].attrs["proj:epsg"] = 32632 - ds["var2"].attrs["proj:epsg"] = 4326 - - # Call the method (should use the first CRS found) - write_geo_metadata(ds) - - # Verify a CRS was applied (should be the first one found) - assert hasattr(ds, "rio") - - def test_write_geo_metadata_maintains_dataset_attrs( - self, sample_dataset_with_crs: xr.Dataset - ) -> None: - """Test that _write_geo_metadata maintains dataset-level attributes.""" - - # Add some dataset attributes - sample_dataset_with_crs.attrs["pyramid_level"] = 1 - sample_dataset_with_crs.attrs["resolution_meters"] = 20 - sample_dataset_with_crs.attrs["custom_attr"] = "test_value" - - original_attrs = sample_dataset_with_crs.attrs.copy() - - # Call the method - write_geo_metadata(sample_dataset_with_crs) - - # Verify dataset attributes are preserved - for key, value in original_attrs.items(): - assert sample_dataset_with_crs.attrs[key] == value - - def test_write_geo_metadata_adds_zarr_conventions( - self, sample_dataset_with_crs: xr.Dataset - ) -> None: - """Test that zarr_conventions are properly added to dataset attributes.""" - - # Verify zarr_conventions is not initially present - assert "zarr_conventions" not in sample_dataset_with_crs.attrs - - # Call the method - write_geo_metadata(sample_dataset_with_crs) - - # Verify zarr_conventions was added - assert "zarr_conventions" in sample_dataset_with_crs.attrs - zarr_conventions = sample_dataset_with_crs.attrs["zarr_conventions"] - - # Verify it's a list with 2 conventions - assert isinstance(zarr_conventions, list) - assert len(zarr_conventions) == 2 - - # Verify the conventions contain the expected metadata - spatial_convention = None - proj_convention = None - - for convention in zarr_conventions: - if convention.get("name") == "spatial": - spatial_convention = convention - elif convention.get("name") == "proj": - proj_convention = convention - - # Verify spatial convention - assert spatial_convention is not None - expected_spatial = spatial_cm.CMO - assert spatial_convention == expected_spatial - - # Verify proj convention - assert proj_convention is not None - expected_proj = geo_proj.CMO - assert proj_convention == expected_proj - - def test_write_geo_metadata_adds_spatial_and_proj_attributes( - self, sample_dataset_with_crs: xr.Dataset - ) -> None: - """Test that spatial and proj attributes are added along with conventions.""" - - # Call the method - write_geo_metadata(sample_dataset_with_crs) - - # Verify spatial attributes - assert "spatial:dimensions" in sample_dataset_with_crs.attrs - assert sample_dataset_with_crs.attrs["spatial:dimensions"] == ["y", "x"] - assert "spatial:registration" in sample_dataset_with_crs.attrs - assert sample_dataset_with_crs.attrs["spatial:registration"] == "pixel" - assert "spatial:bbox" in sample_dataset_with_crs.attrs - assert "spatial:shape" in sample_dataset_with_crs.attrs - - # Verify proj attributes (should have either proj:code or proj:wkt2) - has_proj_code = "proj:code" in sample_dataset_with_crs.attrs - has_proj_wkt2 = "proj:wkt2" in sample_dataset_with_crs.attrs - assert has_proj_code or has_proj_wkt2, "Should have either proj:code or proj:wkt2" - - # Verify zarr_conventions includes both spatial and proj - zarr_conventions = sample_dataset_with_crs.attrs["zarr_conventions"] - convention_names = [conv.get("name") for conv in zarr_conventions] - assert "spatial" in convention_names - assert "proj" in convention_names - - def test_write_geo_metadata_no_crs_no_conventions( - self, sample_dataset_no_crs: xr.Dataset - ) -> None: - """Test that zarr_conventions are not added when no CRS is available.""" - - # Call the method with no CRS - write_geo_metadata(sample_dataset_no_crs) - - # Verify zarr_conventions was not added since no CRS was available - assert "zarr_conventions" not in sample_dataset_no_crs.attrs diff --git a/tests/test_titiler_integration.py b/tests/test_titiler_integration.py index 925e019e..443cd307 100644 --- a/tests/test_titiler_integration.py +++ b/tests/test_titiler_integration.py @@ -27,6 +27,8 @@ from starlette.testclient import TestClient from titiler.xarray.factory import TilerFactory +from eopf_geozarr.s2_optimization.s2_converter import convert_s2_optimized + s2_source_path = pathlib.Path("/tmp/s2_source.zarr") pytestmark = [ @@ -44,8 +46,6 @@ def converted_s2_path() -> pathlib.Path: This fixture is module-scoped so the conversion only runs once for all tests. """ - from eopf_geozarr.s2_optimization.s2_converter import convert_s2 - tmpdir = tempfile.mkdtemp(prefix="titiler_test_") output_path = str(pathlib.Path(tmpdir) / "s2_optimized.zarr") @@ -55,12 +55,10 @@ def converted_s2_path() -> pathlib.Path: chunks="auto", ) - convert_s2( + convert_s2_optimized( dt_input, output_path=output_path, validate_output=False, - enable_sharding=False, - spatial_chunk=512, ) return pathlib.Path(output_path) From 611a83fad59423e52f547eff1cc03bbf778aa3a8 Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Thu, 29 Oct 2026 10:09:27 +0100 Subject: [PATCH 11/45] feat(data-api): read DataTree inputs through a GroupSpec-shaped view and drop the scratch copy The converter no longer materializes in-memory or Zarr V3-backed trees to a scratch Zarr V2 store. New `pyz.datatree` is the DataTree analogue of `GroupSpec.from_zarr`: `group_spec_from_datatree` extracts a tree's metadata plane as the Zarr V2 documents xarray's own zarr writer would store (every variable through `encode_zarr_variable`, CF packing applied, storage-layout encoding keys dropped), so `Sentinel2Root` validates a tree's named members and typed attributes exactly as it validates a store. `load_sentinel2` accepts a DataTree, and `write_geozarr` reads the input through a `SourceReader` protocol with a zarr-store and a DataTree implementation, the latter reading values in the same encoded form. A parity test pins the equivalence: on the seeded Sentinel-2 fixtures, the tree source writes the same store as the zarr-store source, chunk for chunk, whether the tree holds the raw packed values or the decoded ones (which the reader re-encodes as xarray would have on a store write). Assisted-by: ClaudeCode:claude-fable-5 Co-Authored-By: Claude Fable 5 --- src/eopf_geozarr/data_api/s2_plan.py | 21 +- src/eopf_geozarr/data_api/s2_write.py | 180 ++++++++++++------ src/eopf_geozarr/pyz/datatree.py | 106 +++++++++++ .../s2_optimization/s2_converter.py | 75 ++------ tests/test_data_api/test_s2_write.py | 58 +++++- 5 files changed, 325 insertions(+), 115 deletions(-) create mode 100644 src/eopf_geozarr/pyz/datatree.py diff --git a/src/eopf_geozarr/data_api/s2_plan.py b/src/eopf_geozarr/data_api/s2_plan.py index d0e58dba..761fc34a 100644 --- a/src/eopf_geozarr/data_api/s2_plan.py +++ b/src/eopf_geozarr/data_api/s2_plan.py @@ -39,6 +39,7 @@ from typing import TYPE_CHECKING, Any, Final, Literal import numpy as np +import xarray as xr from pydantic_zarr.v2 import GroupSpec as GroupSpecV2 from pydantic_zarr.v3 import ArraySpec as ArraySpecV3 from pydantic_zarr.v3 import GroupSpec as GroupSpecV3 @@ -53,6 +54,7 @@ from eopf_geozarr.data_api.geozarr.v3 import DataArray from eopf_geozarr.data_api.s2 import Sentinel2Root +from eopf_geozarr.pyz.datatree import group_spec_from_datatree from eopf_geozarr.s2_optimization.s2_multiscale import SCL_ATTRS, SCL_NODATA if TYPE_CHECKING: @@ -122,16 +124,25 @@ _CRC32C: Final[Crc32cCodecObject] = {"name": "crc32c"} -def load_sentinel2(group: zarr.Group) -> Sentinel2Root: +def load_sentinel2(source: zarr.Group | xr.DataTree) -> Sentinel2Root: """ - Read a Zarr group into the validated `Sentinel2Root` input model. + Read a Zarr group or an xarray DataTree into the validated + `Sentinel2Root` input model. The model is the carrier for the conversion: it holds exactly the members and attributes the GeoZarr plan reads, validated (member structure by the - closed TypedDicts, attributes by the attribute models). Raises - `pydantic.ValidationError` when the group is not a Sentinel-2 product. + closed TypedDicts, attributes by the attribute models). A DataTree is + read through its GroupSpec-shaped view (`group_spec_from_datatree`), so a + tree built in memory or backed by a non-V2 store validates like a V2 + store does. Raises `pydantic.ValidationError` when the source is not a + Sentinel-2 product. """ - return Sentinel2Root.model_validate(GroupSpecV2.from_zarr(group).model_dump()) + spec = ( + group_spec_from_datatree(source) + if isinstance(source, xr.DataTree) + else GroupSpecV2.from_zarr(source) + ) + return Sentinel2Root.model_validate(spec.model_dump()) def product_level(root: Sentinel2Root) -> S2Level: diff --git a/src/eopf_geozarr/data_api/s2_write.py b/src/eopf_geozarr/data_api/s2_write.py index 400226e1..f8d154ea 100644 --- a/src/eopf_geozarr/data_api/s2_write.py +++ b/src/eopf_geozarr/data_api/s2_write.py @@ -5,7 +5,11 @@ describes, without xarray's DataTree writer. The planned metadata documents are written first, via pydantic-zarr's `to_zarr`, so every stored document is exactly the plan; the chunk data is then filled in with zarr-python alone. -Native arrays are copied from the input store, and the derived arrays are +The input is read through a small `SourceReader` protocol — a Zarr V2 store +directly, or an xarray DataTree whose variables are read as xarray's zarr +writer would store them (CF-encoded), so a tree built in memory or backed by +a Zarr V3 store feeds the writer without a scratch copy. +Native arrays are copied from the input, and the derived arrays are block-resampled with the converter's arithmetic: injected bands come from the finest input level that holds them, generated pyramid levels are chained from the level before them, measurements and probabilities are reduced by the @@ -23,13 +27,15 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Protocol import numpy as np +import xarray as xr import zarr from pydantic_zarr.v3 import is_group_spec from eopf_geozarr.data_api.s2_plan import plan_geozarr +from eopf_geozarr.pyz.datatree import encoded_variable from eopf_geozarr.s2_optimization.s2_resampling import determine_variable_type if TYPE_CHECKING: @@ -38,25 +44,111 @@ from eopf_geozarr.data_api.s2 import Sentinel2Root + +class SourceReader(Protocol): + """Read access to the conversion input, by output-plan path.""" + + def values(self, path: str) -> np.ndarray | None: + """The stored values of the array at `path`, or None if there is none.""" + ... + + def is_group(self, path: str) -> bool: + """Whether the input holds a group at `path`.""" + ... + + def group_names(self, path: str) -> tuple[str, ...]: + """The names of the subgroups of the group at `path` (empty if none).""" + ... + + +class ZarrSourceReader: + """`SourceReader` over the Zarr V2 store a product was read from.""" + + def __init__(self, group: zarr.Group) -> None: + self._group = group + + def _member(self, path: str) -> zarr.Group | zarr.Array | None: + try: + return self._group[path] + except KeyError: + return None + + def values(self, path: str) -> np.ndarray | None: + member = self._member(path) + return np.asarray(member[...]) if isinstance(member, zarr.Array) else None + + def is_group(self, path: str) -> bool: + return isinstance(self._member(path), zarr.Group) + + def group_names(self, path: str) -> tuple[str, ...]: + member = self._member(path) + return tuple(member.group_keys()) if isinstance(member, zarr.Group) else () + + +class DataTreeSourceReader: + """ + `SourceReader` over an xarray DataTree (a tree built in memory, or one + backed by a store in any zarr format). Values are read as xarray's zarr + writer would store them: CF-encoded, with `_FillValue` applied — the same + representation `group_spec_from_datatree` documents. + """ + + def __init__(self, tree: xr.DataTree) -> None: + self._tree = tree + + def _node(self, path: str) -> xr.DataTree | None: + if not path: + return self._tree + try: + member = self._tree[path] + except KeyError: + return None + return member if isinstance(member, xr.DataTree) else None + + def values(self, path: str) -> np.ndarray | None: + node_path, _, name = path.rpartition("/") + node = self._node(node_path) + if node is None: + return None + variables = node.to_dataset(inherit=False).variables + if name not in variables: + return None + return np.asarray(encoded_variable(name, variables[name]).values) + + def is_group(self, path: str) -> bool: + return self._node(path) is not None + + def group_names(self, path: str) -> tuple[str, ...]: + node = self._node(path) + return tuple(node.children) if node is not None else () + + #: Rows per stripe for the streamed block mean (a multiple of the coarsening #: factor is taken per stripe, so windows never straddle a stripe boundary). _MEAN_STRIPE_ROWS = 2048 -def write_geozarr(root: Sentinel2Root, source: zarr.Group, store: Store | str) -> AnyGroupSpec: +def write_geozarr( + root: Sentinel2Root, source: zarr.Group | xr.DataTree, store: Store | str +) -> AnyGroupSpec: """ Write the GeoZarr hierarchy planned from `root` to `store`, copying and - resampling chunk data from `source` (the Zarr V2 input store `root` was - read from). Returns the plan that was written. + resampling chunk data from `source` — the Zarr V2 input store or the + xarray DataTree `root` was read from. Returns the plan that was written. """ + reader: SourceReader = ( + DataTreeSourceReader(source) + if isinstance(source, xr.DataTree) + else ZarrSourceReader(source) + ) plan = plan_geozarr(root) # the metadata plane: every group and array document, exactly as planned output = plan.to_zarr(store, path="") # type: ignore[arg-type] - _fill_group(plan, source, output, "") + _fill_group(plan, reader, output, "") return plan -def _fill_group(spec: AnyGroupSpec, source: zarr.Group, output: zarr.Group, path: str) -> None: +def _fill_group(spec: AnyGroupSpec, source: SourceReader, output: zarr.Group, path: str) -> None: """Fill the data of every array under one planned group (recursively).""" for name, member in spec.members.items(): member_path = f"{path}/{name}".lstrip("/") @@ -70,23 +162,23 @@ def _fill_group(spec: AnyGroupSpec, source: zarr.Group, output: zarr.Group, path _fill_carried_array(source, output, member_path) -def _fill_carried_array(source: zarr.Group, output: zarr.Group, path: str) -> None: - """Copy one carried array's data from the input store (grid mappings hold 0).""" +def _fill_carried_array(source: SourceReader, output: zarr.Group, path: str) -> None: + """Copy one carried array's data from the input (grid mappings hold 0).""" out_array = _output_array(output, path) if path.rsplit("/", 1)[-1] == "spatial_ref": out_array[...] = 0 return - src_array = _input_array(source, path) - if src_array is None: - msg = f"The input store holds no array at {path!r}" + values = source.values(path) + if values is None: + msg = f"The input source holds no array at {path!r}" raise ValueError(msg) - out_array[...] = src_array[:] + out_array[...] = values -def _fill_pyramid(spec: AnyGroupSpec, source: zarr.Group, output: zarr.Group, path: str) -> None: +def _fill_pyramid(spec: AnyGroupSpec, source: SourceReader, output: zarr.Group, path: str) -> None: """ Fill one multiscale subtree, finest level first: native levels are copied - from the input store (with their injected bands resampled from the finest + from the input (with their injected bands resampled from the finest input level that holds them), and generated levels are chained from the data of the level before them, as the converter chains them. """ @@ -101,7 +193,7 @@ def _fill_pyramid(spec: AnyGroupSpec, source: zarr.Group, output: zarr.Group, pa raise TypeError(msg) meters = _level_meters(level_name) level_path = f"{path}/{level_name}" - native = _input_group(source, level_path) is not None + native = source.is_group(level_path) data: dict[str, np.ndarray] = {} coords: dict[str, np.ndarray] = {} for var, member in level_spec.members.items(): @@ -137,7 +229,7 @@ def _fill_pyramid(spec: AnyGroupSpec, source: zarr.Group, output: zarr.Group, pa def _level_variable( member: AnyArraySpec | AnyGroupSpec, - source: zarr.Group, + source: SourceReader, var: str, base_path: str, level_path: str, @@ -149,18 +241,18 @@ def _level_variable( ) -> np.ndarray: """The data of one pyramid-level variable: copied, injected, or chained.""" if native: - src_array = _input_array(source, f"{level_path}/{var}") - if src_array is not None: - return np.asarray(src_array[:]) + values = source.values(f"{level_path}/{var}") + if values is not None: + return values # an injected band: resample from the finest input level that holds it injected = _finest_input_source(source, base_path, var, meters) if injected is None: msg = f"No input level finer than {meters} m holds the injected band {var!r}" raise ValueError(msg) - src_array, src_meters = injected - return _coarsen(np.asarray(src_array[:]), meters // src_meters, var, _integer_fill(member)) + src_values, src_meters = injected + return _coarsen(src_values, meters // src_meters, var, _integer_fill(member)) if previous_meters is None: - msg = f"The finest planned level {level_path} is missing from the input store" + msg = f"The finest planned level {level_path} is missing from the input source" raise ValueError(msg) if var not in previous_data: msg = f"Variable {var!r} of generated level {level_path} is missing from the previous level" @@ -169,7 +261,7 @@ def _level_variable( def _level_coordinate( - source: zarr.Group, + source: SourceReader, coord_path: str, previous: np.ndarray | None, meters: int, @@ -179,11 +271,11 @@ def _level_coordinate( ) -> np.ndarray: """A level's x/y values: the input's at native levels, window means after.""" if native: - src_array = _input_array(source, coord_path) - if src_array is None: - msg = f"The input store holds no coordinate array at {coord_path!r}" + values = source.values(coord_path) + if values is None: + msg = f"The input source holds no coordinate array at {coord_path!r}" raise ValueError(msg) - return np.asarray(src_array[:]) + return values if previous is None or previous_meters is None: msg = f"No previous level to derive the coordinate at {coord_path!r} from" raise ValueError(msg) @@ -238,22 +330,20 @@ def _window_mean(windows: np.ndarray, fill: int | None) -> np.ndarray: def _finest_input_source( - source: zarr.Group, base_path: str, var: str, meters: int -) -> tuple[zarr.Array, int] | None: + source: SourceReader, base_path: str, var: str, meters: int +) -> tuple[np.ndarray, int] | None: """The finest input level of this subtree holding `var`, with its metres.""" - base = _input_group(source, base_path) - if base is None: - return None candidates = sorted( - (name for name in base.group_keys() if _is_level_name(name)), key=_level_meters + (name for name in source.group_names(base_path) if _is_level_name(name)), + key=_level_meters, ) for name in candidates: src_meters = _level_meters(name) if src_meters >= meters: return None - member = _input_array(source, f"{base_path}/{name}/{var}") - if member is not None: - return member, src_meters + values = source.values(f"{base_path}/{name}/{var}") + if values is not None: + return values, src_meters return None @@ -271,22 +361,6 @@ def _is_level_name(name: str) -> bool: return name.startswith("r") and name.endswith("m") and name[1:-1].isdigit() -def _input_group(source: zarr.Group, path: str) -> zarr.Group | None: - try: - member = source[path] - except KeyError: - return None - return member if isinstance(member, zarr.Group) else None - - -def _input_array(source: zarr.Group, path: str) -> zarr.Array | None: - try: - member = source[path] - except KeyError: - return None - return member if isinstance(member, zarr.Array) else None - - def _output_array(output: zarr.Group, path: str) -> zarr.Array: member = output[path] if not isinstance(member, zarr.Array): diff --git a/src/eopf_geozarr/pyz/datatree.py b/src/eopf_geozarr/pyz/datatree.py new file mode 100644 index 00000000..03f37a71 --- /dev/null +++ b/src/eopf_geozarr/pyz/datatree.py @@ -0,0 +1,106 @@ +""" +A GroupSpec-shaped view of an xarray DataTree. + +`group_spec_from_datatree` is the DataTree analogue of +`pydantic_zarr.v2.GroupSpec.from_zarr`: it extracts the metadata plane of a +DataTree — named members, shapes, dtypes, and attributes — as the Zarr V2 +documents xarray's own zarr writer would store. A typed input model (such as +the Sentinel-2 `Sentinel2Root`) can then validate a tree exactly as it +validates a store, without materializing the tree to a scratch store first. + +The documents describe the variables as *stored*, not as decoded: every +variable goes through xarray's `encode_zarr_variable` (CF packing applied, +`_FillValue` masked, dtypes cast), with the storage-layout encoding keys a +tree read from a store carries (chunks, compressors, a V3 `serializer`, ...) +dropped first, so no source-store layout leaks into the documents. The +storage fields of the emitted array documents are neutral for the same +reason: whole-array chunks, no compressor or filters. +""" + +from __future__ import annotations + +from typing import TYPE_CHECKING + +from pydantic_zarr.v2 import ArraySpec, GroupSpec +from xarray.backends.zarr import encode_zarr_attr_value, encode_zarr_variable +from xarray.conventions import encode_dataset_coordinates + +if TYPE_CHECKING: + import xarray as xr + from pydantic_zarr.v2 import AnyArraySpec, AnyGroupSpec + +#: Per-variable encoding keys that tie a variable to its source store's zarr +#: format and layout; everything else (dtype, CF packing, fill) is kept. +ZARR_STORAGE_ENCODING_KEYS = ( + "chunks", + "preferred_chunks", + "compressor", + "compressors", + "filters", + "serializer", + "shards", +) + + +def encoded_variable(name: str, variable: xr.Variable) -> xr.Variable: + """ + The variable as xarray's zarr writer would store it: CF-encoded (packed + dtype, `_FillValue` applied, attributes serialized), with the + storage-layout encoding keys dropped so the layout of the store the tree + was read from does not leak through. + """ + cleaned = variable.copy(deep=False) + cleaned.encoding = { + key: value + for key, value in cleaned.encoding.items() + if key not in ZARR_STORAGE_ENCODING_KEYS + } + return encode_zarr_variable(cleaned, name=name) + + +def array_spec_from_variable(name: str, variable: xr.Variable) -> AnyArraySpec: + """ + The Zarr V2 array document describing one variable as stored: the encoded + dtype and attributes (with `_ARRAY_DIMENSIONS` carrying the dims and the + `_FillValue` attribute lifted into the document's fill value, as xarray's + zarr writer stores them), and neutral storage fields. + """ + encoded = encoded_variable(name, variable) + attributes: dict[str, object] = { + str(key): encode_zarr_attr_value(value) for key, value in encoded.attrs.items() + } + fill = attributes.pop("_FillValue", None) + if not (fill is None or isinstance(fill, bool | int | float | str)): + msg = f"The _FillValue of variable {name!r} is not storable in a document: {fill!r}" + raise TypeError(msg) + attributes["_ARRAY_DIMENSIONS"] = [str(dim) for dim in encoded.dims] + return ArraySpec( + shape=tuple(encoded.shape), + chunks=tuple(encoded.shape), + dtype=encoded.dtype.str, + fill_value=fill, + order="C", + filters=None, + compressor=None, + dimension_separator="/", + attributes=attributes, + ) + + +def group_spec_from_datatree(tree: xr.DataTree) -> AnyGroupSpec: + """ + The DataTree analogue of `GroupSpec.from_zarr`: the tree's metadata plane + as a Zarr V2 `GroupSpec`, each node a group document (its own attributes + and variables only — inherited coordinates stay with their ancestor, as a + written store keeps them). + """ + dataset = tree.to_dataset(inherit=False) + variables, group_attrs = encode_dataset_coordinates(dataset) + members: dict[str, AnyArraySpec | AnyGroupSpec] = { + str(name): array_spec_from_variable(str(name), variable) + for name, variable in variables.items() + } + for child_name, child in tree.children.items(): + members[str(child_name)] = group_spec_from_datatree(child) + attributes = {str(key): encode_zarr_attr_value(value) for key, value in group_attrs.items()} + return GroupSpec(attributes=attributes, members=members) diff --git a/src/eopf_geozarr/s2_optimization/s2_converter.py b/src/eopf_geozarr/s2_optimization/s2_converter.py index b7a50ddb..fc03cd7c 100644 --- a/src/eopf_geozarr/s2_optimization/s2_converter.py +++ b/src/eopf_geozarr/s2_optimization/s2_converter.py @@ -4,10 +4,8 @@ from __future__ import annotations -import tempfile import time from collections.abc import Mapping -from pathlib import Path from typing import TYPE_CHECKING, Any, TypedDict, cast import structlog @@ -180,9 +178,11 @@ def convert_s2_optimized( values; a deviating value is refused. Args: - dt_input: Input Sentinel-2 DataTree. A tree opened from a Zarr store - is read through its backing store; a tree built in memory (the - CPM SAFE reader) is first materialized to a scratch store. + dt_input: Input Sentinel-2 DataTree. A tree opened from a Zarr V2 + store is read through its backing store; any other tree (built in + memory by the CPM SAFE reader, or backed by a Zarr V3 store) is + read through the tree itself, with its variables taken as + xarray's zarr writer would store them. output_path: Output path enable_sharding: Must be True (the plan's policy). spatial_chunk: Must be 1024 (the plan's policy). @@ -227,31 +227,23 @@ def convert_s2_optimized( # Initialize CRS from dataset crs = initialize_crs_from_dataset(dt_input) - with tempfile.TemporaryDirectory() as scratch: - try: - source: zarr.Group | None = get_zarr_group(dt_input) - except TypeError: - # A tree built in memory (the CPM SAFE reader) has no backing store. - source = None - if source is not None and source.metadata.zarr_format != 2: - # The Sentinel-2 input model reads Zarr V2 EOPF products; a tree - # backed by another format goes through the same scratch copy as - # an in-memory tree (reading V3 inputs natively is a follow-up on - # the input model). - source = None - if source is None: - log.info("Materializing the input to a scratch Zarr V2 store for the plan-driven writer") - scratch_path = str(Path(scratch) / "input.zarr") - _without_zarr_storage_encoding(dt_input).to_zarr( - scratch_path, zarr_format=2, consolidated=False - ) - source = zarr.open_group(scratch_path, mode="r", zarr_format=2) + try: + backing: zarr.Group | None = get_zarr_group(dt_input) + except TypeError: + # A tree built in memory (the CPM SAFE reader) has no backing store. + backing = None + # A Zarr V2 store is the input model's native domain and is read directly; + # everything else (an in-memory tree, a V3-backed tree) is read through + # the tree's GroupSpec-shaped view — no scratch copy. + source: zarr.Group | xr.DataTree = ( + backing if backing is not None and backing.metadata.zarr_format == 2 else dt_input + ) - log.info("Step 1: Validating the input against the Sentinel-2 model") - root = load_sentinel2(source) + log.info("Step 1: Validating the input against the Sentinel-2 model") + root = load_sentinel2(source) - log.info("Step 2: Writing the planned GeoZarr hierarchy") - plan = write_geozarr(root, source, output_path) + log.info("Step 2: Writing the planned GeoZarr hierarchy") + plan = write_geozarr(root, source, output_path) # Step 3: Root-level consolidation log.info("Step 3: Final root-level metadata consolidation") @@ -281,33 +273,6 @@ def convert_s2_optimized( return result_dt -#: Per-variable encoding keys that tie a variable to its source store's zarr -#: format and layout; everything else (dtype, CF packing, fill) is kept. -_ZARR_STORAGE_ENCODING_KEYS = ( - "chunks", - "preferred_chunks", - "compressor", - "compressors", - "filters", - "serializer", - "shards", -) - - -def _without_zarr_storage_encoding(dt_input: xr.DataTree) -> xr.DataTree: - """Drop the zarr storage encoding a tree read from a store carries, so the - tree can be materialized to a scratch Zarr V2 store whatever format it was - read from (a V3 `serializer`, say, is refused by a V2 write).""" - - def clean(ds: xr.Dataset) -> xr.Dataset: - for variable in ds.variables.values(): - for key in _ZARR_STORAGE_ENCODING_KEYS: - variable.encoding.pop(key, None) - return ds - - return dt_input.map_over_datasets(clean) - - def _planned_dataset_index(plan: AnyGroupSpec) -> dict[str, tuple[str, ...] | None]: """ The planned dataset paths, each mapped to its data variable names (an diff --git a/tests/test_data_api/test_s2_write.py b/tests/test_data_api/test_s2_write.py index 6963fce4..3b47c66f 100644 --- a/tests/test_data_api/test_s2_write.py +++ b/tests/test_data_api/test_s2_write.py @@ -11,11 +11,14 @@ from __future__ import annotations +import hashlib +import json import warnings from typing import TYPE_CHECKING import numpy as np import pytest +import xarray as xr import zarr from pydantic_zarr.v3 import GroupSpec as GroupSpecV3 @@ -27,6 +30,8 @@ if TYPE_CHECKING: import pathlib + from pydantic_zarr.v3 import AnyGroupSpec + # Fallback footprint for coordinate arrays in groups that carry no proj # attributes (geometry, meteorology), where the writer only copies the values. _TILE_X_MIN = 300000.0 @@ -116,7 +121,9 @@ def _seed_input_store(group: zarr.Group) -> None: array[...] = _pattern(array.shape, array.dtype) -def _written_store(source_path: pathlib.Path, tmp_path: pathlib.Path): +def _written_store( + source_path: pathlib.Path, tmp_path: pathlib.Path +) -> tuple[AnyGroupSpec, zarr.Group, zarr.Group]: """Seed the fixture store, write it with `write_geozarr`, open both.""" input_path = create_zarrv2_group_from_json(source_path, tmp_path) _seed_input_store(zarr.open_group(input_path, mode="r+", zarr_format=2)) @@ -221,5 +228,52 @@ def test_write_geozarr_refuses_a_source_missing_the_planned_arrays( input_group = zarr.open_group(input_path, mode="r", zarr_format=2) root = load_sentinel2(input_group) empty_source = zarr.create_group(tmp_path / "empty.zarr", zarr_format=2) - with pytest.raises(ValueError, match="input store"): + with pytest.raises(ValueError, match="input source"): write_geozarr(root, empty_source, str(tmp_path / "out.zarr")) + + +def _store_contents(path: pathlib.Path) -> dict[str, object]: + """Every file of a store: metadata documents as parsed JSON (their key + order is not semantic), chunk files as content digests.""" + contents: dict[str, object] = {} + for file in sorted(path.rglob("*")): + if not file.is_file(): + continue + relative = str(file.relative_to(path)) + if file.name in ("zarr.json", ".zattrs", ".zgroup", ".zarray", ".zmetadata"): + contents[relative] = json.loads(file.read_text()) + else: + contents[relative] = hashlib.sha256(file.read_bytes()).hexdigest() + return contents + + +@pytest.mark.parametrize("source_path", s2_example_json_paths, ids=get_stem) +def test_write_geozarr_from_a_datatree_matches_the_store_write( + source_path: pathlib.Path, tmp_path: pathlib.Path +) -> None: + """ + A DataTree source produces the same store as the Zarr-store source, chunk + for chunk: the tree's GroupSpec-shaped view validates into the same input + model, and the tree reader feeds the writer the same values — whether the + tree holds the raw packed values (`mask_and_scale=False`) or the decoded + ones, which the reader re-encodes as xarray's own writer would. + """ + input_path = create_zarrv2_group_from_json(source_path, tmp_path) + _seed_input_store(zarr.open_group(input_path, mode="r+", zarr_format=2)) + source = zarr.open_group(input_path, mode="r", zarr_format=2) + store_output = tmp_path / "from_store.zarr" + write_geozarr(load_sentinel2(source), source, str(store_output)) + reference = _store_contents(store_output) + + for mask_and_scale in (False, True): + tree = xr.open_datatree( + str(input_path), + engine="zarr", + chunks={}, + consolidated=False, + mask_and_scale=mask_and_scale, + decode_coords="all", + ) + tree_output = tmp_path / f"from_tree_{mask_and_scale}.zarr" + write_geozarr(load_sentinel2(tree), tree, str(tree_output)) + assert _store_contents(tree_output) == reference, f"{mask_and_scale=}" From 6015d7f9adb0a5afcc675d02659a237d77f05403 Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Thu, 29 Oct 2026 11:31:16 +0100 Subject: [PATCH 12/45] fix(s2-optimization): apply the adversarial review's findings Correctness and robustness: - `_window_mean` keeps an all-NaN float window NaN instead of writing 0.0, matching the removed converter's skipna mean and `_coarsen`'s docstring. - `_plan_subtree` carries a mixed group's own arrays alongside its planned subgroups instead of dropping them silently. - `plan_reflectance` raises its deliberate ValueErrors (no band arrays; missing proj:transform/proj:epsg/proj:wkt2 with no product fallback) instead of bare StopIteration/KeyError. Consistency and single sources of truth: - Root consolidation consolidates every multiscale root the plan maps to None, dropping the converter's dependency on the duplicate `_AUX_MULTISCALES` table; the dead `REFLECTANCE_MULTISCALE` is deleted. - The CPM writer forwards spatial_chunk and compression_level to the S2 policy check, so an explicit deviation is refused loudly rather than silently ignored (enable_sharding stays unforwarded: sharding is fixed on and its CPM default of False is indistinguishable from an explicit False). - The pydantic-zarr git source pins the validated commit (9f2e847) instead of floating on main. Snapshots and docs: - The plan snapshots are regenerated from the plan, replacing the snapshot harness's synthetic-tile georeferencing with each product's own; the masking machinery and `_EXACT_PRODUCT` special case are retired, so every product's snapshot comparison is now exact. - The docs drop the removed convert-s2-optimized layout flags, scope --scale-offset-codec to the generic rechunker, document the fixed S2 write policy, and replace the deleted create_multiscale_from_datatree reference with the plan/write API. Assisted-by: ClaudeCode:claude-fable-5 Co-Authored-By: Claude Fable 5 --- README.md | 7 +- docs/api-reference.md | 33 +- docs/converter.md | 40 +- docs/cpm-driver.md | 6 +- docs/examples.md | 12 +- docs/faq.md | 13 +- pyproject.toml | 10 +- src/eopf_geozarr/cpm/writer.py | 12 +- src/eopf_geozarr/data_api/s2_plan.py | 29 +- src/eopf_geozarr/data_api/s2_write.py | 6 +- .../s2_optimization/s2_converter.py | 20 +- .../s2_optimization/s2_multiscale.py | 14 +- ...041_N0511_R122_T32TQM_20251008T122613.json | 476 +++++------ ...131_N0511_R037_T29TPF_20250811T152216.json | 774 +++++++++--------- tests/test_data_api/test_s2_plan.py | 110 +-- tests/test_data_api/test_s2_write.py | 14 + tests/test_s2_converter_simplified.py | 25 +- uv.lock | 4 +- 18 files changed, 826 insertions(+), 779 deletions(-) diff --git a/README.md b/README.md index cc52331e..53a989cc 100644 --- a/README.md +++ b/README.md @@ -89,9 +89,10 @@ for every command, including Sentinel-1 GRD RTC ingestion. - **Native projections**: no reprojection to Web Mercator. - **Multiscale pyramids** for fast visualization at every zoom level. - **Source packing kept**: reflectance stays as packed integers with CF - `scale_factor`/`add_offset`/`_FillValue`, as in the ESA products. - `--scale-offset-codec` stores the packing with the Zarr `scale_offset` + - `cast_value` codecs instead, so Zarr readers get decoded values. + `scale_factor`/`add_offset`/`_FillValue`, as in the ESA products. On the + generic rechunker pipeline, `--scale-offset-codec` stores the packing with + the Zarr `scale_offset` + `cast_value` codecs instead, so Zarr readers get + decoded values. - **Validation**: `eopf-geozarr validate` checks a store against the mini spec. GeoZarr is a set of modular [Zarr conventions](https://geozarr.org/conventions) diff --git a/docs/api-reference.md b/docs/api-reference.md index 0961382d..13f7c0cf 100644 --- a/docs/api-reference.md +++ b/docs/api-reference.md @@ -38,33 +38,36 @@ convert_s2_optimized( dt_input: xr.DataTree, *, output_path: str, - enable_sharding: bool, - spatial_chunk: int, - compression_level: int, - validate_output: bool, + enable_sharding: bool = True, + spatial_chunk: int = 1024, + compression_level: int = 3, + validate_output: bool = True, scale_offset_codec: bool = False, max_retries: int = 3, ) -> xr.DataTree ``` Converts a Sentinel-2 L1C or L2A DataTree to the optimized pyramid -(`r10m` … `r720m`). All arguments after `dt_input` are keyword-only, and all -without a default are required. +(`r10m` … `r720m`). All arguments after `dt_input` are keyword-only. | Argument | Description | |---|---| | `output_path` | Local path or `s3://` URL of the output store. | -| `enable_sharding` | Enable Zarr v3 sharding. | -| `spatial_chunk` | Spatial chunk size (the CLI default is 256). | -| `compression_level` | Blosc zstd level, 1–9. | +| `enable_sharding` | Must be `True` (the default): the write policy fixes sharding on. | +| `spatial_chunk` | Must be `1024` (the default): the policy's inner chunk size. | +| `compression_level` | Must be `3` (the default): the policy's blosc zstd level. | | `validate_output` | Validate the output after writing. | -| `scale_offset_codec` | `False` (default): ESA layout with CF scale attributes. `True`: pack reflectance with the Zarr `scale_offset` + `cast_value` codecs. See [Encoding](converter.md#encoding). | -| `max_retries` | Retries for network operations. | +| `scale_offset_codec` | Must be `False` (the default): the output keeps the ESA layout with CF scale attributes. See [Encoding](converter.md#encoding). | +| `max_retries` | Accepted for compatibility; unused. | + +The layout arguments are accepted only at their defaults — the write policy is +fixed, and a deviating value raises `ValueError`. -`create_multiscale_from_datatree(dt_input, *, output_group, enable_sharding, -spatial_chunk, crs=None, scale_offset_codec=False)` in -`eopf_geozarr.s2_optimization.s2_multiscale` is the lower-level function that -writes the pyramid into an open `zarr.Group`. +The lower-level, spec-level API lives in `eopf_geozarr.data_api`: +`load_sentinel2(source)` validates a Zarr group or an xarray DataTree into the +`Sentinel2Root` input model, `plan_geozarr(root)` derives the output hierarchy +as a Zarr V3 `GroupSpec` tree, and `write_geozarr(root, source, store)` writes +the planned documents and fills in the chunk data. ## Sentinel-3 OLCI: `convert_olci_optimized` diff --git a/docs/converter.md b/docs/converter.md index 1b54a98f..7a20442b 100644 --- a/docs/converter.md +++ b/docs/converter.md @@ -97,19 +97,19 @@ output.zarr/ - Coarser levels also get the finer bands (for example b08 at r20m, and all bands at r60m for L1C), so every level has a complete band set. - Each variable type gets its own resampling: mean for reflectance and - probabilities (nodata excluded), subsampling for classifications, maximum - for quality masks. + probabilities (nodata excluded), subsampling for classifications; quality + masks are carried at their native resolution, not resampled. + +The write layout is fixed: Zarr v3 sharding with 1024-pixel inner chunks, +blosc-zstd level 3, and the ESA packed-integer layout (see +[Encoding](#encoding)). There are no layout options. ```bash -eopf-geozarr convert-s2-optimized S2B_MSIL2A_….zarr output.zarr --enable-sharding +eopf-geozarr convert-s2-optimized S2B_MSIL2A_….zarr output.zarr ``` | Option | Default | Description | |---|---|---| -| `--spatial-chunk N` | 256 | Spatial chunk size. | -| `--enable-sharding` | off | Enable Zarr v3 sharding. | -| `--compression-level 1-9` | 3 | Blosc zstd compression level. | -| `--scale-offset-codec` | off | Store the packing with the Zarr scale-offset codecs instead of the ESA layout (see [Encoding](#encoding)). | | `--skip-validation` | off | Do not validate the output. | | `--dask-cluster` | off | Start a local Dask cluster. | | `--verbose` | off | Print more details. | @@ -124,24 +124,25 @@ dt_input = xr.open_datatree("S2B_MSIL2A_….zarr", engine="zarr", chunks={}) dt_output = convert_s2_optimized( dt_input, output_path="output.zarr", - enable_sharding=True, - spatial_chunk=256, - compression_level=3, validate_output=True, - scale_offset_codec=False, # default: ESA layout; True packs with Zarr codecs ) +# The layout keyword arguments (enable_sharding, spatial_chunk, +# compression_level, scale_offset_codec) are still accepted, but only at +# their default values — the write policy is fixed, and a deviating value +# raises ValueError. ``` ### Encoding Every level of the reflectance pyramid keeps the packing of the source product (for example `uint16`, `scale_factor` 0.0001, `add_offset` -0.1, nodata 0 for -S2 L2A). One option selects how that packing is stored: +S2 L2A). The Sentinel-2 pipeline always writes the ESA layout; the Zarr codec +mode remains available on the generic rechunker pipeline: -| Mode | Option | On disk | Metadata | +| Mode | Where | On disk | Metadata | |---|---|---|---| -| Default: ESA layout | none | Source integer dtype, no scale codecs | CF `scale_factor`, `add_offset` and `_FillValue` on the arrays | -| Zarr codec | `--scale-offset-codec` / `scale_offset_codec=True` | Source integer dtype, packed by the Zarr `scale_offset` + `cast_value` codecs; the array's logical dtype is `float32` and its fill value is NaN | No CF scale attributes: Zarr readers return decoded values | +| ESA layout | Sentinel-2 (always), generic rechunker (default) | Source integer dtype, no scale codecs | CF `scale_factor`, `add_offset` and `_FillValue` on the arrays | +| Zarr codec | generic rechunker with `--scale-offset-codec` / `scale_offset_codec=True` | Source integer dtype, packed by the Zarr `scale_offset` + `cast_value` codecs; the array's logical dtype is `float32` and its fill value is NaN | No CF scale attributes: Zarr readers return decoded values | What a reader needs: @@ -162,9 +163,12 @@ such as the classification and quality masks, keep their integer dtype and fill value in both modes. In the CPM writer (`eopf convert-geozarr --scale-offset-codec` or -`target_store_kwargs={"scale_offset_codec": True}`), the former -`keep_scale_offset` option is still accepted for one release with a -`DeprecationWarning`: `keep_scale_offset=False` selects the codecs. +`target_store_kwargs={"scale_offset_codec": True}`), the option applies to the +generic rechunker; on a Sentinel-2 product it deviates from the fixed write +policy and is refused with a `ValueError`. The former `keep_scale_offset` +option is still accepted for one release with a `DeprecationWarning`: +`keep_scale_offset=False` selects the codecs (and is therefore also refused +for Sentinel-2). ## Sentinel-3 OLCI conversion diff --git a/docs/cpm-driver.md b/docs/cpm-driver.md index 85c7b0d9..8434866b 100644 --- a/docs/cpm-driver.md +++ b/docs/cpm-driver.md @@ -54,9 +54,9 @@ eopf convert-geozarr S2B_MSIL2A_….SAFE s3://bucket/path/out.zarr --stage-outpu | Option | Pipelines | Description | |---|---|---| -| `--spatial-chunk INTEGER` | all but Sentinel-3 OLCI | Spatial chunk size. Default: 256 (Sentinel-2), 4096 (generic), 1024 (generic rechunker). Sentinel-3 OLCI accepts it but does not apply it yet. | -| `--enable-sharding` | all but Sentinel-3 OLCI | Enable Zarr v3 sharding. Sentinel-3 OLCI accepts it but does not apply it yet. | -| `--scale-offset-codec` | Sentinel-2, generic rechunker | Pack reflectance (or, on the generic rechunker, every packed variable) with the Zarr `scale_offset` + `cast_value` codecs instead of the default ESA layout (CF `scale_factor`/`add_offset`/`_FillValue`). See [Encoding](converter.md#encoding). | +| `--spatial-chunk INTEGER` | all but Sentinel-3 OLCI | Spatial chunk size. Default: 4096 (generic), 1024 (generic rechunker, Sentinel-2). For Sentinel-2 the value is fixed by the write policy: anything other than 1024 is refused. Sentinel-3 OLCI accepts it but does not apply it yet. | +| `--enable-sharding` | generic, generic rechunker | Enable Zarr v3 sharding. Sentinel-2 output is always sharded (the flag is not applied); Sentinel-3 OLCI accepts it but does not apply it yet. | +| `--scale-offset-codec` | generic rechunker | Pack every packed variable with the Zarr `scale_offset` + `cast_value` codecs instead of the default ESA layout (CF `scale_factor`/`add_offset`/`_FillValue`). Refused for Sentinel-2, whose write policy fixes the ESA layout. See [Encoding](converter.md#encoding). | | `--output-grid TEXT` | Sentinel-3 OLCI | `native` (default) keeps the instrument swath geometry. A CRS string (for example `EPSG:4326`) warps the swath onto a regular grid. | | `--min-dimension INTEGER` | Sentinel-3 OLCI, generic | Minimum dimension of the coarsest overview level. Default: 256. | | `--groups TEXT` | generic | DataTree group to convert. Repeat the option for more groups. Required on the generic pipeline. | diff --git a/docs/examples.md b/docs/examples.md index 7bda9fae..7da6d4c2 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -13,15 +13,15 @@ description: Examples for eopf-geozarr, the GeoZarr driver for EOPF CPM — conv Convert native products with CPM (see the [CPM driver guide](cpm-driver.md)): ```bash -# Sentinel-2 L2A SAFE to GeoZarr, with sharding -eopf convert-geozarr S2B_MSIL2A_….SAFE out.zarr --enable-sharding +# Sentinel-2 L2A SAFE to GeoZarr (the S2 layout is fixed: sharded, +# 1024-pixel chunks, blosc-zstd 3, ESA packed integers) +eopf convert-geozarr S2B_MSIL2A_….SAFE out.zarr # Sentinel-3 OLCI EFR on a regular WGS 84 grid eopf convert-geozarr S3A_OL_1_EFR____….SEN3 out.zarr --output-grid EPSG:4326 -# Sentinel-2 to S3, packed with the Zarr scale-offset codecs -eopf convert-geozarr S2B_MSIL2A_….SAFE s3://bucket/out.zarr \ - --stage-output --scale-offset-codec +# Sentinel-2 to S3: convert locally, then upload +eopf convert-geozarr S2B_MSIL2A_….SAFE s3://bucket/out.zarr --stage-output ``` ```python @@ -36,7 +36,7 @@ for safe in sorted(Path("inputs").glob("S2*_MSIL2A_*.SAFE")): convert( str(safe), f"outputs/{safe.stem}.zarr", - target_store_kwargs={"engine": "geozarr", "enable_sharding": True}, + target_store_kwargs={"engine": "geozarr"}, ) ``` diff --git a/docs/faq.md b/docs/faq.md index 393d58eb..fbc00cdf 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -68,12 +68,13 @@ pip install "eopf-geozarr[cpm]" # or eopf-geozarr without the CPM driver ### Why are my reflectance values integers, or why do they have NaN? -eopf-geozarr keeps the packing of the source product. By default the arrays -are packed integers with CF `scale_factor`/`add_offset`/`_FillValue` -attributes, as in the ESA products: xarray applies them by default, but a -plain Zarr reader returns the integers. With `--scale-offset-codec`, the Zarr -`scale_offset` + `cast_value` codecs store the packing instead, and Zarr readers -that support these codecs return decoded reflectance with NaN for nodata. See +eopf-geozarr keeps the packing of the source product. The arrays are packed +integers with CF `scale_factor`/`add_offset`/`_FillValue` attributes, as in +the ESA products: xarray applies them by default, but a plain Zarr reader +returns the integers. On the generic rechunker pipeline, +`--scale-offset-codec` stores the packing with the Zarr `scale_offset` + +`cast_value` codecs instead, and Zarr readers that support these codecs +return decoded values with NaN for nodata. See [Encoding](converter.md#encoding). ### How do I set up AWS credentials? diff --git a/pyproject.toml b/pyproject.toml index f803ef02..b546cc38 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -259,9 +259,11 @@ constraint-dependencies = [ ] [tool.uv.sources] -# pydantic-zarr main: scoped whole-document metadata validation (zarr-metadata), -# the zarr_scope / zarr_scope_strict class variables, and MISSING-based -# attribute models. Swap back to PyPI once the next pydantic-zarr releases. -pydantic-zarr = { git = "https://github.com/zarr-developers/pydantic-zarr.git", rev = "main" } +# pydantic-zarr main (pinned to the validated commit, so installs without this +# repo's lock stay reproducible): scoped whole-document metadata validation +# (zarr-metadata), the zarr_scope / zarr_scope_strict class variables, and +# MISSING-based attribute models. Swap back to PyPI once the next +# pydantic-zarr releases. +pydantic-zarr = { git = "https://github.com/zarr-developers/pydantic-zarr.git", rev = "9f2e847ce7fe2c98119699ddcf3e090fba688e1f" } diff --git a/src/eopf_geozarr/cpm/writer.py b/src/eopf_geozarr/cpm/writer.py index 87f7628e..da2d59b0 100644 --- a/src/eopf_geozarr/cpm/writer.py +++ b/src/eopf_geozarr/cpm/writer.py @@ -255,13 +255,17 @@ def write( ) if selected_pipeline == "s2-optimized": - # The plan-driven S2 writer has a fixed write policy, so the - # layout options (enable_sharding, spatial_chunk, - # compression_level) are not forwarded; scale_offset_codec is, - # so an explicit True is refused with the policy message. + # The plan-driven S2 writer has a fixed write policy. The options + # whose explicit deviation is detectable (spatial_chunk, + # compression_level, scale_offset_codec) are forwarded so the + # policy check refuses them loudly; enable_sharding is not, + # because sharding is fixed on and this writer's own default + # (False) is indistinguishable from an explicit False. return convert_s2_optimized( dt_input=dtree, output_path=output_path, + spatial_chunk=resolved_spatial_chunk, + compression_level=compression_level, validate_output=validate_output, scale_offset_codec=scale_offset_codec, max_retries=max_retries, diff --git a/src/eopf_geozarr/data_api/s2_plan.py b/src/eopf_geozarr/data_api/s2_plan.py index 761fc34a..85d1c258 100644 --- a/src/eopf_geozarr/data_api/s2_plan.py +++ b/src/eopf_geozarr/data_api/s2_plan.py @@ -454,20 +454,31 @@ def plan_reflectance(root: Sentinel2Root) -> AnyGroupSpec: # the georeferencing of the pyramid: origin and EPSG from any finest-level # band, else from the product-level declaration (Zarr V3 baselines carry # proj attributes only on stac_discovery, not on the band arrays) - finest = input_levels[min(input_levels)] - first_band_name = next(k for k in finest.members if k.startswith("b")) + finest_meters_in = min(input_levels) + finest = input_levels[finest_meters_in] + first_band_name = next((k for k in finest.members if k.startswith("b")), None) + if first_band_name is None: + msg = f"The r{finest_meters_in}m resolution dataset holds no band arrays" + raise ValueError(msg) first_band_attrs: Mapping[str, object] = finest.members[first_band_name].attributes transform = first_band_attrs.get("proj:transform") - if isinstance(transform, (list, tuple)) and len(transform) >= 6: + band_epsg = first_band_attrs.get("proj:epsg") + band_wkt2 = first_band_attrs.get("proj:wkt2") + if ( + isinstance(transform, (list, tuple)) + and len(transform) >= 6 + and isinstance(band_epsg, (int, str)) + and isinstance(band_wkt2, str) + ): origin = (float(transform[2]), float(transform[5])) - epsg = int(first_band_attrs["proj:epsg"]) # type: ignore[call-overload] - wkt2 = str(first_band_attrs["proj:wkt2"]) + epsg = int(band_epsg) + wkt2 = band_wkt2 else: product = _product_proj(root) if product is None: msg = ( - f"Band {first_band_name!r} carries no usable proj:transform and the " - "product declares no stac_discovery proj georeferencing" + f"Band {first_band_name!r} carries no usable proj:transform/proj:epsg/proj:wkt2 " + "and the product declares no stac_discovery proj georeferencing" ) raise ValueError(msg) origin, epsg, wkt2 = product @@ -937,6 +948,10 @@ def _plan_subtree( sub = _plan_subtree(member, f"{path}/{name}", product_proj) if sub is not None: planned[name] = sub + # a group holding arrays next to its subgroups keeps those arrays too + own = _plan_dataset(group, path) + if own is not None: + return GroupSpecV3(attributes=own.attributes, members={**dict(own.members), **planned}) if not planned: return None return GroupSpecV3(attributes=dict(_doc_attrs(group)), members=planned) diff --git a/src/eopf_geozarr/data_api/s2_write.py b/src/eopf_geozarr/data_api/s2_write.py index f8d154ea..3318f445 100644 --- a/src/eopf_geozarr/data_api/s2_write.py +++ b/src/eopf_geozarr/data_api/s2_write.py @@ -313,10 +313,12 @@ def _coarsen(values: np.ndarray, factor: int, var: str, fill: int | None) -> np. def _window_mean(windows: np.ndarray, fill: int | None) -> np.ndarray: """The converter's block-mean reduction over one (i, factor, j, factor) view.""" if np.issubdtype(windows.dtype, np.floating): - # decoded values: nodata is NaN, and the NaN-skipping mean excludes it + # float values: nodata is NaN, the NaN-skipping mean excludes it, and + # an all-NaN window stays NaN (as xarray's skipna mean leaves it) total = np.nansum(windows.astype("float64"), axis=(1, 3)) count = np.sum(~np.isnan(windows), axis=(1, 3)) - return (total / np.maximum(count, 1)).astype(windows.dtype) + mean = total / np.maximum(count, 1) + return np.where(count > 0, mean, np.nan).astype(windows.dtype) as_float = windows.astype("float64") if fill is None: return np.round(as_float.mean(axis=(1, 3))).astype(windows.dtype) diff --git a/src/eopf_geozarr/s2_optimization/s2_converter.py b/src/eopf_geozarr/s2_optimization/s2_converter.py index fc03cd7c..cdd65568 100644 --- a/src/eopf_geozarr/s2_optimization/s2_converter.py +++ b/src/eopf_geozarr/s2_optimization/s2_converter.py @@ -23,8 +23,6 @@ from eopf_geozarr.data_api.s2_plan import load_sentinel2 from eopf_geozarr.data_api.s2_write import write_geozarr -from .s2_multiscale import _AUX_MULTISCALES - if TYPE_CHECKING: from collections.abc import Hashable, Sequence @@ -324,8 +322,9 @@ def simple_root_consolidation( """Simple root-level metadata consolidation with proper zarr group creation. `datasets` maps every written dataset group path to its data variable - names (multiscale roots map to None), and `reflectance_shape` is the - finest reflectance level's (rows, cols) for the STAC asset's proj:shape. + names, with multiscale roots mapped to None — each None root gets its own + consolidated metadata. `reflectance_shape` is the finest reflectance + level's (rows, cols) for the STAC asset's proj:shape. """ # create missing intermediary groups (/conditions, /quality, etc.) @@ -405,13 +404,12 @@ def simple_root_consolidation( input_root_attrs=cast("dict[str, dict[str, Any]]", dt_input.attrs), ) - # consolidate reflectance group metadata - # add consolidation for other MS arrays - zarr.consolidate_metadata(output_path + "/measurements/reflectance", zarr_format=ZARR_FORMAT) - # also cosnolidate the non-measuremetn MS -> only the pyramids that were actually written (i.e. have levels in `datasets`) are consolidated - for aux in _AUX_MULTISCALES: - if any(path.startswith(aux.base_path + "/") for path in datasets): - zarr.consolidate_metadata(output_path + aux.base_path, zarr_format=ZARR_FORMAT) + # consolidate every multiscale pyramid's root group — the paths `datasets` + # maps to None (reflectance and the written aux pyramids alike), so the + # consolidated set follows the plan instead of a second policy table + for group_path, variable_names in datasets.items(): + if variable_names is None: + zarr.consolidate_metadata(output_path + group_path, zarr_format=ZARR_FORMAT) # consolidate root group metadata zarr.consolidate_metadata(output_path, zarr_format=ZARR_FORMAT) diff --git a/src/eopf_geozarr/s2_optimization/s2_multiscale.py b/src/eopf_geozarr/s2_optimization/s2_multiscale.py index fa9da8df..4192d01e 100644 --- a/src/eopf_geozarr/s2_optimization/s2_multiscale.py +++ b/src/eopf_geozarr/s2_optimization/s2_multiscale.py @@ -1,10 +1,11 @@ """ The Sentinel-2 multiscale policy tables. -This module holds the declarative side of the S2 multiscale layout: which -groups get a pyramid (`REFLECTANCE_MULTISCALE`, `_AUX_MULTISCALES`), at which -scale levels, and the SCL flag vocabulary. The pyramids themselves are planned -by `eopf_geozarr.data_api.s2_plan` and written by +This module holds the declarative side of the S2 multiscale layout: the aux +pyramid groups and levels (`_AUX_MULTISCALES`, mirrored by the plan's +`AUX_MULTISCALE_LEVELS`) and the SCL flag vocabulary. The pyramids themselves +are planned by `eopf_geozarr.data_api.s2_plan` (whose +`REFLECTANCE_SCALE_LEVELS` is the reflectance policy) and written by `eopf_geozarr.data_api.s2_write`; the former DataTree-based write path was removed once the plan-driven writer reproduced its stores byte for byte. """ @@ -90,11 +91,6 @@ def applies_to(self, s2_type: S2Type | None) -> bool: return self.product_levels is None or s2_type in self.product_levels -REFLECTANCE_MULTISCALE = MultiscaleSpec( - base_path="/measurements/reflectance", - scale_levels=(10, 20, 60, 120, 360, 720), -) - # Auxiliary (non-reflectance) groups. Groups missing from the input are skipped. _AUX_MULTISCALES: tuple[MultiscaleSpec, ...] = ( MultiscaleSpec( diff --git a/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json b/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json index 8e165597..09e7e3d0 100644 --- a/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json +++ b/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json @@ -526,10 +526,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -543,10 +543,10 @@ "spatial:transform": [ 10.0, 0.0, - 300000.0, + 699960.0, 0.0, -10.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -1085,10 +1085,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -1102,10 +1102,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 699960.0, 0.0, -20.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -1834,10 +1834,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -1851,10 +1851,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 699960.0, 0.0, -60.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -2310,10 +2310,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 699960.0, 0.0, -60.0, - 5000040.0 + 4700040.0 ] }, { @@ -2326,10 +2326,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 699960.0, 0.0, -120.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -2352,10 +2352,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 699960.0, 0.0, -360.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -2378,10 +2378,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 699960.0, 0.0, -720.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -2399,10 +2399,10 @@ }, "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -2412,10 +2412,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 699960.0, 0.0, -60.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -2447,10 +2447,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -2464,10 +2464,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 699960.0, 0.0, -120.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -2724,10 +2724,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -2741,10 +2741,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 699960.0, 0.0, -360.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -3001,10 +3001,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -3018,10 +3018,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 699960.0, 0.0, -60.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -3285,10 +3285,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890600.0, - 409440.0, - 5000040.0 + 699960.0, + 4590600.0, + 809400.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -3302,10 +3302,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 699960.0, 0.0, -720.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -3574,10 +3574,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 699960.0, 0.0, -20.0, - 5000040.0 + 4700040.0 ] }, { @@ -3590,10 +3590,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 699960.0, 0.0, -60.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -3616,10 +3616,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 699960.0, 0.0, -120.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -3642,10 +3642,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 699960.0, 0.0, -360.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -3668,10 +3668,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 699960.0, 0.0, -720.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -3689,10 +3689,10 @@ }, "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -3702,10 +3702,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 699960.0, 0.0, -20.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -3737,10 +3737,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -3754,10 +3754,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 699960.0, 0.0, -120.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -4031,10 +4031,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -4048,10 +4048,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 699960.0, 0.0, -20.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -4332,10 +4332,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -4349,10 +4349,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 699960.0, 0.0, -360.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -4626,10 +4626,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -4643,10 +4643,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 699960.0, 0.0, -60.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -4927,10 +4927,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890600.0, - 409440.0, - 5000040.0 + 699960.0, + 4590600.0, + 809400.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -4944,10 +4944,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 699960.0, 0.0, -720.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -7232,10 +7232,10 @@ "spatial:transform": [ 10.0, 0.0, - 300000.0, + 699960.0, 0.0, -10.0, - 5000040.0 + 4700040.0 ] }, { @@ -7248,10 +7248,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 699960.0, 0.0, -20.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -7274,10 +7274,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 699960.0, 0.0, -60.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -7300,10 +7300,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 699960.0, 0.0, -120.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -7326,10 +7326,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 699960.0, 0.0, -360.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -7352,10 +7352,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 699960.0, 0.0, -720.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -7373,10 +7373,10 @@ }, "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -7386,10 +7386,10 @@ "spatial:transform": [ 10.0, 0.0, - 300000.0, + 699960.0, 0.0, -10.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -7421,10 +7421,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -7438,10 +7438,10 @@ "spatial:transform": [ 10.0, 0.0, - 300000.0, + 699960.0, 0.0, -10.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -8012,10 +8012,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -8029,10 +8029,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 699960.0, 0.0, -120.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -9420,10 +9420,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -9437,10 +9437,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 699960.0, 0.0, -20.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -10732,10 +10732,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -10749,10 +10749,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 699960.0, 0.0, -360.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -12140,10 +12140,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -12157,10 +12157,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 699960.0, 0.0, -60.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -13555,10 +13555,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890600.0, - 409440.0, - 5000040.0 + 699960.0, + 4590600.0, + 809400.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -13572,10 +13572,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 699960.0, 0.0, -720.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -14977,10 +14977,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -14994,10 +14994,10 @@ "spatial:transform": [ 10.0, 0.0, - 300000.0, + 699960.0, 0.0, -10.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -15348,10 +15348,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -15365,10 +15365,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 699960.0, 0.0, -20.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -15719,10 +15719,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -15736,10 +15736,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 699960.0, 0.0, -60.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -16097,10 +16097,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -16114,10 +16114,10 @@ "spatial:transform": [ 10.0, 0.0, - 300000.0, + 699960.0, 0.0, -10.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -16736,10 +16736,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -16753,10 +16753,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 699960.0, 0.0, -20.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -17605,10 +17605,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -17622,10 +17622,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 699960.0, 0.0, -60.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -18141,10 +18141,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 699960.0, 0.0, -20.0, - 5000040.0 + 4700040.0 ] }, { @@ -18157,10 +18157,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 699960.0, 0.0, -60.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -18183,10 +18183,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 699960.0, 0.0, -120.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -18209,10 +18209,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 699960.0, 0.0, -360.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -18235,10 +18235,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 699960.0, 0.0, -720.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -18256,10 +18256,10 @@ }, "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -18269,10 +18269,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 699960.0, 0.0, -20.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -18304,10 +18304,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -18321,10 +18321,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 699960.0, 0.0, -120.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -18664,10 +18664,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -18681,10 +18681,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 699960.0, 0.0, -20.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -19031,10 +19031,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -19048,10 +19048,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 699960.0, 0.0, -360.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -19391,10 +19391,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -19408,10 +19408,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 699960.0, 0.0, -60.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -19751,10 +19751,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890600.0, - 409440.0, - 5000040.0 + 699960.0, + 4590600.0, + 809400.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -19768,10 +19768,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 699960.0, 0.0, -720.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { diff --git a/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json b/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json index 9a6f31c8..6f505d95 100644 --- a/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json +++ b/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json @@ -524,12 +524,12 @@ "r10m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -543,10 +543,10 @@ "spatial:transform": [ 10.0, 0.0, - 300000.0, + 600000.0, 0.0, -10.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -948,7 +948,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -956,15 +956,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -1083,12 +1083,12 @@ "r20m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -1102,10 +1102,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 600000.0, 0.0, -20.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -1697,7 +1697,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -1705,15 +1705,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -1832,12 +1832,12 @@ "r60m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -1851,10 +1851,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 600000.0, 0.0, -60.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -2161,7 +2161,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -2169,15 +2169,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -2310,10 +2310,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 600000.0, 0.0, -60.0, - 5000040.0 + 4600020.0 ] }, { @@ -2326,10 +2326,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 600000.0, 0.0, -120.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -2352,10 +2352,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 600000.0, 0.0, -360.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -2378,10 +2378,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 600000.0, 0.0, -720.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -2397,12 +2397,12 @@ ], "resampling_method": "nearest" }, - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -2412,10 +2412,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 600000.0, 0.0, -60.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -2445,12 +2445,12 @@ "r120m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -2464,10 +2464,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 600000.0, 0.0, -120.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -2594,7 +2594,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -2602,15 +2602,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -2722,12 +2722,12 @@ "r360m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -2741,10 +2741,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 600000.0, 0.0, -360.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -2871,7 +2871,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -2879,15 +2879,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -2999,12 +2999,12 @@ "r60m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -3018,10 +3018,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 600000.0, 0.0, -60.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -3148,7 +3148,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -3156,15 +3156,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -3283,12 +3283,12 @@ "r720m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890600.0, - 409440.0, - 5000040.0 + 600000.0, + 4490580.0, + 709440.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -3302,10 +3302,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 600000.0, 0.0, -720.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -3432,7 +3432,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -3440,15 +3440,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -3574,10 +3574,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 600000.0, 0.0, -20.0, - 5000040.0 + 4600020.0 ] }, { @@ -3590,10 +3590,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 600000.0, 0.0, -60.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -3616,10 +3616,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 600000.0, 0.0, -120.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -3642,10 +3642,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 600000.0, 0.0, -360.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -3668,10 +3668,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 600000.0, 0.0, -720.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -3687,12 +3687,12 @@ ], "resampling_method": "nearest" }, - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -3702,10 +3702,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 600000.0, 0.0, -20.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -3735,12 +3735,12 @@ "r120m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -3754,10 +3754,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 600000.0, 0.0, -120.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -3901,7 +3901,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -3909,15 +3909,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -4029,12 +4029,12 @@ "r20m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -4048,10 +4048,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 600000.0, 0.0, -20.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -4195,7 +4195,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -4203,15 +4203,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -4330,12 +4330,12 @@ "r360m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -4349,10 +4349,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 600000.0, 0.0, -360.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -4496,7 +4496,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -4504,15 +4504,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -4624,12 +4624,12 @@ "r60m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -4643,10 +4643,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 600000.0, 0.0, -60.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -4790,7 +4790,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -4798,15 +4798,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -4925,12 +4925,12 @@ "r720m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890600.0, - 409440.0, - 5000040.0 + 600000.0, + 4490580.0, + 709440.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -4944,10 +4944,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 600000.0, 0.0, -720.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -5091,7 +5091,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -5099,15 +5099,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -7232,10 +7232,10 @@ "spatial:transform": [ 10.0, 0.0, - 300000.0, + 600000.0, 0.0, -10.0, - 5000040.0 + 4600020.0 ] }, { @@ -7248,10 +7248,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 600000.0, 0.0, -20.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -7274,10 +7274,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 600000.0, 0.0, -60.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -7300,10 +7300,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 600000.0, 0.0, -120.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -7326,10 +7326,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 600000.0, 0.0, -360.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -7352,10 +7352,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 600000.0, 0.0, -720.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -7371,12 +7371,12 @@ ], "resampling_method": "average" }, - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -7386,10 +7386,10 @@ "spatial:transform": [ 10.0, 0.0, - 300000.0, + 600000.0, 0.0, -10.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -7419,12 +7419,12 @@ "r10m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -7438,10 +7438,10 @@ "spatial:transform": [ 10.0, 0.0, - 300000.0, + 600000.0, 0.0, -10.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -7875,7 +7875,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -7883,15 +7883,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -8010,12 +8010,12 @@ "r120m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -8029,10 +8029,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 600000.0, 0.0, -120.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -9290,7 +9290,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -9298,15 +9298,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -9418,12 +9418,12 @@ "r20m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -9437,10 +9437,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 600000.0, 0.0, -20.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -10595,7 +10595,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -10603,15 +10603,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -10730,12 +10730,12 @@ "r360m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -10749,10 +10749,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 600000.0, 0.0, -360.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -12010,7 +12010,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -12018,15 +12018,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -12138,12 +12138,12 @@ "r60m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -12157,10 +12157,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 600000.0, 0.0, -60.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -13418,7 +13418,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -13426,15 +13426,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -13553,12 +13553,12 @@ "r720m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890600.0, - 409440.0, - 5000040.0 + 600000.0, + 4490580.0, + 709440.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -13572,10 +13572,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 600000.0, 0.0, -720.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -14833,7 +14833,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -14841,15 +14841,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -14975,12 +14975,12 @@ "r10m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -14994,10 +14994,10 @@ "spatial:transform": [ 10.0, 0.0, - 300000.0, + 600000.0, 0.0, -10.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -15115,7 +15115,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -15123,15 +15123,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -15346,12 +15346,12 @@ "r20m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -15365,10 +15365,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 600000.0, 0.0, -20.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -15486,7 +15486,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -15494,15 +15494,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -15717,12 +15717,12 @@ "r60m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -15736,10 +15736,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 600000.0, 0.0, -60.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -15857,7 +15857,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -15865,15 +15865,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -16095,12 +16095,12 @@ "r10m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -16114,10 +16114,10 @@ "spatial:transform": [ 10.0, 0.0, - 300000.0, + 600000.0, 0.0, -10.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -16599,7 +16599,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -16607,15 +16607,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -16734,12 +16734,12 @@ "r20m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -16753,10 +16753,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 600000.0, 0.0, -20.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -17468,7 +17468,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -17476,15 +17476,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -17603,12 +17603,12 @@ "r60m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -17622,10 +17622,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 600000.0, 0.0, -60.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -17992,7 +17992,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -18000,15 +18000,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -18141,10 +18141,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 600000.0, 0.0, -20.0, - 5000040.0 + 4600020.0 ] }, { @@ -18157,10 +18157,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 600000.0, 0.0, -60.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -18183,10 +18183,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 600000.0, 0.0, -120.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -18209,10 +18209,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 600000.0, 0.0, -360.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -18235,10 +18235,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 600000.0, 0.0, -720.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -18254,12 +18254,12 @@ ], "resampling_method": "average" }, - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -18269,10 +18269,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 600000.0, 0.0, -20.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -18302,12 +18302,12 @@ "r120m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -18321,10 +18321,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 600000.0, 0.0, -120.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -18534,7 +18534,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -18542,15 +18542,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -18662,12 +18662,12 @@ "r20m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -18681,10 +18681,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 600000.0, 0.0, -20.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -18894,7 +18894,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -18902,15 +18902,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -19029,12 +19029,12 @@ "r360m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -19048,10 +19048,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 600000.0, 0.0, -360.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -19261,7 +19261,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -19269,15 +19269,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -19389,12 +19389,12 @@ "r60m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -19408,10 +19408,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 600000.0, 0.0, -60.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -19621,7 +19621,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -19629,15 +19629,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -19749,12 +19749,12 @@ "r720m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890600.0, - 409440.0, - 5000040.0 + 600000.0, + 4490580.0, + 709440.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -19768,10 +19768,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 600000.0, 0.0, -720.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -19981,7 +19981,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -19989,15 +19989,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { diff --git a/tests/test_data_api/test_s2_plan.py b/tests/test_data_api/test_s2_plan.py index 2c653c2f..892f21ad 100644 --- a/tests/test_data_api/test_s2_plan.py +++ b/tests/test_data_api/test_s2_plan.py @@ -27,18 +27,6 @@ _SNAPSHOT_DIR = pathlib.Path("tests/_test_data/optimized_geozarr_examples") _INPUT_PATHS = sorted(_INPUT_DIR.glob("*.json")) -# The snapshot harness (test_s2_multiscale) feeds one fixed, synthetic tile -# CRS and coordinate set to every product, because the metadata-only input -# fixtures carry no coordinate data; the plan instead derives georeferencing -# from each product's own band attributes. These are the snapshot attribute -# keys that carry the harness's tile rather than the product's, masked in the -# cross-product comparison and pinned by the self-consistency test instead. -_HARNESS_GEOREF_KEYS = ("proj:code", "spatial:bbox", "spatial:transform") - -# The one product whose real tile matches the harness's synthetic tile, so its -# snapshot is byte-for-byte reproducible from metadata alone. -_EXACT_PRODUCT = "S2B_MSIL1C_20250113T103309_N0511_R108_T32TLQ_20250113T122458" - def _read(path: pathlib.Path) -> dict[str, Any]: data = json.loads(path.read_text()) @@ -60,56 +48,21 @@ def _planned_reflectance(path: pathlib.Path) -> dict[str, Any]: return _planned_root(path)["members"]["measurements"]["members"]["reflectance"] -def _mask_harness_georef(node: dict[str, Any]) -> None: - """Blank the attribute values the snapshot harness injects (in place).""" - attributes = node.get("attributes") - if isinstance(attributes, dict): - for key in _HARNESS_GEOREF_KEYS: - attributes.pop(key, None) - multiscales = attributes.get("multiscales") - if isinstance(multiscales, dict): - for entry in multiscales.get("layout", ()): - entry.pop("spatial:transform", None) - members = node.get("members") - if isinstance(members, dict): - # the whole grid-mapping array carries the harness CRS - members.pop("spatial_ref", None) - for member in members.values(): - _mask_harness_georef(member) - - @pytest.mark.parametrize("path", _INPUT_PATHS, ids=lambda p: p.stem[:26]) def test_plan_matches_snapshot(path: pathlib.Path) -> None: """ - The planned tree reproduces the stored converter snapshot — the member - tree, every array document (shapes, dtypes, shards, codecs, dimension - names) and every attribute, across measurements, conditions and quality — - except the georeferencing values the snapshot harness injects from its - synthetic tile, which the self-consistency test pins to the product's own - metadata instead. + The planned tree reproduces the stored snapshot whole — the member tree, + every array document (shapes, dtypes, shards, codecs, dimension names) + and every attribute, georeferencing included, across measurements, + conditions and quality. The plan is the snapshots' source of truth + (REGENERATE_SNAPSHOTS=1 rewrites them), and the self-consistency test + below pins the georeferencing to the product's own metadata. """ planned = _planned_root(path) if os.environ.get("REGENERATE_SNAPSHOTS"): - # The plan is the snapshots' source of truth now that the writer - # realizes it directly. Note that regenerating replaces the historical - # harness-tile georeferencing with each product's own, after which the - # masking below (and `_EXACT_PRODUCT`) can be retired. snapshot_path = _SNAPSHOT_DIR / path.name snapshot_path.write_text(json.dumps(planned, indent=2, sort_keys=True) + "\n") - expected = _snapshot_root(path) - for tree in (planned, expected): - _mask_harness_georef(tree) - assert planned == expected - - -def test_plan_matches_snapshot_exactly() -> None: - """ - For the product whose tile the snapshot harness's synthetic coordinates - model, the plan reproduces the whole snapshot byte for byte, - georeferencing included. - """ - path = _INPUT_DIR / f"{_EXACT_PRODUCT}.json" - assert _planned_root(path) == _snapshot_root(path) + assert planned == _snapshot_root(path) @pytest.mark.parametrize("path", _INPUT_PATHS, ids=lambda p: p.stem[:26]) @@ -149,7 +102,7 @@ def test_load_sentinel2_keeps_the_model(tmp_path: pathlib.Path) -> None: `load_sentinel2` reads a Zarr store into the validated input model, and the plan built from it equals the plan built from the source document. """ - path = _INPUT_DIR / f"{_EXACT_PRODUCT}.json" + path = _INPUT_PATHS[0] document = _read(path) store_path = tmp_path / "s2.zarr" GroupSpecV2.model_validate(document).to_zarr(store_path, path="") # type: ignore[arg-type] @@ -178,6 +131,53 @@ def test_product_level_requires_stac_discovery_evidence() -> None: product_level(root) +def test_plan_carries_a_mixed_groups_own_arrays() -> None: + """A conditions/quality group holding arrays next to its subgroups keeps + those arrays in the plan instead of dropping them silently.""" + path = _INPUT_PATHS[0] + document = _read(path) + mixed = document["members"]["conditions"]["members"]["mask"]["members"]["detector_footprint"] + assert any("members" in member for member in mixed["members"].values()), ( + "fixture precondition: detector_footprint holds subgroups" + ) + mixed["members"]["extra"] = { + "zarr_format": 2, + "shape": [4, 4], + "chunks": [4, 4], + "dtype": " None: + """A product whose bands carry no proj attributes and whose stac_discovery + declares none is refused with a ValueError, not a KeyError.""" + path = _INPUT_PATHS[0] + document = _read(path) + reflectance = document["members"]["measurements"]["members"]["reflectance"] + for level in reflectance["members"].values(): + for member in level["members"].values(): + for key in ("proj:transform", "proj:epsg", "proj:wkt2"): + member["attributes"].pop(key, None) + document["attributes"]["stac_discovery"].get("properties", {}).pop("proj:bbox", None) + root = Sentinel2Root.model_validate(document) + with pytest.raises(ValueError, match="proj"): + plan_reflectance(root) + + def test_plan_reflectance_requires_a_resolution_dataset() -> None: """A reflectance group with none of the known resolution datasets is refused.""" path = _INPUT_PATHS[0] diff --git a/tests/test_data_api/test_s2_write.py b/tests/test_data_api/test_s2_write.py index 3b47c66f..b44f3d40 100644 --- a/tests/test_data_api/test_s2_write.py +++ b/tests/test_data_api/test_s2_write.py @@ -213,6 +213,20 @@ def test_coarsen_classification_takes_the_window_centre(var_name: str, factor: i np.testing.assert_array_equal(result, data[centre::factor, centre::factor]) +def test_coarsen_float_keeps_all_nan_windows_nan() -> None: + """The float block mean skips NaN, and a window holding nothing but NaN + stays NaN (it is nodata, not zero).""" + data = np.array( + [ + [1.0, 2.0, np.nan, np.nan], + [3.0, np.nan, np.nan, np.nan], + ], + dtype="float32", + ) + result = _coarsen(data, 2, "b02", fill=None) + np.testing.assert_array_equal(result, np.array([[2.0, np.nan]], dtype="float32")) + + def test_coarsen_refuses_quality_masks() -> None: """Quality-mask downsampling is not implemented, so it is refused.""" data = np.zeros((4, 4), dtype="uint8") diff --git a/tests/test_s2_converter_simplified.py b/tests/test_s2_converter_simplified.py index ee403704..aa8483ca 100644 --- a/tests/test_s2_converter_simplified.py +++ b/tests/test_s2_converter_simplified.py @@ -220,8 +220,9 @@ def test_initialize_crs_priority_cpm_260_over_rio(self) -> None: def test_simple_root_consolidation_success(tmp_path: Path) -> None: """ - Test that simple_root_consolidation produces consolidated metadata at the root, and for the - measurements/reflectance group, but not for other groups. + Test that simple_root_consolidation produces consolidated metadata at the + root and for the multiscale roots `datasets` maps to None (here + measurements/reflectance), but not for other groups. """ written = { @@ -239,9 +240,9 @@ def test_simple_root_consolidation_success(tmp_path: Path) -> None: for k, v in written.items() ] - simple_root_consolidation( - output_path=str(tmp_path / "test.zarr"), datasets=dict.fromkeys(written, ()) - ) + datasets: dict[str, tuple[str, ...] | None] = dict.fromkeys(written, ()) + datasets["/measurements/reflectance"] = None + simple_root_consolidation(output_path=str(tmp_path / "test.zarr"), datasets=datasets) root_z_meta = json.loads((tmp_path / "test.zarr/zarr.json").read_text()) reflectance_zmeta = json.loads( @@ -272,9 +273,10 @@ def test_simple_root_consolidation_success(tmp_path: Path) -> None: def test_simple_root_consolidation_aux_multiscales( tmp_path: Path, aux_groups: tuple[str, ...] ) -> None: - """Each written auxiliary pyramid gets its own consolidated metadata listing its levels. - - Pyramids missing from `datasets` (the L2A-only ones for an L1C product) are skipped. + """Each written auxiliary pyramid root (mapped to None in `datasets`, as + the plan maps multiscale roots) gets its own consolidated metadata listing + its levels. Pyramids missing from `datasets` (the L2A-only ones for an L1C + product) are skipped. """ output_path = tmp_path / "test.zarr" levels = ("r60m", "r120m") @@ -286,7 +288,12 @@ def test_simple_root_consolidation_aux_multiscales( for k, v in written.items(): v.to_zarr(str(output_path) + k, mode="a", zarr_format=3, consolidated=False) - datasets = {path: tuple(str(name) for name in ds.data_vars) for path, ds in written.items()} + datasets: dict[str, tuple[str, ...] | None] = { + path: tuple(str(name) for name in ds.data_vars) for path, ds in written.items() + } + datasets["/measurements/reflectance"] = None + for base_path in aux_groups: + datasets[base_path] = None simple_root_consolidation(output_path=str(output_path), datasets=datasets) for base_path in aux_groups: diff --git a/uv.lock b/uv.lock index bf28b859..20373303 100644 --- a/uv.lock +++ b/uv.lock @@ -1733,7 +1733,7 @@ requires-dist = [ { name = "eopf", marker = "python_full_version >= '3.13' and extra == 'cpm'", specifier = ">=3.0.0" }, { name = "numpy", specifier = ">=2.3.1" }, { name = "pydantic", specifier = ">=2.12" }, - { name = "pydantic-zarr", git = "https://github.com/zarr-developers/pydantic-zarr.git?rev=main" }, + { name = "pydantic-zarr", git = "https://github.com/zarr-developers/pydantic-zarr.git?rev=9f2e847ce7fe2c98119699ddcf3e090fba688e1f" }, { name = "pygit2", specifier = ">=1.20.1" }, { name = "pyproj", specifier = ">=3.7.0" }, { name = "pystac", specifier = ">=1.8.0" }, @@ -4497,7 +4497,7 @@ wheels = [ [[package]] name = "pydantic-zarr" version = "0.10.1.dev41+g9f2e847ce" -source = { git = "https://github.com/zarr-developers/pydantic-zarr.git?rev=main#9f2e847ce7fe2c98119699ddcf3e090fba688e1f" } +source = { git = "https://github.com/zarr-developers/pydantic-zarr.git?rev=9f2e847ce7fe2c98119699ddcf3e090fba688e1f#9f2e847ce7fe2c98119699ddcf3e090fba688e1f" } dependencies = [ { name = "numpy", version = "2.4.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.13'" }, { name = "numpy", version = "2.5.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.13'" }, From 3fab61001de6939ff24fec9be702cee5bfe53e39 Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Fri, 13 Nov 2026 12:11:41 +0100 Subject: [PATCH 13/45] refactor(data-api): move to pydantic-zarr main and zarr-metadata 0.8 - Pin pydantic-zarr to main at b0efedb, which requires zarr-metadata 0.8. zarr-metadata is now declared as a direct dependency, since the package imports it. - The GeoZarr scope is zarr-metadata's ZARR_PYTHON_CONTEXT. It claims `fixed_length_utf32` and `null_terminated_bytes` with their full definitions, which the hand-built scope only approximated, and `ZarrV3Context.update` no longer exists. s2_plan types those data types with zarr-metadata's `FixedLengthUtf32` and `NullTerminatedBytes`. - The coordinate and grid-mapping builders use `create_default`. It supplies the one-chunk grid, the `/` chunk key encoding, the derived fill value and the little-endian `bytes` codec those builders spelled out by hand. - Tests copy a spec with the validated `replace`, not `model_copy(update=...)`. Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 --- pyproject.toml | 10 +-- src/eopf_geozarr/data_api/geozarr/scope.py | 73 +++------------------- src/eopf_geozarr/data_api/s2_plan.py | 68 +++++++++----------- tests/test_data_api/test_v2.py | 4 +- tests/test_data_api/test_v3.py | 4 +- uv.lock | 14 +++-- 6 files changed, 55 insertions(+), 118 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 33525f9b..55e8e158 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,6 +45,8 @@ classifiers = [ requires-python = ">=3.12" dependencies = [ "pydantic-zarr>=0.8.0", + # imported directly (scopes, typed metadata objects, typed_json.check) + "zarr-metadata>=0.8.0", "pydantic>=2.14.1", # <3.3.0: open_source_datatree uses zarr's experimental CacheStore, whose # location/API may change between minor releases; bump deliberately. @@ -262,9 +264,9 @@ constraint-dependencies = [ [tool.uv.sources] # pydantic-zarr main (pinned to the validated commit, so installs without this # repo's lock stay reproducible): scoped whole-document metadata validation -# (zarr-metadata), the zarr_scope / zarr_scope_strict class variables, and -# MISSING-based attribute models. Swap back to PyPI once the next -# pydantic-zarr releases. -pydantic-zarr = { git = "https://github.com/zarr-developers/pydantic-zarr.git", rev = "9f2e847ce7fe2c98119699ddcf3e090fba688e1f" } +# against zarr-metadata 0.8's scopes, the zarr_scope / zarr_scope_strict class +# variables, MISSING-based attribute models, and ArraySpec.create_default. +# Swap back to PyPI (pydantic-zarr>=0.11) once 0.11.0 releases. +pydantic-zarr = { git = "https://github.com/zarr-developers/pydantic-zarr.git", rev = "b0efedbfbf9933726001883ac1cadae670e5181b" } diff --git a/src/eopf_geozarr/data_api/geozarr/scope.py b/src/eopf_geozarr/data_api/geozarr/scope.py index 6f2cf0a4..77eaa172 100644 --- a/src/eopf_geozarr/data_api/geozarr/scope.py +++ b/src/eopf_geozarr/data_api/geozarr/scope.py @@ -5,72 +5,17 @@ judging every extension-point name (data type, chunk grid, chunk key encoding, codec, storage transformer) by the definition that claims it in a scope, and leaving unclaimed names unjudged. GeoZarr stores written by zarr-python hold -fixed-length unicode arrays (band and angle coordinates) under zarr-python's -provisional ``fixed_length_utf32`` spelling, which no ``zarr-metadata`` scope -claims yet; this module's scope extends the default with a definition for it, -so GeoZarr documents can be judged strictly — every extension-point name -claimed — instead of leniently. +fixed-length unicode and bytes arrays (band and angle coordinates) under +zarr-python's ``fixed_length_utf32`` and ``null_terminated_bytes`` data types. +``zarr-metadata``'s ``ZARR_PYTHON_CONTEXT`` claims everything zarr-python +writes, both of these included, so GeoZarr documents can be judged strictly — +every extension-point name claimed — instead of leniently. """ from __future__ import annotations -from typing import Literal, NotRequired +from zarr_metadata.v3.definition import ZARR_PYTHON_CONTEXT -from typing_extensions import TypedDict -from zarr_metadata.v3.definition import CORE_AND_EXTENSIONS, DataTypeDefinition - - -class FixedLengthUtf32Configuration(TypedDict, closed=True): - """The configuration of zarr-python's ``fixed_length_utf32`` data type.""" - - length_bytes: int - - -class FixedLengthUtf32Object(TypedDict, closed=True): - """``fixed_length_utf32`` data type metadata in object form, mirroring the - shape of ``zarr-metadata``'s per-extension ``*Object`` types.""" - - name: Literal["fixed_length_utf32"] - configuration: FixedLengthUtf32Configuration - must_understand: NotRequired[bool] - - -class NullTerminatedBytesConfiguration(TypedDict, closed=True): - """The configuration of zarr-python's ``null_terminated_bytes`` data type.""" - - length_bytes: int - - -class NullTerminatedBytesObject(TypedDict, closed=True): - """``null_terminated_bytes`` data type metadata in object form.""" - - name: Literal["null_terminated_bytes"] - configuration: NullTerminatedBytesConfiguration - must_understand: NotRequired[bool] - - -FIXED_LENGTH_UTF32 = DataTypeDefinition( - name="fixed_length_utf32", - configuration=FixedLengthUtf32Configuration, - fill_value=str, -) -"""zarr-python's provisional fixed-length unicode data type (numpy's ``U``).""" - -NULL_TERMINATED_BYTES = DataTypeDefinition( - name="null_terminated_bytes", - configuration=NullTerminatedBytesConfiguration, - fill_value=str, -) -"""zarr-python's provisional fixed-length bytes data type (numpy's ``S``); -the fill value is the base64 spelling of the bytes.""" - -GEOZARR_SCOPE = CORE_AND_EXTENSIONS.update( - # update() replaces a slot whole, so splice the new definitions in after - # the default scope's own data types - data_types=[ - *CORE_AND_EXTENSIONS.data_types.values(), - FIXED_LENGTH_UTF32, - NULL_TERMINATED_BYTES, - ], -) -"""The default scope plus the data types zarr-python writes that it lacks.""" +GEOZARR_SCOPE = ZARR_PYTHON_CONTEXT +"""The scope of what zarr-python writes: the core spec, the registered +extensions, and zarr-python's own data types.""" diff --git a/src/eopf_geozarr/data_api/s2_plan.py b/src/eopf_geozarr/data_api/s2_plan.py index 85d1c258..7bb7edc1 100644 --- a/src/eopf_geozarr/data_api/s2_plan.py +++ b/src/eopf_geozarr/data_api/s2_plan.py @@ -68,11 +68,8 @@ from zarr_metadata.v3.codec.crc32c import Crc32cCodecObject from zarr_metadata.v3.codec.sharding_indexed import ShardingIndexedCodecObject from zarr_metadata.v3.codec.zstd import ZstdCodecObject - - from eopf_geozarr.data_api.geozarr.scope import ( - FixedLengthUtf32Object, - NullTerminatedBytesObject, - ) + from zarr_metadata.v3.data_type.fixed_length_utf32 import FixedLengthUtf32 + from zarr_metadata.v3.data_type.null_terminated_bytes import NullTerminatedBytes S2Level = Literal["L1C", "L2A"] @@ -233,7 +230,7 @@ def _plan_band( def _band_array( attributes: dict[str, object], shape: tuple[int, ...], - data_type: str | FixedLengthUtf32Object | NullTerminatedBytesObject, + data_type: str | FixedLengthUtf32 | NullTerminatedBytes, fill_value: FillValue, dimension_names: tuple[str, ...], typesize: int, @@ -275,17 +272,14 @@ def _band_array( def _plan_coordinate(name: str, size: int) -> DataArray: """A 1-D coordinate array (`x` or `y`): float64, NaN-filled, one chunk.""" - return DataArray.model_validate( - { - "attributes": {"_FillValue": _NAN_FLOAT64_B64}, - "shape": (size,), - "data_type": "float64", - "chunk_grid": _regular_grid((size,)), - "chunk_key_encoding": _CHUNK_KEY_ENCODING, - "fill_value": "NaN", - "codecs": (_BYTES_LITTLE,), - "dimension_names": (name,), - } + # create_default supplies the one-chunk grid, the `/` chunk key encoding + # and the little-endian bytes codec + return DataArray.create_default( + attributes={"_FillValue": _NAN_FLOAT64_B64}, + shape=(size,), + data_type="float64", + fill_value="NaN", + dimension_names=(name,), ) @@ -349,16 +343,13 @@ def _plan_spatial_ref(wkt2: str, *, native: bool) -> ArraySpecV3: codecs: tuple[BytesCodecObject | ZstdCodecObject, ...] = (_BYTES_LITTLE,) if native: codecs = (*codecs, {"name": "zstd", "configuration": {"level": 0, "checksum": False}}) - return ArraySpecV3.model_validate( - { - "attributes": _grid_mapping_attributes(wkt2), - "shape": (), - "data_type": "int64", - "chunk_grid": _regular_grid(()), - "chunk_key_encoding": _CHUNK_KEY_ENCODING, - "fill_value": 0, - "codecs": codecs, - } + # create_default supplies the scalar chunk grid, the `/` chunk key + # encoding and the zero fill value + return ArraySpecV3.create_default( + attributes=_grid_mapping_attributes(wkt2), + shape=(), + data_type="int64", + codecs=codecs, ) @@ -644,7 +635,7 @@ def _doc_attrs(doc: Mapping[str, Any]) -> Mapping[str, object]: return attributes -def _v3_data_type(dtype_v2: str) -> str | FixedLengthUtf32Object | NullTerminatedBytesObject: +def _v3_data_type(dtype_v2: str) -> str | FixedLengthUtf32 | NullTerminatedBytes: """The Zarr V3 data type of a Zarr V2 dtype string.""" parsed = np.dtype(dtype_v2) if parsed.kind == "U": @@ -703,18 +694,15 @@ def _plan_carried_array(name: str, doc: _ArrayDoc, *, spatial: bool) -> DataArra name=name, ) if dims == (name,): - # a coordinate array: one chunk, uncompressed - return DataArray.model_validate( - { - "attributes": attributes, - "shape": shape, - "data_type": data_type, - "chunk_grid": _regular_grid(shape), - "chunk_key_encoding": _CHUNK_KEY_ENCODING, - "fill_value": fill_value, - "codecs": (_BYTES_LITTLE,), - "dimension_names": dims, - } + # a coordinate array: one chunk, uncompressed (create_default supplies + # the one-chunk grid and the `/` chunk key encoding) + return DataArray.create_default( + attributes=attributes, + shape=shape, + data_type=data_type, + fill_value=fill_value, + codecs=(_BYTES_LITTLE,), + dimension_names=dims, ) return _band_array(attributes, shape, data_type, fill_value, dims, typesize=parsed.itemsize) diff --git a/tests/test_data_api/test_v2.py b/tests/test_data_api/test_v2.py index dd4c6941..6a370f52 100644 --- a/tests/test_data_api/test_v2.py +++ b/tests/test_data_api/test_v2.py @@ -96,8 +96,8 @@ def test_missing_grid_mapping_variable(self) -> None: """A member declaring a grid_mapping that is not in the dataset fails validation.""" members = self._members() band = members["band"] - members["band"] = band.model_copy( - update={"attributes": band.attributes.model_copy(update={"grid_mapping": "nope"})} + members["band"] = band.replace( + attributes=band.attributes.model_copy(update={"grid_mapping": "nope"}) ) with pytest.raises(ValidationError, match="Grid mapping variable 'nope'"): Dataset(attributes=DatasetAttrs(), members=members) diff --git a/tests/test_data_api/test_v3.py b/tests/test_data_api/test_v3.py index 83ff5779..2f78bb57 100644 --- a/tests/test_data_api/test_v3.py +++ b/tests/test_data_api/test_v3.py @@ -119,8 +119,8 @@ def test_missing_grid_mapping_variable(self) -> None: """A member declaring a grid_mapping that is not in the dataset fails validation.""" members = self._members() band = members["band"] - members["band"] = band.model_copy( - update={"attributes": band.attributes.model_copy(update={"grid_mapping": "nope"})} + members["band"] = band.replace( + attributes=band.attributes.model_copy(update={"grid_mapping": "nope"}) ) with pytest.raises(ValidationError, match="Grid mapping variable 'nope'"): Dataset(attributes=DatasetAttrs(), members=members) diff --git a/uv.lock b/uv.lock index 7b64a3ee..5dceeb9f 100644 --- a/uv.lock +++ b/uv.lock @@ -1683,6 +1683,7 @@ dependencies = [ { name = "xarray" }, { name = "zarr", extra = ["cast-value-rs"] }, { name = "zarr-cm" }, + { name = "zarr-metadata" }, ] [package.optional-dependencies] @@ -1734,7 +1735,7 @@ requires-dist = [ { name = "eopf", marker = "python_full_version >= '3.13' and extra == 'cpm'", specifier = ">=3.0.0" }, { name = "numpy", specifier = ">=2.3.1" }, { name = "pydantic", specifier = ">=2.14.1" }, - { name = "pydantic-zarr", git = "https://github.com/zarr-developers/pydantic-zarr.git?rev=9f2e847ce7fe2c98119699ddcf3e090fba688e1f" }, + { name = "pydantic-zarr", git = "https://github.com/zarr-developers/pydantic-zarr.git?rev=b0efedbfbf9933726001883ac1cadae670e5181b" }, { name = "pygit2", specifier = ">=1.20.1" }, { name = "pyproj", specifier = ">=3.7.0" }, { name = "pystac", specifier = ">=1.8.0" }, @@ -1747,6 +1748,7 @@ requires-dist = [ { name = "xarray", specifier = ">=2025.7.1" }, { name = "zarr", extras = ["cast-value-rs"], specifier = ">=3.2.0,<3.5.0" }, { name = "zarr-cm", specifier = ">=0.5.0" }, + { name = "zarr-metadata", specifier = ">=0.8.0" }, ] provides-extras = ["cpm"] @@ -4532,8 +4534,8 @@ wheels = [ [[package]] name = "pydantic-zarr" -version = "0.10.1.dev41+g9f2e847ce" -source = { git = "https://github.com/zarr-developers/pydantic-zarr.git?rev=9f2e847ce7fe2c98119699ddcf3e090fba688e1f#9f2e847ce7fe2c98119699ddcf3e090fba688e1f" } +version = "0.10.1.dev48+gb0efedbfb" +source = { git = "https://github.com/zarr-developers/pydantic-zarr.git?rev=b0efedbfbf9933726001883ac1cadae670e5181b#b0efedbfbf9933726001883ac1cadae670e5181b" } dependencies = [ { name = "numpy", version = "2.4.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.13'" }, { name = "numpy", version = "2.5.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.13'" }, @@ -6722,15 +6724,15 @@ wheels = [ [[package]] name = "zarr-metadata" -version = "0.6.0" +version = "0.8.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "annotated-types" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/5f/a3/4526430215c09ed45d47886a7c8b439218622a4f05e6ce1198147961ca64/zarr_metadata-0.6.0.tar.gz", hash = "sha256:4462dc91cdb8c19c370bcd548096125591359579586f42de789dc495a33119d0", size = 519797, upload-time = "2026-10-26T13:55:27.086Z" } +sdist = { url = "https://files.pythonhosted.org/packages/95/e2/8e1f15171c0a21e9fda74e17ba6ed5820dc2ee10e500d2594ceec4eaf1ff/zarr_metadata-0.8.0.tar.gz", hash = "sha256:cd91855317118014f84c670a6f73c568cafdc781750e4f071651084a73b5c71f", size = 607925, upload-time = "2026-11-13T08:15:50.448Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/20/b2/c70c528d438bbf656873e8da51949c50efff866b85c6ee3335ba81bf1142/zarr_metadata-0.6.0-py3-none-any.whl", hash = "sha256:ab1f9f33d18094ffac020c2c975aa32f8737f36a0dfa8543b6c6d717a3469d1e", size = 274628, upload-time = "2026-10-26T13:55:25.798Z" }, + { url = "https://files.pythonhosted.org/packages/9a/da/f7d2d72d44a6bd4f361d9e6b4f81166fed0254ff3856573ca2949c0eb150/zarr_metadata-0.8.0-py3-none-any.whl", hash = "sha256:6cb20d7c96665dbf5ba2eaebe49f9a2f416a73b8f8dbb2e0ed95ece67cf5a0b6", size = 336024, upload-time = "2026-11-13T08:15:49.029Z" }, ] [[package]] From 9959549d5c9996c6e9d6960fc4b607439cb4bd31 Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Fri, 13 Nov 2026 12:15:00 +0100 Subject: [PATCH 14/45] docs(data-api): say the DataArray scope is ZARR_PYTHON_CONTEXT Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 --- src/eopf_geozarr/data_api/geozarr/v3.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/eopf_geozarr/data_api/geozarr/v3.py b/src/eopf_geozarr/data_api/geozarr/v3.py index 02bdc7c2..da0e506c 100644 --- a/src/eopf_geozarr/data_api/geozarr/v3.py +++ b/src/eopf_geozarr/data_api/geozarr/v3.py @@ -40,9 +40,10 @@ class DataArray(ArraySpec[BaseDataArrayAttrs]): # codecs, storage transformers) must be claimed by a definition in the # validation scope, instead of passing unjudged: a GeoZarr DataArray is a # conformance contract, so a typo'd or unknown codec or data type name is - # refused at validation. The scope is the default plus the data types - # zarr-python writes that it lacks (fixed_length_utf32 band/angle - # coordinates); an explicit pydantic validation context still overrides. + # refused at validation. The scope is zarr-metadata's ZARR_PYTHON_CONTEXT, + # which claims everything zarr-python writes, fixed_length_utf32 and + # null_terminated_bytes band/angle coordinates included; an explicit + # pydantic validation context still overrides. zarr_scope = GEOZARR_SCOPE zarr_scope_strict = True From c433fc06f96c5fd1aa4875f59805c7b01ed3ee3c Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Fri, 13 Nov 2026 18:08:23 +0100 Subject: [PATCH 15/45] refactor(data-api): depend on pydantic-zarr 0.11 and read dtypes with it - Require pydantic-zarr>=0.11.0, sourced from the v0.11.0 tag until the release reaches PyPI, instead of a commit on main. - s2_plan converts a V2 dtype to its Zarr V3 form with `parse_dtype_v3(..., scope=GEOZARR_SCOPE)` instead of its own mapping. 0.11 reads numpy's fixed-length unicode and bytes types as zarr-python writes them. The local mapping turned a datetime dtype into an unclaimed name such as "datetime64[ns]"; `parse_dtype_v3` gives the `numpy.datetime64` form. - 0.11 accepts zarr-metadata's typed codec objects on `create_default`, so the builders that pass them type-check. Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 --- pyproject.toml | 11 ++++------- src/eopf_geozarr/data_api/s2_plan.py | 25 +++++-------------------- uv.lock | 6 +++--- 3 files changed, 12 insertions(+), 30 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 55e8e158..706dca93 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,7 +44,7 @@ classifiers = [ ] requires-python = ">=3.12" dependencies = [ - "pydantic-zarr>=0.8.0", + "pydantic-zarr>=0.11.0", # imported directly (scopes, typed metadata objects, typed_json.check) "zarr-metadata>=0.8.0", "pydantic>=2.14.1", @@ -262,11 +262,8 @@ constraint-dependencies = [ ] [tool.uv.sources] -# pydantic-zarr main (pinned to the validated commit, so installs without this -# repo's lock stay reproducible): scoped whole-document metadata validation -# against zarr-metadata 0.8's scopes, the zarr_scope / zarr_scope_strict class -# variables, MISSING-based attribute models, and ArraySpec.create_default. -# Swap back to PyPI (pydantic-zarr>=0.11) once 0.11.0 releases. -pydantic-zarr = { git = "https://github.com/zarr-developers/pydantic-zarr.git", rev = "b0efedbfbf9933726001883ac1cadae670e5181b" } +# pydantic-zarr 0.11.0 is tagged but not yet on PyPI; drop this source once +# it is published. +pydantic-zarr = { git = "https://github.com/zarr-developers/pydantic-zarr.git", tag = "v0.11.0" } diff --git a/src/eopf_geozarr/data_api/s2_plan.py b/src/eopf_geozarr/data_api/s2_plan.py index 7bb7edc1..7c9d21b4 100644 --- a/src/eopf_geozarr/data_api/s2_plan.py +++ b/src/eopf_geozarr/data_api/s2_plan.py @@ -43,6 +43,7 @@ from pydantic_zarr.v2 import GroupSpec as GroupSpecV2 from pydantic_zarr.v3 import ArraySpec as ArraySpecV3 from pydantic_zarr.v3 import GroupSpec as GroupSpecV3 +from pydantic_zarr.v3 import parse_dtype_v3 from pyproj import CRS from typing_extensions import TypedDict from zarr_cm import ConventionMetadataObject @@ -52,6 +53,7 @@ from zarr_cm.spatial import CMO as SPATIAL_CMO from zarr_metadata.typed_json import check +from eopf_geozarr.data_api.geozarr.scope import GEOZARR_SCOPE from eopf_geozarr.data_api.geozarr.v3 import DataArray from eopf_geozarr.data_api.s2 import Sentinel2Root from eopf_geozarr.pyz.datatree import group_spec_from_datatree @@ -68,8 +70,6 @@ from zarr_metadata.v3.codec.crc32c import Crc32cCodecObject from zarr_metadata.v3.codec.sharding_indexed import ShardingIndexedCodecObject from zarr_metadata.v3.codec.zstd import ZstdCodecObject - from zarr_metadata.v3.data_type.fixed_length_utf32 import FixedLengthUtf32 - from zarr_metadata.v3.data_type.null_terminated_bytes import NullTerminatedBytes S2Level = Literal["L1C", "L2A"] @@ -230,7 +230,7 @@ def _plan_band( def _band_array( attributes: dict[str, object], shape: tuple[int, ...], - data_type: str | FixedLengthUtf32 | NullTerminatedBytes, + data_type: str | Mapping[str, object], fill_value: FillValue, dimension_names: tuple[str, ...], typesize: int, @@ -635,22 +635,6 @@ def _doc_attrs(doc: Mapping[str, Any]) -> Mapping[str, object]: return attributes -def _v3_data_type(dtype_v2: str) -> str | FixedLengthUtf32 | NullTerminatedBytes: - """The Zarr V3 data type of a Zarr V2 dtype string.""" - parsed = np.dtype(dtype_v2) - if parsed.kind == "U": - return { - "name": "fixed_length_utf32", - "configuration": {"length_bytes": parsed.itemsize}, - } - if parsed.kind == "S": - return { - "name": "null_terminated_bytes", - "configuration": {"length_bytes": parsed.itemsize}, - } - return parsed.name - - def _carried_array_attributes( attrs: Mapping[str, object], *, is_float: bool, grid_mapping: bool, name: str ) -> dict[str, object]: @@ -685,7 +669,8 @@ def _plan_carried_array(name: str, doc: _ArrayDoc, *, spatial: bool) -> DataArra if name in ("x", "y") and dims == (name,): return _plan_coordinate(name, shape[0]) parsed = np.dtype(str(doc["dtype"])) - data_type = _v3_data_type(str(doc["dtype"])) + # the Zarr V3 form zarr-python writes for the V2 dtype, in the GeoZarr scope + data_type = parse_dtype_v3(parsed, scope=GEOZARR_SCOPE) fill_value: FillValue = "NaN" if parsed.kind == "f" else "" if parsed.kind in "US" else 0 attributes = _carried_array_attributes( attrs, diff --git a/uv.lock b/uv.lock index 5dceeb9f..afc83919 100644 --- a/uv.lock +++ b/uv.lock @@ -1735,7 +1735,7 @@ requires-dist = [ { name = "eopf", marker = "python_full_version >= '3.13' and extra == 'cpm'", specifier = ">=3.0.0" }, { name = "numpy", specifier = ">=2.3.1" }, { name = "pydantic", specifier = ">=2.14.1" }, - { name = "pydantic-zarr", git = "https://github.com/zarr-developers/pydantic-zarr.git?rev=b0efedbfbf9933726001883ac1cadae670e5181b" }, + { name = "pydantic-zarr", git = "https://github.com/zarr-developers/pydantic-zarr.git?tag=v0.11.0" }, { name = "pygit2", specifier = ">=1.20.1" }, { name = "pyproj", specifier = ">=3.7.0" }, { name = "pystac", specifier = ">=1.8.0" }, @@ -4534,8 +4534,8 @@ wheels = [ [[package]] name = "pydantic-zarr" -version = "0.10.1.dev48+gb0efedbfb" -source = { git = "https://github.com/zarr-developers/pydantic-zarr.git?rev=b0efedbfbf9933726001883ac1cadae670e5181b#b0efedbfbf9933726001883ac1cadae670e5181b" } +version = "0.11.0" +source = { git = "https://github.com/zarr-developers/pydantic-zarr.git?tag=v0.11.0#aca8ee0ff45e3ae6ee1ffb0b9eeb67745814d750" } dependencies = [ { name = "numpy", version = "2.4.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.13'" }, { name = "numpy", version = "2.5.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.13'" }, From c2982038ce92f236eba836d48eb71b26cfda5c5b Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Fri, 13 Nov 2026 18:09:33 +0100 Subject: [PATCH 16/45] test(data-api): pin the V3 form of a carried datetime array A carried V2 ` --- tests/test_data_api/test_s2_plan.py | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/test_data_api/test_s2_plan.py b/tests/test_data_api/test_s2_plan.py index 892f21ad..864d086f 100644 --- a/tests/test_data_api/test_s2_plan.py +++ b/tests/test_data_api/test_s2_plan.py @@ -162,6 +162,36 @@ def test_plan_carries_a_mixed_groups_own_arrays() -> None: assert any("members" in member for member in planned_mixed.values()) +def test_plan_carries_a_datetime_array_in_its_v3_form() -> None: + """A carried V2 datetime array is planned with the Zarr V3 form zarr-python + writes, `numpy.datetime64` with its unit, which the GeoZarr scope claims.""" + path = _INPUT_PATHS[0] + document = _read(path) + mixed = document["members"]["conditions"]["members"]["mask"]["members"]["detector_footprint"] + mixed["members"]["time"] = { + "zarr_format": 2, + "shape": [3], + "chunks": [3], + "dtype": " None: """A product whose bands carry no proj attributes and whose stac_discovery declares none is refused with a ValueError, not a KeyError.""" From 6efb5dbdf82b69a08bc660fa9959f56a83fa7af8 Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Fri, 13 Nov 2026 18:25:02 +0100 Subject: [PATCH 17/45] fix(s2-plan): state spatial:shape on multiscale parent groups The five multiscale parent groups carried the finest level's `spatial:transform` without a `spatial:shape`, so a reader could not tell what grid the transform described. Both multiscale planners now write the finest level's shape with its transform. A test checks that every planned group with a transform also has its shape, and the snapshots are regenerated (#355). Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 --- src/eopf_geozarr/data_api/s2_plan.py | 9 ++++++-- ...041_N0511_R122_T32TQM_20251008T122613.json | 16 ++++++++++++++ ...309_N0511_R108_T32TLQ_20250113T122458.json | 8 +++++++ ...131_N0511_R037_T29TPF_20250811T152216.json | 16 ++++++++++++++ tests/test_data_api/test_s2_plan.py | 22 +++++++++++++++++++ 5 files changed, 69 insertions(+), 2 deletions(-) diff --git a/src/eopf_geozarr/data_api/s2_plan.py b/src/eopf_geozarr/data_api/s2_plan.py index 7c9d21b4..4a7db1a8 100644 --- a/src/eopf_geozarr/data_api/s2_plan.py +++ b/src/eopf_geozarr/data_api/s2_plan.py @@ -378,13 +378,16 @@ def _plan_spatial_ref(wkt2: str, *, native: bool) -> ArraySpecV3: "spatial:bbox": list[float], "spatial:dimensions": list[str], "spatial:registration": str, + "spatial:shape": list[int], "spatial:transform": list[float], "zarr_conventions": list[ConventionMetadataObject], }, ) """The attributes of a multiscale pyramid's root group: zarr-cm's multiscales -attributes plus the finest level's georeferencing (no `grid_mapping` or -`spatial:shape`, which belong to the level groups).""" +attributes plus the finest level's georeferencing, its `spatial:shape` with +its `spatial:transform` so the transform says what grid it describes +(EOPF-Explorer/data-model#355); no `grid_mapping`, which belongs to the level +groups.""" def _spatial_dataset_attributes( @@ -582,6 +585,7 @@ def plan_reflectance(root: Sentinel2Root) -> AnyGroupSpec: "spatial:bbox": finest_level_attrs["spatial:bbox"], "spatial:dimensions": ["y", "x"], "spatial:registration": "pixel", + "spatial:shape": level_attributes[finest_meters]["spatial:shape"], "spatial:transform": [ float(finest_meters), 0.0, @@ -882,6 +886,7 @@ def _plan_aux_multiscale( "spatial:bbox": level_attributes[min(input_levels)]["spatial:bbox"], "spatial:dimensions": ["y", "x"], "spatial:registration": "pixel", + "spatial:shape": level_attributes[finest_meters]["spatial:shape"], "spatial:transform": [ float(finest_meters), 0.0, diff --git a/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json b/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json index 09e7e3d0..ca414a86 100644 --- a/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json +++ b/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json @@ -2409,6 +2409,10 @@ "x" ], "spatial:registration": "pixel", + "spatial:shape": [ + 1830, + 1830 + ], "spatial:transform": [ 60.0, 0.0, @@ -3699,6 +3703,10 @@ "x" ], "spatial:registration": "pixel", + "spatial:shape": [ + 5490, + 5490 + ], "spatial:transform": [ 20.0, 0.0, @@ -7383,6 +7391,10 @@ "x" ], "spatial:registration": "pixel", + "spatial:shape": [ + 10980, + 10980 + ], "spatial:transform": [ 10.0, 0.0, @@ -18266,6 +18278,10 @@ "x" ], "spatial:registration": "pixel", + "spatial:shape": [ + 5490, + 5490 + ], "spatial:transform": [ 20.0, 0.0, diff --git a/tests/_test_data/optimized_geozarr_examples/S2B_MSIL1C_20250113T103309_N0511_R108_T32TLQ_20250113T122458.json b/tests/_test_data/optimized_geozarr_examples/S2B_MSIL1C_20250113T103309_N0511_R108_T32TLQ_20250113T122458.json index 288ef61f..3ef1d4ad 100644 --- a/tests/_test_data/optimized_geozarr_examples/S2B_MSIL1C_20250113T103309_N0511_R108_T32TLQ_20250113T122458.json +++ b/tests/_test_data/optimized_geozarr_examples/S2B_MSIL1C_20250113T103309_N0511_R108_T32TLQ_20250113T122458.json @@ -2409,6 +2409,10 @@ "x" ], "spatial:registration": "pixel", + "spatial:shape": [ + 1830, + 1830 + ], "spatial:transform": [ 60.0, 0.0, @@ -5724,6 +5728,10 @@ "x" ], "spatial:registration": "pixel", + "spatial:shape": [ + 10980, + 10980 + ], "spatial:transform": [ 10.0, 0.0, diff --git a/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json b/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json index 6f505d95..ec0387a1 100644 --- a/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json +++ b/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json @@ -2409,6 +2409,10 @@ "x" ], "spatial:registration": "pixel", + "spatial:shape": [ + 1830, + 1830 + ], "spatial:transform": [ 60.0, 0.0, @@ -3699,6 +3703,10 @@ "x" ], "spatial:registration": "pixel", + "spatial:shape": [ + 5490, + 5490 + ], "spatial:transform": [ 20.0, 0.0, @@ -7383,6 +7391,10 @@ "x" ], "spatial:registration": "pixel", + "spatial:shape": [ + 10980, + 10980 + ], "spatial:transform": [ 10.0, 0.0, @@ -18266,6 +18278,10 @@ "x" ], "spatial:registration": "pixel", + "spatial:shape": [ + 5490, + 5490 + ], "spatial:transform": [ 20.0, 0.0, diff --git a/tests/test_data_api/test_s2_plan.py b/tests/test_data_api/test_s2_plan.py index 864d086f..0ee85255 100644 --- a/tests/test_data_api/test_s2_plan.py +++ b/tests/test_data_api/test_s2_plan.py @@ -97,6 +97,28 @@ def test_plan_georeferencing_is_self_consistent(path: pathlib.Path) -> None: assert crs.to_epsg() == epsg +def _groups(node: dict[str, Any], path: str = "") -> list[tuple[str, dict[str, Any]]]: + """Every group of a dumped tree, with its path.""" + if node.get("node_type") != "group": + return [] + found = [(path or "/", node)] + for name, member in (node.get("members") or {}).items(): + found.extend(_groups(member, f"{path}/{name}")) + return found + + +@pytest.mark.parametrize("path", _INPUT_PATHS, ids=lambda p: p.stem[:26]) +def test_plan_states_a_shape_with_every_transform(path: pathlib.Path) -> None: + """Every planned group with a `spatial:transform` also has the `spatial:shape` + it describes, multiscale parents included (EOPF-Explorer/data-model#355).""" + missing = [ + group_path + for group_path, group in _groups(_planned_root(path)) + if "spatial:transform" in group["attributes"] and "spatial:shape" not in group["attributes"] + ] + assert missing == [] + + def test_load_sentinel2_keeps_the_model(tmp_path: pathlib.Path) -> None: """ `load_sentinel2` reads a Zarr store into the validated input model, and From a2b8247a185a92349a1123594f74a6ef9eba46cc Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Fri, 13 Nov 2026 18:28:52 +0100 Subject: [PATCH 18/45] fix(s2-plan): put the carried CF attributes right - A `flag_meanings` list is joined into the one blank-separated string CF defines. The SCL flag table is written as a string too. - The `dtype` attribute, which repeats the array's data type, is dropped. - A `valid_min` / `valid_max` outside the range of the integer data type is dropped. The scl `uint8` array's `valid_max: 65535` was one. - A carried `short_name` is written for the level the array is in, as `_rm`. Coarsened levels copied the source level's name, and the source styles were mixed. The first three rules live in one helper, `normalize_cf_array_attrs`, which the S2 plan and the shared `sanitize_array_attrs` both apply. `sanitize_array_attrs` now also drops `valid_*` for decoded floats, as its docstring said. Tests cover the helper's cases, the snapshots' attributes, and a planted array on native and coarsened levels. The snapshots are regenerated (#351). Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 --- .../conversion/sentinel1_reprojection.py | 2 +- src/eopf_geozarr/conversion/utils.py | 49 +++- src/eopf_geozarr/data_api/s2_plan.py | 65 ++++- .../s2_optimization/s2_multiscale.py | 3 +- ...041_N0511_R122_T32TQM_20251008T122613.json | 272 ++---------------- ...309_N0511_R108_T32TLQ_20250113T122458.json | 197 ++----------- ...131_N0511_R037_T29TPF_20250811T152216.json | 272 ++---------------- tests/test_array_attrs.py | 88 +++++- tests/test_data_api/test_s2_plan.py | 35 +++ 9 files changed, 284 insertions(+), 699 deletions(-) diff --git a/src/eopf_geozarr/conversion/sentinel1_reprojection.py b/src/eopf_geozarr/conversion/sentinel1_reprojection.py index ed3f0aea..40d22533 100644 --- a/src/eopf_geozarr/conversion/sentinel1_reprojection.py +++ b/src/eopf_geozarr/conversion/sentinel1_reprojection.py @@ -266,7 +266,7 @@ def _reproject_data_variable( raise ValueError(f"Unsupported data variable dimensionality: {data_var.ndim}") # Create attributes for reprojected variable - attrs = utils.sanitize_array_attrs(data_var.attrs.copy()) + attrs = utils.sanitize_array_attrs(data_var.attrs.copy(), dtype=data_var.dtype) attrs["_ARRAY_DIMENSIONS"] = dims attrs["grid_mapping"] = "spatial_ref" diff --git a/src/eopf_geozarr/conversion/utils.py b/src/eopf_geozarr/conversion/utils.py index 4395bc44..c1e863d6 100644 --- a/src/eopf_geozarr/conversion/utils.py +++ b/src/eopf_geozarr/conversion/utils.py @@ -742,7 +742,9 @@ def create_uniform_encoding( # remove keys, so stale ``_eopf_attrs`` / ``dtype`` / ``valid_*`` would # otherwise leak into the output). is_float = np.issubdtype(var_data.dtype, np.floating) - var_data.attrs = sanitize_array_attrs(var_data.attrs, is_decoded_float=is_float) + var_data.attrs = sanitize_array_attrs( + var_data.attrs, is_decoded_float=is_float, dtype=var_data.dtype + ) encoding[str(var_name)] = var_encoding @@ -763,7 +765,7 @@ def create_uniform_encoding( else: coord_encoding: XarrayDataArrayEncoding = {"compressors": ()} - coord_data.attrs = sanitize_array_attrs(coord_data.attrs) + coord_data.attrs = sanitize_array_attrs(coord_data.attrs, dtype=coord_data.dtype) encoding[str(coord_name)] = coord_encoding return encoding @@ -893,10 +895,42 @@ def explicit_fill_value(var: xr.DataArray) -> Any: return source_fill +def normalize_cf_array_attrs( + attrs: Mapping[str, Any], dtype: np.dtype[Any] | None = None +) -> dict[str, Any]: + """Return a copy of *attrs* with the CF attributes put right + (EOPF-Explorer/data-model#351). + + - A ``flag_meanings`` list is joined into the one blank-separated string + CF defines. + - The ``dtype`` attribute, which repeats the array's data type, is removed. + - ``valid_min`` / ``valid_max`` outside the range of an integer *dtype* + (``valid_max: 65535`` on a ``uint8`` array, say) are removed: they + cannot describe the stored values. + """ + out = dict(attrs) + out.pop("dtype", None) + meanings = out.get("flag_meanings") + if isinstance(meanings, (list, tuple)): + out["flag_meanings"] = " ".join(str(meaning) for meaning in meanings) + if dtype is not None and np.dtype(dtype).kind in "iu": + info = np.iinfo(dtype) + for key in ("valid_min", "valid_max"): + value = out.get(key) + if ( + isinstance(value, (int, float)) + and not isinstance(value, bool) + and not info.min <= value <= info.max + ): + del out[key] + return out + + def sanitize_array_attrs( attrs: dict[str, Any], *, is_decoded_float: bool = False, + dtype: np.dtype[Any] | None = None, ) -> dict[str, Any]: """Return a copy of *attrs* with source-only and misleading keys removed. @@ -911,9 +945,12 @@ def sanitize_array_attrs( (``s3_olci_optimization.olci_converter._sanitize_olci_array_attrs_keep_fill``) that **preserves** ``_FillValue`` for raw (non-mask-scaled) input. Edits to the strip-list here do not apply there, and vice versa. + - The CF attributes are put right (`normalize_cf_array_attrs`): a + ``flag_meanings`` list is joined, ``dtype`` is removed, and + ``valid_min`` / ``valid_max`` outside the range of *dtype* are removed. - For decoded float measurement arrays (*is_decoded_float=True*), also - removes raw-encoding leftovers ``dtype``, ``fill_value``, - ``valid_min``, ``valid_max`` and rewrites + removes raw-encoding leftovers ``fill_value``, ``valid_min`` and + ``valid_max`` (which describe the packed integers) and rewrites ``units: "digital_counts"`` → ``"1"``. - Geo-proj *convention* keys (``proj:code``, ``proj:wkt2``, @@ -925,10 +962,10 @@ def sanitize_array_attrs( CF keys ``scale_factor`` and ``add_offset`` are always preserved. """ dropped = {"_eopf_attrs", "_FillValue", *geo_proj_cm.CONVENTION_KEYS} - out = {k: v for k, v in attrs.items() if k not in dropped} + out = normalize_cf_array_attrs({k: v for k, v in attrs.items() if k not in dropped}, dtype) if is_decoded_float: - for key in ("dtype", "fill_value"): + for key in ("fill_value", "valid_min", "valid_max"): out.pop(key, None) if out.get("units") == "digital_counts": out["units"] = "1" diff --git a/src/eopf_geozarr/data_api/s2_plan.py b/src/eopf_geozarr/data_api/s2_plan.py index 4a7db1a8..79d94d83 100644 --- a/src/eopf_geozarr/data_api/s2_plan.py +++ b/src/eopf_geozarr/data_api/s2_plan.py @@ -33,6 +33,7 @@ from __future__ import annotations import base64 +import re import struct from collections.abc import Mapping from math import ceil @@ -53,6 +54,7 @@ from zarr_cm.spatial import CMO as SPATIAL_CMO from zarr_metadata.typed_json import check +from eopf_geozarr.conversion.utils import normalize_cf_array_attrs from eopf_geozarr.data_api.geozarr.scope import GEOZARR_SCOPE from eopf_geozarr.data_api.geozarr.v3 import DataArray from eopf_geozarr.data_api.s2 import Sentinel2Root @@ -224,6 +226,7 @@ def _plan_band( for key in _BAND_ATTR_CARRY: if key in source_attrs: attributes[key] = source_attrs[key] + attributes = normalize_cf_array_attrs(attributes, np.dtype(data_type)) return _band_array(attributes, shape, data_type, fill_value, dimension_names, typesize) @@ -639,12 +642,46 @@ def _doc_attrs(doc: Mapping[str, Any]) -> Mapping[str, object]: return attributes +_LEVEL_GROUP = re.compile(r"r(\d+)m") +"""The name of a resolution level group (`r10m`, `r720m`), its metres captured.""" + + +def _level_meters(path: str) -> int | None: + """The resolution in metres of the level group at `path`, if it is one.""" + match = _LEVEL_GROUP.fullmatch(path.rsplit("/", 1)[-1]) + return int(match.group(1)) if match else None + + +def _with_level_short_name( + attributes: dict[str, object], name: str, meters: int | None +) -> dict[str, object]: + """ + `attributes` with a carried `short_name` written for the level the array + is in, `_rm`: a source `short_name` names the source + level (and a coarsened level copied it verbatim), and the source styles + are mixed (EOPF-Explorer/data-model#351). Outside a level group, or + without a `short_name`, the attributes are returned as they are. + """ + if meters is None or "short_name" not in attributes: + return attributes + return {**attributes, "short_name": f"{name}_r{meters}m"} + + def _carried_array_attributes( - attrs: Mapping[str, object], *, is_float: bool, grid_mapping: bool, name: str + attrs: Mapping[str, object], + *, + is_float: bool, + grid_mapping: bool, + name: str, + dtype: np.dtype[Any], + level_meters: int | None = None, ) -> dict[str, object]: - """The output attributes of a carried array: sanitized, with the CF float - fill, the grid-mapping reference and the SCL flag table added.""" - out = {key: value for key, value in attrs.items() if key not in _DROPPED_ATTRS} + """The output attributes of a carried array: sanitized, the CF attributes + put right for its data type, with the CF float fill, the grid-mapping + reference, the SCL flag table and a per-level `short_name`.""" + out = normalize_cf_array_attrs( + {key: value for key, value in attrs.items() if key not in _DROPPED_ATTRS}, dtype + ) if is_float: out["_FillValue"] = _NAN_FLOAT64_B64 if grid_mapping: @@ -653,10 +690,12 @@ def _carried_array_attributes( # the converter's SCL flag table and NO_DATA fill declaration out.update(SCL_ATTRS) out["_FillValue"] = SCL_NODATA - return out + return _with_level_short_name(out, name, level_meters) -def _plan_carried_array(name: str, doc: _ArrayDoc, *, spatial: bool) -> DataArray: +def _plan_carried_array( + name: str, doc: _ArrayDoc, *, spatial: bool, level_meters: int | None = None +) -> DataArray: """ One carried (non-reflectance) array, translated to its output document: `x`/`y` become the float64 coordinate arrays, other coordinate arrays @@ -681,6 +720,8 @@ def _plan_carried_array(name: str, doc: _ArrayDoc, *, spatial: bool) -> DataArra is_float=parsed.kind == "f", grid_mapping=spatial and "proj:epsg" in attrs, name=name, + dtype=parsed, + level_meters=level_meters, ) if dims == (name,): # a coordinate array: one chunk, uncompressed (create_default supplies @@ -743,8 +784,9 @@ def _plan_dataset(group: _GroupDoc, path: str) -> AnyGroupSpec | None: if not arrays: return None anchor = _spatial_anchor(arrays) + meters = _level_meters(path) members: dict[str, DataArray | ArraySpecV3] = { - name: _plan_carried_array(name, member, spatial=anchor is not None) + name: _plan_carried_array(name, member, spatial=anchor is not None, level_meters=meters) for name, member in arrays.items() } if anchor is None: @@ -811,7 +853,9 @@ def _plan_aux_multiscale( for name, member in _carried_arrays(input_levels[meters]).items(): if name in ("x", "y"): continue - variables[name] = _plan_carried_array(name, member, spatial=True) + variables[name] = _plan_carried_array( + name, member, spatial=True, level_meters=meters + ) if not variables: msg = f"The {path} r{meters}m dataset holds no arrays" raise ValueError(msg) @@ -829,9 +873,10 @@ def _plan_aux_multiscale( if not isinstance(data_type, str): msg = f"Cannot coarsen {path} variable {name!r} of data type {data_type!r}" raise TypeError(msg) - # a coarsened variable keeps its attributes verbatim + # a coarsened variable keeps its attributes, its short_name + # written for this level variables[name] = _band_array( - previous.attributes.model_dump(), + _with_level_short_name(previous.attributes.model_dump(), name, meters), shape, data_type, previous.fill_value, diff --git a/src/eopf_geozarr/s2_optimization/s2_multiscale.py b/src/eopf_geozarr/s2_optimization/s2_multiscale.py index 4192d01e..8d3974c3 100644 --- a/src/eopf_geozarr/s2_optimization/s2_multiscale.py +++ b/src/eopf_geozarr/s2_optimization/s2_multiscale.py @@ -39,7 +39,8 @@ SCL_ATTRS = { "flag_values": SCL_VALUES, - "flag_meanings": SCL_LABELS, + # CF: one string of blank-separated words, not a list (#351) + "flag_meanings": " ".join(SCL_LABELS), } SCL_NODATA = SCL_VALUES[SCL_LABELS.index("NO_DATA")] diff --git a/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json b/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json index ca414a86..73550190 100644 --- a/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json +++ b/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json @@ -568,7 +568,6 @@ "members": { "b02": { "attributes": { - "dtype": " None: assert not mask[-1, -1], "valid cell must not be masked" finally: reopened.close() + + +def test_flag_meanings_are_one_string(snapshot: dict) -> None: + offenders = [ + path + for path, node in _walk(snapshot) + if "flag_meanings" in (node.get("attributes") or {}) + and not isinstance(node["attributes"]["flag_meanings"], str) + ] + assert not offenders, f"`flag_meanings` is not a string at: {offenders}" + + +def test_no_dtype_attribute(snapshot: dict) -> None: + offenders = [ + path for path, node in _walk(snapshot) if "dtype" in (node.get("attributes") or {}) + ] + assert not offenders, f"`dtype` attribute at: {offenders}" + + +def test_valid_range_fits_the_data_type(snapshot: dict) -> None: + offenders = [] + for path, node in _walk(snapshot): + data_type = node.get("data_type") + if not isinstance(data_type, str) or np.dtype(data_type).kind not in "iu": + continue + info = np.iinfo(data_type) + for key in ("valid_min", "valid_max"): + value = (node.get("attributes") or {}).get(key) + if value is not None and not info.min <= value <= info.max: + offenders.append((path, key, value)) + assert not offenders, f"`valid_*` outside the data type at: {offenders}" + + +def test_short_name_names_its_level(snapshot: dict) -> None: + offenders = [] + for path, node in _walk(snapshot): + short_name = (node.get("attributes") or {}).get("short_name") + if node.get("node_type") != "array" or short_name is None: + continue + parent, name = path.rsplit("/", 1) + level = re.fullmatch(r"r(\d+)m", parent.rsplit("/", 1)[-1]) + if level and short_name != f"{name}_{level.group(0)}": + offenders.append((path, short_name)) + assert not offenders, f"`short_name` names another level at: {offenders}" + + +@pytest.mark.parametrize( + ("attrs", "dtype", "expected"), + [ + ( + {"flag_meanings": ["a", "b"], "flag_values": [0, 1]}, + "uint8", + {"flag_meanings": "a b", "flag_values": [0, 1]}, + ), + ({"flag_meanings": "a b"}, "uint8", {"flag_meanings": "a b"}), + ({"dtype": " None: + """The CF attributes are put right for the data type, and the input is not modified.""" + before = dict(attrs) + result = normalize_cf_array_attrs(attrs, None if dtype is None else np.dtype(dtype)) + assert result == expected + assert attrs == before diff --git a/tests/test_data_api/test_s2_plan.py b/tests/test_data_api/test_s2_plan.py index 0ee85255..91153e8f 100644 --- a/tests/test_data_api/test_s2_plan.py +++ b/tests/test_data_api/test_s2_plan.py @@ -214,6 +214,41 @@ def test_plan_carries_a_datetime_array_in_its_v3_form() -> None: assert time["dimension_names"] == ["time"] +def test_plan_puts_cf_attributes_right_on_every_level() -> None: + """ + A carried array's CF attributes are put right on its native level and on + every level coarsened from it (#351): its `short_name` names its own + level, a `flag_meanings` list becomes one string, the `dtype` attribute + is dropped, and a `valid_max` the data type cannot hold is dropped. + """ + path = next(p for p in _INPUT_PATHS if "MSIL2A" in p.name) + document = _read(path) + l2a = document["members"]["conditions"]["members"]["mask"]["members"]["l2a_classification"] + # both native levels name the other level, as the source products do once + # a level's attributes are copied + for level, wrong in (("r20m", "scl_r60m"), ("r60m", "scl_r20m")): + l2a["members"][level]["members"]["scl"]["attributes"].update( + { + "short_name": wrong, + "flag_meanings": ["no_data", "saturated"], + "dtype": " None: """A product whose bands carry no proj attributes and whose stac_discovery declares none is refused with a ValueError, not a KeyError.""" From 24664e2fbec22a817736f9b85fa5ee4c00fd722d Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Fri, 13 Nov 2026 18:32:27 +0100 Subject: [PATCH 19/45] fix(s2-plan): do not shard an array that fits in one inner chunk Every band and carried data array got a shard, even when the whole array fit in one inner chunk. Those shards held that one chunk, so a reader made an index request for nothing. 201 such arrays appeared across the three snapshots, for example the 9 x 9 meteorology and 23 x 23 angle arrays. Such an array is now written in plain chunks, with one chunk covering it, under the same bytes + blosc codecs. Arrays that span several inner chunks keep their shards, including a shard larger than the array. A test checks every planned array, and the snapshots are regenerated (#357). Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 --- src/eopf_geozarr/data_api/s2_plan.py | 20 +- ...041_N0511_R122_T32TQM_20251008T122613.json | 3206 +++++------------ ...309_N0511_R108_T32TLQ_20250113T122458.json | 2952 ++++----------- ...131_N0511_R037_T29TPF_20250811T152216.json | 3206 +++++------------ tests/test_data_api/test_s2_plan.py | 29 + 5 files changed, 2414 insertions(+), 6999 deletions(-) diff --git a/src/eopf_geozarr/data_api/s2_plan.py b/src/eopf_geozarr/data_api/s2_plan.py index 79d94d83..5342e7b6 100644 --- a/src/eopf_geozarr/data_api/s2_plan.py +++ b/src/eopf_geozarr/data_api/s2_plan.py @@ -238,7 +238,12 @@ def _band_array( dimension_names: tuple[str, ...], typesize: int, ) -> DataArray: - """One band array document: sharded uint16 with the blosc policy.""" + """ + One band array document with the blosc policy: sharded, unless the whole + array fits in one inner chunk, where a shard would hold that one chunk and + cost a reader an index request for nothing (#357); such an array is + written in plain chunks with the same codecs. + """ shard, inner = _shard_and_inner(shape) compressor: BloscCodecObject = { "name": "blosc", @@ -250,6 +255,19 @@ def _band_array( "blocksize": 0, }, } + if shard == inner: + return DataArray.model_validate( + { + "attributes": attributes, + "shape": shape, + "data_type": data_type, + "chunk_grid": _regular_grid(inner), + "chunk_key_encoding": _CHUNK_KEY_ENCODING, + "fill_value": fill_value, + "codecs": (_BYTES_LITTLE, compressor), + "dimension_names": dimension_names, + } + ) sharding: ShardingIndexedCodecObject = { "name": "sharding_indexed", "configuration": { diff --git a/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json b/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json index 73550190..a32355dc 100644 --- a/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json +++ b/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json @@ -147,41 +147,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 2 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 8 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" + }, + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 8 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "float64", @@ -219,42 +197,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 13, - 2 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 8 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" + }, + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 8 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "float64", @@ -294,43 +249,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 2, - 23, - 23 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 8 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" + }, + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 8 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "float64", @@ -374,45 +305,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 13, - 6, - 2, - 23, - 23 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 8 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" + }, + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 8 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "float64", @@ -2527,41 +2432,18 @@ "name": "default" }, "codecs": [ + { + "name": "bytes" + }, { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 1 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 1 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "uint8", @@ -2799,41 +2681,18 @@ "name": "default" }, "codecs": [ + { + "name": "bytes" + }, { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 1 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 1 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "uint8", @@ -3350,41 +3209,18 @@ "name": "default" }, "codecs": [ + { + "name": "bytes" + }, { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 1 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 1 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "uint8", @@ -3810,41 +3646,18 @@ "name": "default" }, "codecs": [ + { + "name": "bytes" + }, { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 1 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 1 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "uint8", @@ -4379,41 +4192,18 @@ "name": "default" }, "codecs": [ + { + "name": "bytes" + }, { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 1 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 1 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "uint8", @@ -4948,41 +4738,18 @@ "name": "default" }, "codecs": [ + { + "name": "bytes" + }, { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 1 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 1 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "uint8", @@ -5201,42 +4968,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -5306,42 +5050,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -5411,42 +5132,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -5516,42 +5214,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -5621,42 +5296,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -5726,42 +5378,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -5831,42 +5460,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -6019,42 +5625,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -6124,42 +5707,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -6229,42 +5789,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -6334,42 +5871,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -6537,42 +6051,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -6642,42 +6133,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -6747,42 +6215,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -6852,42 +6297,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -6957,42 +6379,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -7062,42 +6461,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -8017,42 +7393,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -8120,42 +7473,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -8223,42 +7553,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -8326,42 +7633,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -8429,42 +7713,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -8532,42 +7793,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -8635,42 +7873,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -8738,42 +7953,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -8841,42 +8033,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -8944,42 +8113,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -9047,42 +8193,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -9150,42 +8273,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -10737,42 +9837,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -10840,42 +9917,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -10943,42 +9997,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -11046,42 +10077,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -11149,42 +10157,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -11252,42 +10237,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -11355,42 +10317,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -11458,42 +10397,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -11561,42 +10477,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -11664,42 +10557,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -11767,42 +10637,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -11870,42 +10717,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -13560,42 +12384,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -13663,42 +12464,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -13766,42 +12544,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -13869,46 +12624,23 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" - } - ], - "data_type": "uint16", - "dimension_names": [ + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" + } + ], + "data_type": "uint16", + "dimension_names": [ "y", "x" ], @@ -13972,42 +12704,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -14075,42 +12784,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -14178,42 +12864,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -14281,42 +12944,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -14384,42 +13024,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -14487,42 +13104,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -14578,54 +13172,31 @@ 152, 152 ] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + }, + "name": "regular" + }, + "chunk_key_encoding": { + "configuration": { + "separator": "/" + }, + "name": "default" + }, + "codecs": [ + { + "configuration": { + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -14693,42 +13264,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -18175,41 +16723,18 @@ "name": "default" }, "codecs": [ + { + "name": "bytes" + }, { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 1 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 1 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "uint8", @@ -18269,41 +16794,18 @@ "name": "default" }, "codecs": [ + { + "name": "bytes" + }, { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 1 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 1 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "uint8", @@ -18902,41 +17404,18 @@ "name": "default" }, "codecs": [ + { + "name": "bytes" + }, { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 1 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 1 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "uint8", @@ -18996,41 +17475,18 @@ "name": "default" }, "codecs": [ + { + "name": "bytes" + }, { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 1 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 1 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "uint8", @@ -19622,41 +18078,18 @@ "name": "default" }, "codecs": [ + { + "name": "bytes" + }, { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 1 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 1 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "uint8", @@ -19716,41 +18149,18 @@ "name": "default" }, "codecs": [ + { + "name": "bytes" + }, { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 1 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 1 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "uint8", diff --git a/tests/_test_data/optimized_geozarr_examples/S2B_MSIL1C_20250113T103309_N0511_R108_T32TLQ_20250113T122458.json b/tests/_test_data/optimized_geozarr_examples/S2B_MSIL1C_20250113T103309_N0511_R108_T32TLQ_20250113T122458.json index a7a30895..af671507 100644 --- a/tests/_test_data/optimized_geozarr_examples/S2B_MSIL1C_20250113T103309_N0511_R108_T32TLQ_20250113T122458.json +++ b/tests/_test_data/optimized_geozarr_examples/S2B_MSIL1C_20250113T103309_N0511_R108_T32TLQ_20250113T122458.json @@ -147,41 +147,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 2 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 8 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" + }, + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 8 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "float64", @@ -219,42 +197,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 13, - 2 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 8 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" + }, + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 8 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "float64", @@ -294,43 +249,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 2, - 23, - 23 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 8 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" + }, + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 8 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "float64", @@ -374,45 +305,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 13, - 7, - 2, - 23, - 23 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 8 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" + }, + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 8 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "float64", @@ -2527,41 +2432,18 @@ "name": "default" }, "codecs": [ + { + "name": "bytes" + }, { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 1 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 1 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "uint8", @@ -2799,41 +2681,18 @@ "name": "default" }, "codecs": [ + { + "name": "bytes" + }, { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 1 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 1 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "uint8", @@ -3350,41 +3209,18 @@ "name": "default" }, "codecs": [ + { + "name": "bytes" + }, { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 1 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 1 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "uint8", @@ -3603,42 +3439,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -3708,42 +3521,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -3813,42 +3603,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -3918,42 +3685,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -4023,42 +3767,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -4128,42 +3849,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -4233,42 +3931,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -4421,42 +4096,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -4526,42 +4178,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -4631,42 +4260,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -4736,42 +4342,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -4939,42 +4522,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -5044,42 +4604,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -5149,42 +4686,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -5254,42 +4768,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -5359,42 +4850,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -5464,42 +4932,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -6419,42 +5864,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -6522,42 +5944,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -6625,42 +6024,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -6728,42 +6104,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -6831,42 +6184,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -6934,42 +6264,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -7037,42 +6344,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -7140,42 +6424,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -7243,42 +6504,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -7346,42 +6584,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -7449,42 +6664,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -7552,42 +6744,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -7655,42 +6824,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -9139,42 +8285,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -9242,42 +8365,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -9345,42 +8445,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -9448,42 +8525,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -9551,42 +8605,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -9654,42 +8685,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -9757,42 +8765,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -9860,42 +8845,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -9963,42 +8925,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -10066,42 +9005,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -10169,42 +9085,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -10272,42 +9165,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -10375,42 +9245,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -12168,42 +11015,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -12271,42 +11095,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -12374,42 +11175,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -12477,42 +11255,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -12580,45 +11335,22 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" - } - ], - "data_type": "uint16", + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" + } + ], + "data_type": "uint16", "dimension_names": [ "y", "x" @@ -12683,42 +11415,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -12786,42 +11495,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -12889,42 +11575,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -12992,42 +11655,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -13095,42 +11735,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -13198,42 +11815,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -13301,42 +11895,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -13404,42 +11975,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", diff --git a/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json b/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json index ad37524c..12d6ceed 100644 --- a/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json +++ b/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json @@ -147,41 +147,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 2 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 8 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" + }, + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 8 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "float64", @@ -219,42 +197,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 13, - 2 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 8 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" + }, + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 8 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "float64", @@ -294,43 +249,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 2, - 23, - 23 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 8 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" + }, + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 8 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "float64", @@ -374,45 +305,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 13, - 6, - 2, - 23, - 23 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 8 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" + }, + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 8 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "float64", @@ -2527,41 +2432,18 @@ "name": "default" }, "codecs": [ + { + "name": "bytes" + }, { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 1 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 1 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "uint8", @@ -2799,41 +2681,18 @@ "name": "default" }, "codecs": [ + { + "name": "bytes" + }, { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 1 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 1 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "uint8", @@ -3350,41 +3209,18 @@ "name": "default" }, "codecs": [ + { + "name": "bytes" + }, { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 1 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 1 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "uint8", @@ -3810,41 +3646,18 @@ "name": "default" }, "codecs": [ + { + "name": "bytes" + }, { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 1 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 1 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "uint8", @@ -4379,41 +4192,18 @@ "name": "default" }, "codecs": [ + { + "name": "bytes" + }, { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 1 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 1 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "uint8", @@ -4948,41 +4738,18 @@ "name": "default" }, "codecs": [ + { + "name": "bytes" + }, { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 1 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 1 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "uint8", @@ -5201,42 +4968,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -5306,42 +5050,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -5411,42 +5132,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -5516,42 +5214,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -5621,42 +5296,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -5726,42 +5378,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -5831,42 +5460,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -6019,42 +5625,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -6124,42 +5707,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -6229,42 +5789,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -6334,42 +5871,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -6537,42 +6051,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -6642,42 +6133,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -6747,42 +6215,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -6852,42 +6297,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -6957,42 +6379,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -7062,42 +6461,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 9, - 9 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 4 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 4 + }, + "name": "blosc" } ], "data_type": "float32", @@ -8017,42 +7393,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -8120,42 +7473,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -8223,42 +7553,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -8326,42 +7633,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -8429,42 +7713,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -8532,42 +7793,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -8635,42 +7873,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -8738,42 +7953,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -8841,42 +8033,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -8944,42 +8113,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -9047,42 +8193,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -9150,42 +8273,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -10737,42 +9837,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -10840,42 +9917,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -10943,42 +9997,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -11046,42 +10077,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -11149,42 +10157,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -11252,42 +10237,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -11355,42 +10317,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -11458,42 +10397,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -11561,42 +10477,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -11664,42 +10557,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -11767,42 +10637,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -11870,42 +10717,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -13560,42 +12384,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -13663,42 +12464,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -13766,42 +12544,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -13869,46 +12624,23 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" - } - ], - "data_type": "uint16", - "dimension_names": [ + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" + } + ], + "data_type": "uint16", + "dimension_names": [ "y", "x" ], @@ -13972,42 +12704,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -14075,42 +12784,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -14178,42 +12864,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -14281,42 +12944,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -14384,42 +13024,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -14487,42 +13104,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -14578,54 +13172,31 @@ 152, 152 ] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + }, + "name": "regular" + }, + "chunk_key_encoding": { + "configuration": { + "separator": "/" + }, + "name": "default" + }, + "codecs": [ + { + "configuration": { + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -14693,42 +13264,19 @@ "codecs": [ { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 2 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "endian": "little" }, - "name": "sharding_indexed" + "name": "bytes" + }, + { + "configuration": { + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 2 + }, + "name": "blosc" } ], "data_type": "uint16", @@ -18175,41 +16723,18 @@ "name": "default" }, "codecs": [ + { + "name": "bytes" + }, { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 1 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 1 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "uint8", @@ -18269,41 +16794,18 @@ "name": "default" }, "codecs": [ + { + "name": "bytes" + }, { "configuration": { - "chunk_shape": [ - 915, - 915 - ], - "codecs": [ - { - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 1 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 1 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "uint8", @@ -18902,41 +17404,18 @@ "name": "default" }, "codecs": [ + { + "name": "bytes" + }, { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 1 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 1 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "uint8", @@ -18996,41 +17475,18 @@ "name": "default" }, "codecs": [ + { + "name": "bytes" + }, { "configuration": { - "chunk_shape": [ - 305, - 305 - ], - "codecs": [ - { - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 1 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 1 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "uint8", @@ -19622,41 +18078,18 @@ "name": "default" }, "codecs": [ + { + "name": "bytes" + }, { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 1 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 1 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "uint8", @@ -19716,41 +18149,18 @@ "name": "default" }, "codecs": [ + { + "name": "bytes" + }, { "configuration": { - "chunk_shape": [ - 152, - 152 - ], - "codecs": [ - { - "name": "bytes" - }, - { - "configuration": { - "blocksize": 0, - "clevel": 3, - "cname": "zstd", - "shuffle": "shuffle", - "typesize": 1 - }, - "name": "blosc" - } - ], - "index_codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "name": "crc32c" - } - ], - "index_location": "end" + "blocksize": 0, + "clevel": 3, + "cname": "zstd", + "shuffle": "shuffle", + "typesize": 1 }, - "name": "sharding_indexed" + "name": "blosc" } ], "data_type": "uint8", diff --git a/tests/test_data_api/test_s2_plan.py b/tests/test_data_api/test_s2_plan.py index 91153e8f..c2956026 100644 --- a/tests/test_data_api/test_s2_plan.py +++ b/tests/test_data_api/test_s2_plan.py @@ -249,6 +249,35 @@ def test_plan_puts_cf_attributes_right_on_every_level() -> None: assert scl["valid_min"] == 0, level +def _arrays(node: dict[str, Any], path: str = "") -> list[tuple[str, dict[str, Any]]]: + """Every array of a dumped tree, with its path.""" + if node.get("node_type") == "array": + return [(path, node)] + found: list[tuple[str, dict[str, Any]]] = [] + for name, member in (node.get("members") or {}).items(): + found.extend(_arrays(member, f"{path}/{name}")) + return found + + +@pytest.mark.parametrize("path", _INPUT_PATHS, ids=lambda p: p.stem[:26]) +def test_plan_shards_only_arrays_of_several_chunks(path: pathlib.Path) -> None: + """ + A sharded array spans more than one inner chunk; an array that fits in one + inner chunk is written in plain chunks (#357), with the same compressor. + """ + single_chunk_shards = [] + for array_path, array in _arrays(_planned_root(path)): + codecs = array["codecs"] + if codecs[0]["name"] == "sharding_indexed": + inner = codecs[0]["configuration"]["chunk_shape"] + if all(n <= i for n, i in zip(array["shape"], inner, strict=True)): + single_chunk_shards.append(array_path) + elif any(codec["name"] == "blosc" for codec in codecs): + # an unsharded band array is one chunk covering the array + assert array["chunk_grid"]["configuration"]["chunk_shape"] == array["shape"] + assert single_chunk_shards == [] + + def test_plan_reflectance_requires_product_georeferencing() -> None: """A product whose bands carry no proj attributes and whose stac_discovery declares none is refused with a ValueError, not a KeyError.""" From 6495d53db5b8a6a8d0c4fc434c27280f1d69f5a9 Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Fri, 13 Nov 2026 18:33:40 +0100 Subject: [PATCH 20/45] fix(conversion): keep valid_* on float arrays in sanitize_array_attrs Addresses roborev's findings on a2b8247. That commit made `sanitize_array_attrs(..., is_decoded_float=True)` drop `valid_min` / `valid_max`, as its docstring had claimed. But callers pass the flag for every float array: `create_uniform_encoding` and the generic converter do, for native floats whose range is in physical units. The packed-integer output passes it too, and its range is in packed units. So correct ranges were lost. The removal is reverted, and the docstring now states what the code does: the decode path that unpacks integers drops `valid_*` itself. A test pins that a float array keeps an in-range `valid_*`. Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 --- src/eopf_geozarr/conversion/utils.py | 14 ++++++++------ tests/test_array_attrs.py | 13 ++++++++++++- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/eopf_geozarr/conversion/utils.py b/src/eopf_geozarr/conversion/utils.py index c1e863d6..b9d683e9 100644 --- a/src/eopf_geozarr/conversion/utils.py +++ b/src/eopf_geozarr/conversion/utils.py @@ -948,10 +948,13 @@ def sanitize_array_attrs( - The CF attributes are put right (`normalize_cf_array_attrs`): a ``flag_meanings`` list is joined, ``dtype`` is removed, and ``valid_min`` / ``valid_max`` outside the range of *dtype* are removed. - - For decoded float measurement arrays (*is_decoded_float=True*), also - removes raw-encoding leftovers ``fill_value``, ``valid_min`` and - ``valid_max`` (which describe the packed integers) and rewrites - ``units: "digital_counts"`` → ``"1"``. + - For float measurement arrays (*is_decoded_float=True*), also removes + the raw-encoding leftover ``fill_value`` and rewrites + ``units: "digital_counts"`` → ``"1"``. ``valid_min`` / ``valid_max`` + are kept: callers pass the flag for native floats, whose range is in + physical units, and for re-packed integers, whose range is in packed + units; the decode path that unpacks integers drops them itself + (``encoding_utils``). - Geo-proj *convention* keys (``proj:code``, ``proj:wkt2``, ``proj:projjson``) are always removed: per the minispec they belong on @@ -965,8 +968,7 @@ def sanitize_array_attrs( out = normalize_cf_array_attrs({k: v for k, v in attrs.items() if k not in dropped}, dtype) if is_decoded_float: - for key in ("fill_value", "valid_min", "valid_max"): - out.pop(key, None) + out.pop("fill_value", None) if out.get("units") == "digital_counts": out["units"] = "1" return out diff --git a/tests/test_array_attrs.py b/tests/test_array_attrs.py index 20a86a81..e5554ff5 100644 --- a/tests/test_array_attrs.py +++ b/tests/test_array_attrs.py @@ -24,7 +24,7 @@ import numpy as np import pytest -from eopf_geozarr.conversion.utils import normalize_cf_array_attrs +from eopf_geozarr.conversion.utils import normalize_cf_array_attrs, sanitize_array_attrs if TYPE_CHECKING: from collections.abc import Iterator @@ -256,3 +256,14 @@ def test_normalize_cf_array_attrs(attrs: dict, dtype: str | None, expected: dict result = normalize_cf_array_attrs(attrs, None if dtype is None else np.dtype(dtype)) assert result == expected assert attrs == before + + +def test_sanitize_keeps_a_float_arrays_valid_range() -> None: + """ + `sanitize_array_attrs` keeps an in-range `valid_min`/`valid_max` on a + float array: callers pass `is_decoded_float` for native floats too, whose + range is in physical units; only the CF rules of #351 apply. + """ + attrs = {"valid_min": -5.0, "valid_max": 45.0, "dtype": " Date: Fri, 13 Nov 2026 18:37:03 +0100 Subject: [PATCH 21/45] fix(s2-plan): store fixed-length label arrays as the registered string type The geometry label coordinates (`angle`, `band`, `detector`) carried their source data types: `fixed_length_utf32` and `null_terminated_bytes`. The second is in no registry, and a strict Zarr V3 reader must refuse an unknown data type. A carried unicode or bytes array is now planned as the registered `string` data type. `create_default` gives it the `vlen-utf8` codec, the empty fill and one chunk. The writer decodes bytes labels as ASCII rather than leave the conversion to zarr. A test checks that no planned array uses either unregistered type, and the snapshots are regenerated (#356). Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 --- src/eopf_geozarr/data_api/s2_plan.py | 10 ++++++++ src/eopf_geozarr/data_api/s2_write.py | 4 ++++ ...041_N0511_R122_T32TQM_20251008T122613.json | 24 ++++--------------- ...309_N0511_R108_T32TLQ_20250113T122458.json | 24 ++++--------------- ...131_N0511_R037_T29TPF_20250811T152216.json | 24 ++++--------------- tests/test_array_attrs.py | 7 +++++- tests/test_data_api/test_s2_plan.py | 16 +++++++++++++ 7 files changed, 48 insertions(+), 61 deletions(-) diff --git a/src/eopf_geozarr/data_api/s2_plan.py b/src/eopf_geozarr/data_api/s2_plan.py index 5342e7b6..55ba2df0 100644 --- a/src/eopf_geozarr/data_api/s2_plan.py +++ b/src/eopf_geozarr/data_api/s2_plan.py @@ -741,6 +741,16 @@ def _plan_carried_array( dtype=parsed, level_meters=level_meters, ) + if parsed.kind in "US": + # fixed-length unicode or bytes labels (the geometry `angle`, `band` + # and `detector` coordinates) are stored as the registered `string` + # data type, which every Zarr V3 reader can read, instead of the + # unregistered `fixed_length_utf32` / `null_terminated_bytes` (#356); + # create_default supplies its `vlen-utf8` codec, the empty fill and + # one chunk + return DataArray.create_default( + attributes=attributes, shape=shape, data_type="string", dimension_names=dims + ) if dims == (name,): # a coordinate array: one chunk, uncompressed (create_default supplies # the one-chunk grid and the `/` chunk key encoding) diff --git a/src/eopf_geozarr/data_api/s2_write.py b/src/eopf_geozarr/data_api/s2_write.py index 3318f445..2bc5dc40 100644 --- a/src/eopf_geozarr/data_api/s2_write.py +++ b/src/eopf_geozarr/data_api/s2_write.py @@ -172,6 +172,10 @@ def _fill_carried_array(source: SourceReader, output: zarr.Group, path: str) -> if values is None: msg = f"The input source holds no array at {path!r}" raise ValueError(msg) + if values.dtype.kind == "S": + # bytes labels are planned as the `string` data type (#356): decode + # them as ASCII rather than leave the conversion to zarr + values = np.char.decode(values, "ascii") out_array[...] = values diff --git a/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json b/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json index a32355dc..0e4b9750 100644 --- a/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json +++ b/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json @@ -25,18 +25,10 @@ }, "codecs": [ { - "configuration": { - "endian": "little" - }, - "name": "bytes" + "name": "vlen-utf8" } ], - "data_type": { - "configuration": { - "length_bytes": 28 - }, - "name": "fixed_length_utf32" - }, + "data_type": "string", "dimension_names": [ "angle" ], @@ -66,18 +58,10 @@ }, "codecs": [ { - "configuration": { - "endian": "little" - }, - "name": "bytes" + "name": "vlen-utf8" } ], - "data_type": { - "configuration": { - "length_bytes": 12 - }, - "name": "fixed_length_utf32" - }, + "data_type": "string", "dimension_names": [ "band" ], diff --git a/tests/_test_data/optimized_geozarr_examples/S2B_MSIL1C_20250113T103309_N0511_R108_T32TLQ_20250113T122458.json b/tests/_test_data/optimized_geozarr_examples/S2B_MSIL1C_20250113T103309_N0511_R108_T32TLQ_20250113T122458.json index af671507..7dc77793 100644 --- a/tests/_test_data/optimized_geozarr_examples/S2B_MSIL1C_20250113T103309_N0511_R108_T32TLQ_20250113T122458.json +++ b/tests/_test_data/optimized_geozarr_examples/S2B_MSIL1C_20250113T103309_N0511_R108_T32TLQ_20250113T122458.json @@ -25,18 +25,10 @@ }, "codecs": [ { - "configuration": { - "endian": "little" - }, - "name": "bytes" + "name": "vlen-utf8" } ], - "data_type": { - "configuration": { - "length_bytes": 28 - }, - "name": "fixed_length_utf32" - }, + "data_type": "string", "dimension_names": [ "angle" ], @@ -66,18 +58,10 @@ }, "codecs": [ { - "configuration": { - "endian": "little" - }, - "name": "bytes" + "name": "vlen-utf8" } ], - "data_type": { - "configuration": { - "length_bytes": 12 - }, - "name": "fixed_length_utf32" - }, + "data_type": "string", "dimension_names": [ "band" ], diff --git a/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json b/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json index 12d6ceed..624d595b 100644 --- a/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json +++ b/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json @@ -25,18 +25,10 @@ }, "codecs": [ { - "configuration": { - "endian": "little" - }, - "name": "bytes" + "name": "vlen-utf8" } ], - "data_type": { - "configuration": { - "length_bytes": 28 - }, - "name": "fixed_length_utf32" - }, + "data_type": "string", "dimension_names": [ "angle" ], @@ -66,18 +58,10 @@ }, "codecs": [ { - "configuration": { - "endian": "little" - }, - "name": "bytes" + "name": "vlen-utf8" } ], - "data_type": { - "configuration": { - "length_bytes": 12 - }, - "name": "fixed_length_utf32" - }, + "data_type": "string", "dimension_names": [ "band" ], diff --git a/tests/test_array_attrs.py b/tests/test_array_attrs.py index e5554ff5..8f0c0fe2 100644 --- a/tests/test_array_attrs.py +++ b/tests/test_array_attrs.py @@ -200,7 +200,12 @@ def test_valid_range_fits_the_data_type(snapshot: dict) -> None: offenders = [] for path, node in _walk(snapshot): data_type = node.get("data_type") - if not isinstance(data_type, str) or np.dtype(data_type).kind not in "iu": + try: + kind = np.dtype(data_type).kind if isinstance(data_type, str) else None + except TypeError: + # a Zarr V3 name numpy does not read (`string`) + kind = None + if kind is None or kind not in "iu": continue info = np.iinfo(data_type) for key in ("valid_min", "valid_max"): diff --git a/tests/test_data_api/test_s2_plan.py b/tests/test_data_api/test_s2_plan.py index c2956026..95d8c616 100644 --- a/tests/test_data_api/test_s2_plan.py +++ b/tests/test_data_api/test_s2_plan.py @@ -278,6 +278,22 @@ def test_plan_shards_only_arrays_of_several_chunks(path: pathlib.Path) -> None: assert single_chunk_shards == [] +@pytest.mark.parametrize("path", _INPUT_PATHS, ids=lambda p: p.stem[:26]) +def test_plan_stores_labels_as_registered_strings(path: pathlib.Path) -> None: + """No planned array uses a data type outside the Zarr V3 core and its + registered extensions: label coordinates are `string` (#356).""" + unregistered = [ + (array_path, array["data_type"]["name"]) + for array_path, array in _arrays(_planned_root(path)) + if isinstance(array["data_type"], dict) + and array["data_type"]["name"] in ("fixed_length_utf32", "null_terminated_bytes") + ] + assert unregistered == [] + geometry = _planned_root(path)["members"]["conditions"]["members"]["geometry"]["members"] + assert geometry["angle"]["data_type"] == "string" + assert geometry["angle"]["codecs"] == [{"name": "vlen-utf8"}] + + def test_plan_reflectance_requires_product_georeferencing() -> None: """A product whose bands carry no proj attributes and whose stac_discovery declares none is refused with a ValueError, not a KeyError.""" From bbd7637a234a43be473bcfbbb16130c61596ece4 Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Fri, 13 Nov 2026 18:47:57 +0100 Subject: [PATCH 22/45] fix(s2-plan): georeference the meteorology groups from their coordinates The CAMS and ECMWF groups under `conditions/meteorology` held arrays on latitude/longitude dimensions with no CRS. They also carried the source `Conventions: "CF-1.7"`, which contradicts the output's no-CF-claim decision. - A carried group on a regular geographic grid gets `proj` and `spatial` attributes derived from its coordinate values. Such a group has 1-D `latitude` and `longitude` coordinates and no `proj:*` attributes. The attributes are `proj:code` EPSG:4326, the dimensions, the shape, and the transform and bbox. The values are grid points, so the registration is `node`, and a decreasing latitude gives a negative step. Irregular spacing is refused; spacing within a thousandth of the step, as float32 storage gives, counts as regular. - The plan stays a function of what it is given. `plan_geozarr` takes an optional `coordinate_values` lookup, and `write_geozarr` passes its source reader's. Without the lookup, these groups get no georeferencing. - The source `Conventions` attribute is no longer carried on any group. Tests cover the derived attributes for increasing, decreasing and float32 latitudes, the two refusals, and the plan with and without values. The writer test seeds regular latitude/longitude values, and the snapshots are regenerated (#353). Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 --- src/eopf_geozarr/data_api/s2_plan.py | 104 ++++++++++++++++-- src/eopf_geozarr/data_api/s2_write.py | 2 +- ...041_N0511_R122_T32TQM_20251008T122613.json | 2 - ...309_N0511_R108_T32TLQ_20250113T122458.json | 2 - ...131_N0511_R037_T29TPF_20250811T152216.json | 2 - tests/test_data_api/test_s2_plan.py | 90 +++++++++++++++ tests/test_data_api/test_s2_write.py | 9 +- 7 files changed, 194 insertions(+), 17 deletions(-) diff --git a/src/eopf_geozarr/data_api/s2_plan.py b/src/eopf_geozarr/data_api/s2_plan.py index 55ba2df0..bc639abb 100644 --- a/src/eopf_geozarr/data_api/s2_plan.py +++ b/src/eopf_geozarr/data_api/s2_plan.py @@ -35,7 +35,7 @@ import base64 import re import struct -from collections.abc import Mapping +from collections.abc import Callable, Mapping from math import ceil from typing import TYPE_CHECKING, Any, Final, Literal @@ -644,6 +644,66 @@ def plan_reflectance(root: Sentinel2Root) -> AnyGroupSpec: {"_ARRAY_DIMENSIONS", "_eopf_attrs", "_FillValue", "proj:code", "proj:wkt2", "proj:projjson"} ) +#: Group attribute keys never carried: the source's CF `Conventions` claim, +#: which the output does not make (`proj` and `spatial` are its +#: georeferencing; EOPF-Explorer/data-model#353). +_DROPPED_GROUP_ATTRS = frozenset({"Conventions"}) + +CoordinateValues = Callable[[str], "np.ndarray | None"] +"""Looks up the stored values of the input array at an output-plan path (the +writer's `SourceReader.values`); the plan reads only the small 1-D +coordinate arrays a group's georeferencing is derived from.""" + + +def _dims_of(doc: _ArrayDoc) -> tuple[str, ...]: + """The dimension names an input array declares (`_ARRAY_DIMENSIONS`).""" + dims = _doc_attrs(doc).get("_ARRAY_DIMENSIONS") + return tuple(str(dim) for dim in dims) if isinstance(dims, (list, tuple)) else () + + +def _carried_group_attributes(group: Mapping[str, Any]) -> dict[str, object]: + """A carried group's attributes, without the keys never carried.""" + return { + key: value for key, value in _doc_attrs(group).items() if key not in _DROPPED_GROUP_ATTRS + } + + +def _lat_lon_attributes(latitude: np.ndarray, longitude: np.ndarray) -> dict[str, object]: + """ + The `proj` and `spatial` attributes of a group on a regular geographic + grid, from its 1-D `latitude` and `longitude` coordinate values + (EOPF-Explorer/data-model#353). The values are grid points, so the + registration is `node`: the transform maps an index to a point, its + origin the first point, and a decreasing latitude gives a negative step; + the bbox spans the outer points. Refuses irregular spacing, which no + affine transform describes. + """ + axes = {} + for name, values in (("latitude", latitude), ("longitude", longitude)): + values = np.asarray(values, dtype="float64") + if values.ndim != 1 or values.size < 2: + msg = f"The {name} coordinate needs at least two values, got shape {values.shape}" + raise ValueError(msg) + # the step from the end points, which averages out the rounding of + # coordinates stored as float32; spacing within a thousandth of it is + # regular + step = float(values[-1] - values[0]) / (values.size - 1) + if step == 0 or not np.allclose(np.diff(values), step, rtol=1e-3, atol=0.0): + msg = f"The {name} coordinate is not regularly spaced, so no transform describes it" + raise ValueError(msg) + axes[name] = (values, step) + (lat, dlat), (lon, dlon) = axes["latitude"], axes["longitude"] + return { + "proj:code": "EPSG:4326", + "spatial:bbox": [float(lon.min()), float(lat.min()), float(lon.max()), float(lat.max())], + "spatial:dimensions": ["latitude", "longitude"], + "spatial:registration": "node", + "spatial:shape": [int(lat.size), int(lon.size)], + "spatial:transform": [dlon, 0.0, float(lon[0]), 0.0, dlat, float(lat[0])], + "zarr_conventions": [SPATIAL_CMO, PROJ_CMO], + } + + # The conditions/quality planner walks the input model's *dump* — plain Zarr # V2 documents — because the input model types those subtrees loosely, so # their nodes are a mix of spec models and raw mappings. A node holding @@ -801,7 +861,9 @@ def _proj_of(name: str, doc: _ArrayDoc) -> tuple[_Transform6, int, str]: ) -def _plan_dataset(group: _GroupDoc, path: str) -> AnyGroupSpec | None: +def _plan_dataset( + group: _GroupDoc, path: str, coordinate_values: CoordinateValues | None = None +) -> AnyGroupSpec | None: """ Plan one carried leaf dataset: every non-scalar array translated, and — when the dataset is georeferenced (an array carries proj attributes) — @@ -818,7 +880,22 @@ def _plan_dataset(group: _GroupDoc, path: str) -> AnyGroupSpec | None: for name, member in arrays.items() } if anchor is None: - return GroupSpecV3(attributes=dict(_doc_attrs(group)), members=members) + attributes = _carried_group_attributes(group) + latitude, longitude = arrays.get("latitude"), arrays.get("longitude") + if ( + coordinate_values is not None + and latitude is not None + and longitude is not None + and _dims_of(latitude) == ("latitude",) + and _dims_of(longitude) == ("longitude",) + ): + lat_values = coordinate_values(f"{path}/latitude") + lon_values = coordinate_values(f"{path}/longitude") + if lat_values is not None and lon_values is not None: + # a regular geographic grid (the meteorology groups): its + # georeferencing derived from its coordinates + attributes = {**attributes, **_lat_lon_attributes(lat_values, lon_values)} + return GroupSpecV3(attributes=attributes, members=members) transform, epsg, wkt2 = _proj_of(*anchor) members["spatial_ref"] = _plan_spatial_ref(wkt2, native=True) return GroupSpecV3( @@ -977,6 +1054,7 @@ def _plan_subtree( group: _GroupDoc, path: str, product_proj: tuple[tuple[float, float], int, str] | None = None, + coordinate_values: CoordinateValues | None = None, ) -> AnyGroupSpec | None: """ Plan one conditions/quality subtree: aux multiscale groups by their specs, @@ -993,22 +1071,24 @@ def _plan_subtree( if isinstance(member, Mapping) and "members" in member } if not subgroups: - return _plan_dataset(group, path) + return _plan_dataset(group, path, coordinate_values) planned: dict[str, AnyGroupSpec] = {} for name, member in subgroups.items(): - sub = _plan_subtree(member, f"{path}/{name}", product_proj) + sub = _plan_subtree(member, f"{path}/{name}", product_proj, coordinate_values) if sub is not None: planned[name] = sub # a group holding arrays next to its subgroups keeps those arrays too - own = _plan_dataset(group, path) + own = _plan_dataset(group, path, coordinate_values) if own is not None: return GroupSpecV3(attributes=own.attributes, members={**dict(own.members), **planned}) if not planned: return None - return GroupSpecV3(attributes=dict(_doc_attrs(group)), members=planned) + return GroupSpecV3(attributes=_carried_group_attributes(group), members=planned) -def plan_geozarr(root: Sentinel2Root) -> AnyGroupSpec: +def plan_geozarr( + root: Sentinel2Root, *, coordinate_values: CoordinateValues | None = None +) -> AnyGroupSpec: """ Plan the GeoZarr hierarchy to write for a Sentinel-2 product. @@ -1017,6 +1097,12 @@ def plan_geozarr(root: Sentinel2Root) -> AnyGroupSpec: pyramid, and the `conditions` and `quality` subtrees carried (their own multiscale groups planned by `AUX_MULTISCALE_LEVELS`, the quicklooks and scalar arrays dropped). + + The plan reads metadata only, except where georeferencing must be derived + from coordinate values: a carried group on a regular geographic grid + (1-D `latitude` and `longitude` coordinates, no `proj:*` attributes, + such as the meteorology groups) gets its `proj` and `spatial` attributes + from the values `coordinate_values` looks up, and none without it. """ members: dict[str, AnyGroupSpec] = { "measurements": GroupSpecV3(attributes={}, members={"reflectance": plan_reflectance(root)}), @@ -1026,7 +1112,7 @@ def plan_geozarr(root: Sentinel2Root) -> AnyGroupSpec: member = root.members.get(top) if member is None: continue - planned = _plan_subtree(member.model_dump(), top, product_proj) + planned = _plan_subtree(member.model_dump(), top, product_proj, coordinate_values) if planned is not None: members[top] = planned return GroupSpecV3(attributes={}, members=members) diff --git a/src/eopf_geozarr/data_api/s2_write.py b/src/eopf_geozarr/data_api/s2_write.py index 2bc5dc40..20cf0a6d 100644 --- a/src/eopf_geozarr/data_api/s2_write.py +++ b/src/eopf_geozarr/data_api/s2_write.py @@ -141,7 +141,7 @@ def write_geozarr( if isinstance(source, xr.DataTree) else ZarrSourceReader(source) ) - plan = plan_geozarr(root) + plan = plan_geozarr(root, coordinate_values=reader.values) # the metadata plane: every group and array document, exactly as planned output = plan.to_zarr(store, path="") # type: ignore[arg-type] _fill_group(plan, reader, output, "") diff --git a/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json b/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json index 0e4b9750..00a94273 100644 --- a/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json +++ b/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json @@ -4890,7 +4890,6 @@ "members": { "cams": { "attributes": { - "Conventions": "CF-1.7", "GRIB_centre": "ecmf", "GRIB_centreDescription": "European Centre for Medium-Range Weather Forecasts", "GRIB_edition": 1, @@ -5890,7 +5889,6 @@ }, "ecmwf": { "attributes": { - "Conventions": "CF-1.7", "GRIB_centre": "ecmf", "GRIB_centreDescription": "European Centre for Medium-Range Weather Forecasts", "GRIB_edition": 1, diff --git a/tests/_test_data/optimized_geozarr_examples/S2B_MSIL1C_20250113T103309_N0511_R108_T32TLQ_20250113T122458.json b/tests/_test_data/optimized_geozarr_examples/S2B_MSIL1C_20250113T103309_N0511_R108_T32TLQ_20250113T122458.json index 7dc77793..979945e8 100644 --- a/tests/_test_data/optimized_geozarr_examples/S2B_MSIL1C_20250113T103309_N0511_R108_T32TLQ_20250113T122458.json +++ b/tests/_test_data/optimized_geozarr_examples/S2B_MSIL1C_20250113T103309_N0511_R108_T32TLQ_20250113T122458.json @@ -3361,7 +3361,6 @@ "members": { "cams": { "attributes": { - "Conventions": "CF-1.7", "GRIB_centre": "ecmf", "GRIB_centreDescription": "European Centre for Medium-Range Weather Forecasts", "GRIB_edition": 1, @@ -4361,7 +4360,6 @@ }, "ecmwf": { "attributes": { - "Conventions": "CF-1.7", "GRIB_centre": "ecmf", "GRIB_centreDescription": "European Centre for Medium-Range Weather Forecasts", "GRIB_edition": 1, diff --git a/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json b/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json index 624d595b..d213040f 100644 --- a/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json +++ b/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json @@ -4890,7 +4890,6 @@ "members": { "cams": { "attributes": { - "Conventions": "CF-1.7", "GRIB_centre": "ecmf", "GRIB_centreDescription": "European Centre for Medium-Range Weather Forecasts", "GRIB_edition": 1, @@ -5890,7 +5889,6 @@ }, "ecmwf": { "attributes": { - "Conventions": "CF-1.7", "GRIB_centre": "ecmf", "GRIB_centreDescription": "European Centre for Medium-Range Weather Forecasts", "GRIB_edition": 1, diff --git a/tests/test_data_api/test_s2_plan.py b/tests/test_data_api/test_s2_plan.py index 95d8c616..e3b10abd 100644 --- a/tests/test_data_api/test_s2_plan.py +++ b/tests/test_data_api/test_s2_plan.py @@ -7,6 +7,7 @@ import pathlib from typing import Any +import numpy as np import pytest import zarr from pydantic import ValidationError @@ -17,6 +18,7 @@ from eopf_geozarr.data_api.s2 import Sentinel2Root from eopf_geozarr.data_api.s2_plan import ( REFLECTANCE_SCALE_LEVELS, + _lat_lon_attributes, load_sentinel2, plan_geozarr, plan_reflectance, @@ -294,6 +296,94 @@ def test_plan_stores_labels_as_registered_strings(path: pathlib.Path) -> None: assert geometry["angle"]["codecs"] == [{"name": "vlen-utf8"}] +@pytest.mark.parametrize( + ("latitude", "longitude", "expected"), + [ + ( + [48.0, 47.5, 47.0], + [8.0, 8.25, 8.5, 8.75], + { + "spatial:bbox": [8.0, 47.0, 8.75, 48.0], + "spatial:shape": [3, 4], + "spatial:transform": [0.25, 0.0, 8.0, 0.0, -0.5, 48.0], + }, + ), + ( + [47.0, 47.5, 48.0], + [8.0, 8.25], + { + "spatial:bbox": [8.0, 47.0, 8.25, 48.0], + "spatial:shape": [3, 2], + "spatial:transform": [0.25, 0.0, 8.0, 0.0, 0.5, 47.0], + }, + ), + ( + np.linspace(48.0, 44.8, 9, dtype="float32").tolist(), + np.linspace(8.0, 11.2, 9, dtype="float32").tolist(), + {"spatial:shape": [9, 9]}, + ), + ], + ids=["latitude-decreasing", "latitude-increasing", "float32-rounding"], +) +def test_lat_lon_attributes( + latitude: list[float], longitude: list[float], expected: dict[str, object] +) -> None: + """ + A regular geographic grid's `proj` and `spatial` attributes follow from + its coordinate points (#353): node registration, the transform's origin + the first point and its step signed, the bbox spanning the outer points. + """ + attributes = _lat_lon_attributes(np.array(latitude), np.array(longitude)) + assert {key: attributes[key] for key in expected} == expected + assert attributes["proj:code"] == "EPSG:4326" + assert attributes["spatial:dimensions"] == ["latitude", "longitude"] + assert attributes["spatial:registration"] == "node" + + +def test_lat_lon_attributes_refuse_irregular_spacing() -> None: + with pytest.raises(ValueError, match="latitude coordinate is not regularly spaced"): + _lat_lon_attributes(np.array([48.0, 47.5, 46.0]), np.array([8.0, 8.25])) + + +def test_lat_lon_attributes_refuse_a_single_point() -> None: + with pytest.raises(ValueError, match="longitude coordinate needs at least two values"): + _lat_lon_attributes(np.array([48.0, 47.5]), np.array([8.0])) + + +def test_plan_georeferences_the_meteorology_groups_from_their_coordinates() -> None: + """ + The meteorology groups get `proj` and `spatial` attributes derived from + their latitude/longitude values, and lose the source `Conventions` + claim (#353); without the values, they get no georeferencing but still + lose the claim. + """ + path = _INPUT_PATHS[0] + root = Sentinel2Root.model_validate(_read(path)) + values = { + f"conditions/meteorology/{group}/{name}": axis + for group in ("cams", "ecmwf") + for name, axis in ( + ("latitude", np.linspace(48.0, 46.0, 9)), + ("longitude", np.linspace(8.0, 10.0, 9)), + ) + } + with_values = plan_geozarr(root, coordinate_values=values.get).model_dump(mode="json") + without = plan_geozarr(root).model_dump(mode="json") + for group in ("cams", "ecmwf"): + attributes = with_values["members"]["conditions"]["members"]["meteorology"]["members"][ + group + ]["attributes"] + assert attributes["proj:code"] == "EPSG:4326" + assert attributes["spatial:shape"] == [9, 9] + assert attributes["spatial:transform"] == [0.25, 0.0, 8.0, 0.0, -0.25, 48.0] + assert "Conventions" not in attributes + bare = without["members"]["conditions"]["members"]["meteorology"]["members"][group][ + "attributes" + ] + assert "proj:code" not in bare + assert "Conventions" not in bare + + def test_plan_reflectance_requires_product_georeferencing() -> None: """A product whose bands carry no proj attributes and whose stac_discovery declares none is refused with a ValueError, not a KeyError.""" diff --git a/tests/test_data_api/test_s2_write.py b/tests/test_data_api/test_s2_write.py index b44f3d40..8e3526a8 100644 --- a/tests/test_data_api/test_s2_write.py +++ b/tests/test_data_api/test_s2_write.py @@ -87,7 +87,8 @@ def _seed_input_store(group: zarr.Group) -> None: Coordinates are the pixel centres of each group's own `proj:transform` (real products store them as float64, so the fixtures' int64 declarations - are recreated in that form), and selected arrays get deterministic values. + are recreated in that form), latitude/longitude form a regular geographic + grid, and selected arrays get deterministic values. """ patterned = set(_PATTERNED_PATHS) for group_path, subgroup in _walk_groups(group): @@ -116,6 +117,12 @@ def _seed_input_store(group: zarr.Group) -> None: overwrite=True, ) replacement[:] = values + elif name in ("latitude", "longitude") and array.ndim == 1: + # a regular geographic grid, as the CAMS/ECMWF meteorology + # groups store it (latitude decreasing), from which the plan + # derives the groups' georeferencing + start, stop = (48.0, 46.0) if name == "latitude" else (8.0, 10.0) + array[...] = np.linspace(start, stop, array.shape[0]).astype(array.dtype) elif array.ndim == 2 and np.issubdtype(array.dtype, np.integer): if array.size <= _PATTERN_MAX_ELEMENTS or path in patterned: array[...] = _pattern(array.shape, array.dtype) From 9936a26faf09d06dc6d6cbe76d97673ca01b9d7f Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Fri, 13 Nov 2026 18:48:25 +0100 Subject: [PATCH 23/45] test(s2): cover bytes labels planned and written as strings Addresses roborev's finding on c8c0fbd. The V2 fixtures hold only unicode labels, so nothing reached the bytes path of #356. A plan test plants a `|S3` label array and checks that it is planned as `string` with `vlen-utf8`. A writer test fills an `S3` label array into a string array and reads back the decoded labels. Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 --- tests/test_data_api/test_s2_plan.py | 25 ++++++++++++++++++++++ tests/test_data_api/test_s2_write.py | 32 +++++++++++++++++++++++++++- 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/tests/test_data_api/test_s2_plan.py b/tests/test_data_api/test_s2_plan.py index e3b10abd..cdab68ea 100644 --- a/tests/test_data_api/test_s2_plan.py +++ b/tests/test_data_api/test_s2_plan.py @@ -384,6 +384,31 @@ def test_plan_georeferences_the_meteorology_groups_from_their_coordinates() -> N assert "Conventions" not in bare +def test_plan_stores_bytes_labels_as_strings() -> None: + """A carried bytes (`S`) label array, as native Zarr V3 products hold the + geometry `band` and `detector` labels, is planned as `string` (#356).""" + path = _INPUT_PATHS[0] + document = _read(path) + geometry = document["members"]["conditions"]["members"]["geometry"]["members"] + geometry["detector"] = { + "zarr_format": 2, + "shape": [7], + "chunks": [7], + "dtype": "|S3", + "fill_value": "", + "order": "C", + "filters": None, + "compressor": None, + "dimension_separator": "/", + "attributes": {"_ARRAY_DIMENSIONS": ["detector"]}, + } + planned = plan_geozarr(Sentinel2Root.model_validate(document)).model_dump(mode="json") + detector = planned["members"]["conditions"]["members"]["geometry"]["members"]["detector"] + assert detector["data_type"] == "string" + assert detector["codecs"] == [{"name": "vlen-utf8"}] + assert detector["dimension_names"] == ["detector"] + + def test_plan_reflectance_requires_product_georeferencing() -> None: """A product whose bands carry no proj attributes and whose stac_discovery declares none is refused with a ValueError, not a KeyError.""" diff --git a/tests/test_data_api/test_s2_write.py b/tests/test_data_api/test_s2_write.py index 8e3526a8..7cd92b24 100644 --- a/tests/test_data_api/test_s2_write.py +++ b/tests/test_data_api/test_s2_write.py @@ -23,7 +23,7 @@ from pydantic_zarr.v3 import GroupSpec as GroupSpecV3 from eopf_geozarr.data_api.s2_plan import load_sentinel2 -from eopf_geozarr.data_api.s2_write import _coarsen, write_geozarr +from eopf_geozarr.data_api.s2_write import _coarsen, _fill_carried_array, write_geozarr from ..conftest import create_zarrv2_group_from_json, get_stem, s2_example_json_paths @@ -298,3 +298,33 @@ def test_write_geozarr_from_a_datatree_matches_the_store_write( tree_output = tmp_path / f"from_tree_{mask_and_scale}.zarr" write_geozarr(load_sentinel2(tree), tree, str(tree_output)) assert _store_contents(tree_output) == reference, f"{mask_and_scale=}" + + +class _LabelSource: + """A `SourceReader` holding one bytes label array, as native products do.""" + + def __init__(self, values: np.ndarray) -> None: + self._values = values + + def values(self, path: str) -> np.ndarray | None: + return self._values if path == "conditions/geometry/band" else None + + def is_group(self, path: str) -> bool: + return False + + def group_names(self, path: str) -> tuple[str, ...]: + return () + + +def test_fill_decodes_bytes_labels_into_a_string_array() -> None: + """ + A bytes (`S`) label array, which the plan stores as the `string` data type + (#356), is written decoded as ASCII: it reads back as the label strings. + """ + output = zarr.open_group(zarr.storage.MemoryStore(), mode="w", zarr_format=3) + output.require_group("conditions/geometry").create_array( + "band", shape=(3,), dtype=np.dtypes.StringDType(), fill_value="" + ) + labels = np.array([b"b02", b"b03", b"b8a"], dtype="S3") + _fill_carried_array(_LabelSource(labels), output, "conditions/geometry/band") + assert output["conditions/geometry/band"][...].tolist() == ["b02", "b03", "b8a"] From 55b9ff11f28040361c013a9d166eac2717d0c283 Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Fri, 13 Nov 2026 18:48:57 +0100 Subject: [PATCH 24/45] test: fix the typing of the attribute guardrail and the label write test pyright refused `np.iinfo` on an unnarrowed data type in the valid-range guardrail. It also refused `zarr.storage` attribute access and an untyped array read in the bytes-label write test. Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 --- tests/test_array_attrs.py | 2 +- tests/test_data_api/test_s2_write.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/test_array_attrs.py b/tests/test_array_attrs.py index 8f0c0fe2..32b61b4e 100644 --- a/tests/test_array_attrs.py +++ b/tests/test_array_attrs.py @@ -207,7 +207,7 @@ def test_valid_range_fits_the_data_type(snapshot: dict) -> None: kind = None if kind is None or kind not in "iu": continue - info = np.iinfo(data_type) + info = np.iinfo(np.dtype(str(data_type))) for key in ("valid_min", "valid_max"): value = (node.get("attributes") or {}).get(key) if value is not None and not info.min <= value <= info.max: diff --git a/tests/test_data_api/test_s2_write.py b/tests/test_data_api/test_s2_write.py index 7cd92b24..0d59c7aa 100644 --- a/tests/test_data_api/test_s2_write.py +++ b/tests/test_data_api/test_s2_write.py @@ -21,6 +21,7 @@ import xarray as xr import zarr from pydantic_zarr.v3 import GroupSpec as GroupSpecV3 +from zarr.storage import MemoryStore from eopf_geozarr.data_api.s2_plan import load_sentinel2 from eopf_geozarr.data_api.s2_write import _coarsen, _fill_carried_array, write_geozarr @@ -321,10 +322,12 @@ def test_fill_decodes_bytes_labels_into_a_string_array() -> None: A bytes (`S`) label array, which the plan stores as the `string` data type (#356), is written decoded as ASCII: it reads back as the label strings. """ - output = zarr.open_group(zarr.storage.MemoryStore(), mode="w", zarr_format=3) + output = zarr.open_group(MemoryStore(), mode="w", zarr_format=3) output.require_group("conditions/geometry").create_array( "band", shape=(3,), dtype=np.dtypes.StringDType(), fill_value="" ) labels = np.array([b"b02", b"b03", b"b8a"], dtype="S3") _fill_carried_array(_LabelSource(labels), output, "conditions/geometry/band") - assert output["conditions/geometry/band"][...].tolist() == ["b02", "b03", "b8a"] + band = output["conditions/geometry/band"] + assert isinstance(band, zarr.Array) + assert np.asarray(band[:]).tolist() == ["b02", "b03", "b8a"] From 3ac49262c3e2ea09d6b805732c03b238a1c89bd8 Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Fri, 13 Nov 2026 18:51:51 +0100 Subject: [PATCH 25/45] fix(s2-plan): carry a grid no transform describes instead of failing Addresses roborev's findings on bbd7637. - A latitude/longitude group whose values `_lat_lon_attributes` refuses (irregular spacing, NaN fill, a single point) stopped the whole conversion. Such a group is now carried without georeferencing, as before #353, and a warning is logged. - Longitudes are unwrapped before the spacing check, so a grid crossing the antimeridian or 0/360 keeps a regular step and gets its transform. - `_lat_lon_attributes` returns a `LatLonGroupAttrs` TypedDict, like its sibling builders. - The write test asserts the derived `proj:code` and transform on the written meteorology groups, which shows the source reader feeds the plan. Plan tests cover an irregular grid, a NaN grid and an antimeridian grid. Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 --- src/eopf_geozarr/data_api/s2_plan.py | 40 ++++++++++++++++++++++++---- tests/test_data_api/test_s2_plan.py | 37 ++++++++++++++++++++++++- tests/test_data_api/test_s2_write.py | 7 +++++ 3 files changed, 78 insertions(+), 6 deletions(-) diff --git a/src/eopf_geozarr/data_api/s2_plan.py b/src/eopf_geozarr/data_api/s2_plan.py index bc639abb..00854ba2 100644 --- a/src/eopf_geozarr/data_api/s2_plan.py +++ b/src/eopf_geozarr/data_api/s2_plan.py @@ -40,6 +40,7 @@ from typing import TYPE_CHECKING, Any, Final, Literal import numpy as np +import structlog import xarray as xr from pydantic_zarr.v2 import GroupSpec as GroupSpecV2 from pydantic_zarr.v3 import ArraySpec as ArraySpecV3 @@ -73,6 +74,8 @@ from zarr_metadata.v3.codec.sharding_indexed import ShardingIndexedCodecObject from zarr_metadata.v3.codec.zstd import ZstdCodecObject +log = structlog.get_logger() + S2Level = Literal["L1C", "L2A"] #: Reflectance pyramid levels in metres, finest first (the converter's policy). @@ -391,6 +394,21 @@ def _plan_spatial_ref(wkt2: str, *, native: bool) -> ArraySpecV3: resolution dataset or a pyramid level), which always carries every key; the per-key value types are zarr-cm's.""" +LatLonGroupAttrs = TypedDict( + "LatLonGroupAttrs", + { + "proj:code": str, + "spatial:bbox": list[float], + "spatial:dimensions": list[str], + "spatial:registration": str, + "spatial:shape": list[int], + "spatial:transform": list[float], + "zarr_conventions": list[ConventionMetadataObject], + }, +) +"""The spatial/proj convention attributes of a group on a regular geographic +grid (`_lat_lon_attributes`), which always carries every key.""" + MultiscaleGroupAttrs = TypedDict( "MultiscaleGroupAttrs", { @@ -668,19 +686,22 @@ def _carried_group_attributes(group: Mapping[str, Any]) -> dict[str, object]: } -def _lat_lon_attributes(latitude: np.ndarray, longitude: np.ndarray) -> dict[str, object]: +def _lat_lon_attributes(latitude: np.ndarray, longitude: np.ndarray) -> LatLonGroupAttrs: """ The `proj` and `spatial` attributes of a group on a regular geographic grid, from its 1-D `latitude` and `longitude` coordinate values (EOPF-Explorer/data-model#353). The values are grid points, so the registration is `node`: the transform maps an index to a point, its origin the first point, and a decreasing latitude gives a negative step; - the bbox spans the outer points. Refuses irregular spacing, which no - affine transform describes. + the bbox spans the outer points. Longitudes are unwrapped first, so a grid + crossing the antimeridian (or 0/360 degrees) keeps a regular step. Refuses + irregular spacing, which no affine transform describes, and NaN values. """ axes = {} for name, values in (("latitude", latitude), ("longitude", longitude)): values = np.asarray(values, dtype="float64") + if name == "longitude" and values.size > 1 and not np.isnan(values).any(): + values = np.unwrap(values, period=360.0) if values.ndim != 1 or values.size < 2: msg = f"The {name} coordinate needs at least two values, got shape {values.shape}" raise ValueError(msg) @@ -893,8 +914,17 @@ def _plan_dataset( lon_values = coordinate_values(f"{path}/longitude") if lat_values is not None and lon_values is not None: # a regular geographic grid (the meteorology groups): its - # georeferencing derived from its coordinates - attributes = {**attributes, **_lat_lon_attributes(lat_values, lon_values)} + # georeferencing derived from its coordinates. A grid no + # transform describes is carried without it, as before, + # rather than stopping the conversion. + try: + attributes = {**attributes, **_lat_lon_attributes(lat_values, lon_values)} + except ValueError as error: + log.warning( + "Carrying a latitude/longitude group without georeferencing", + group=path, + reason=str(error), + ) return GroupSpecV3(attributes=attributes, members=members) transform, epsg, wkt2 = _proj_of(*anchor) members["spatial_ref"] = _plan_spatial_ref(wkt2, native=True) diff --git a/tests/test_data_api/test_s2_plan.py b/tests/test_data_api/test_s2_plan.py index cdab68ea..aab1b3aa 100644 --- a/tests/test_data_api/test_s2_plan.py +++ b/tests/test_data_api/test_s2_plan.py @@ -317,13 +317,21 @@ def test_plan_stores_labels_as_registered_strings(path: pathlib.Path) -> None: "spatial:transform": [0.25, 0.0, 8.0, 0.0, 0.5, 47.0], }, ), + ( + [10.0, 9.5, 9.0], + [179.5, 179.75, -180.0, -179.75], + { + "spatial:bbox": [179.5, 9.0, 180.25, 10.0], + "spatial:transform": [0.25, 0.0, 179.5, 0.0, -0.5, 10.0], + }, + ), ( np.linspace(48.0, 44.8, 9, dtype="float32").tolist(), np.linspace(8.0, 11.2, 9, dtype="float32").tolist(), {"spatial:shape": [9, 9]}, ), ], - ids=["latitude-decreasing", "latitude-increasing", "float32-rounding"], + ids=["latitude-decreasing", "latitude-increasing", "antimeridian", "float32-rounding"], ) def test_lat_lon_attributes( latitude: list[float], longitude: list[float], expected: dict[str, object] @@ -409,6 +417,33 @@ def test_plan_stores_bytes_labels_as_strings() -> None: assert detector["dimension_names"] == ["detector"] +@pytest.mark.parametrize( + ("latitude", "longitude"), + [ + (np.array([48.0, 47.5, 46.0, 45.9, 45.0, 44.0, 43.0, 42.0, 41.0]), np.linspace(8, 10, 9)), + (np.full(9, np.nan), np.full(9, np.nan)), + ], + ids=["irregular", "nan-fill"], +) +def test_plan_carries_an_ungeoreferenceable_grid_without_georeferencing( + latitude: np.ndarray, longitude: np.ndarray +) -> None: + """A latitude/longitude group whose values no transform describes is + carried without `proj`/`spatial` attributes, not refused (#353).""" + root = Sentinel2Root.model_validate(_read(_INPUT_PATHS[0])) + values = { + f"conditions/meteorology/{group}/{name}": axis + for group in ("cams", "ecmwf") + for name, axis in (("latitude", latitude), ("longitude", longitude)) + } + planned = plan_geozarr(root, coordinate_values=values.get).model_dump(mode="json") + for group in ("cams", "ecmwf"): + attributes = planned["members"]["conditions"]["members"]["meteorology"]["members"][group][ + "attributes" + ] + assert "proj:code" not in attributes + + def test_plan_reflectance_requires_product_georeferencing() -> None: """A product whose bands carry no proj attributes and whose stac_discovery declares none is refused with a ValueError, not a KeyError.""" diff --git a/tests/test_data_api/test_s2_write.py b/tests/test_data_api/test_s2_write.py index 0d59c7aa..0efef872 100644 --- a/tests/test_data_api/test_s2_write.py +++ b/tests/test_data_api/test_s2_write.py @@ -162,6 +162,13 @@ def test_write_geozarr_realizes_the_plan(source_path: pathlib.Path, tmp_path: pa plan, _, output = _written_store(source_path, tmp_path) observed = GroupSpecV3.from_zarr(output).model_dump(mode="json") assert observed == plan.model_dump(mode="json") + # the meteorology groups are georeferenced from the coordinate values the + # writer read from the source (#353): the seeded 9-point regular grid + meteorology = observed["members"]["conditions"]["members"]["meteorology"]["members"] + for group in ("cams", "ecmwf"): + attributes = meteorology[group]["attributes"] + assert attributes["proj:code"] == "EPSG:4326" + assert attributes["spatial:transform"] == [0.25, 0.0, 8.0, 0.0, -0.25, 48.0] def test_write_geozarr_data_semantics(tmp_path: pathlib.Path) -> None: From 85366f431aff702e642b96ba6a0ab32d60f592f7 Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Fri, 13 Nov 2026 19:10:23 +0100 Subject: [PATCH 26/45] fix(s2-plan): keep a meteorology bbox's longitudes within [-180, 180] Addresses roborev's finding on 3ac4926. Longitudes are unwrapped for the spacing check and the transform. The bbox took the unwrapped extremes, so a grid crossing the antimeridian got an east longitude past 180. The bbox longitudes are now moved back into [-180, 180], so the crossing reads as west > east, as STAC and GeoJSON spell it. Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 --- src/eopf_geozarr/data_api/s2_plan.py | 14 +++++++++++++- tests/test_data_api/test_s2_plan.py | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/eopf_geozarr/data_api/s2_plan.py b/src/eopf_geozarr/data_api/s2_plan.py index 00854ba2..d0a4a44f 100644 --- a/src/eopf_geozarr/data_api/s2_plan.py +++ b/src/eopf_geozarr/data_api/s2_plan.py @@ -686,6 +686,15 @@ def _carried_group_attributes(group: Mapping[str, Any]) -> dict[str, object]: } +def _in_longitude_range(longitude: float) -> float: + """`longitude` moved by a turn into [-180, 180] when outside it, else as it is.""" + if longitude > 180.0: + return longitude - 360.0 + if longitude < -180.0: + return longitude + 360.0 + return longitude + + def _lat_lon_attributes(latitude: np.ndarray, longitude: np.ndarray) -> LatLonGroupAttrs: """ The `proj` and `spatial` attributes of a group on a regular geographic @@ -714,9 +723,12 @@ def _lat_lon_attributes(latitude: np.ndarray, longitude: np.ndarray) -> LatLonGr raise ValueError(msg) axes[name] = (values, step) (lat, dlat), (lon, dlon) = axes["latitude"], axes["longitude"] + # the bbox longitudes back in [-180, 180]: a grid crossing the antimeridian + # gets west > east, as STAC and GeoJSON spell the crossing + west, east = (_in_longitude_range(float(value)) for value in (lon.min(), lon.max())) return { "proj:code": "EPSG:4326", - "spatial:bbox": [float(lon.min()), float(lat.min()), float(lon.max()), float(lat.max())], + "spatial:bbox": [west, float(lat.min()), east, float(lat.max())], "spatial:dimensions": ["latitude", "longitude"], "spatial:registration": "node", "spatial:shape": [int(lat.size), int(lon.size)], diff --git a/tests/test_data_api/test_s2_plan.py b/tests/test_data_api/test_s2_plan.py index aab1b3aa..27d511e7 100644 --- a/tests/test_data_api/test_s2_plan.py +++ b/tests/test_data_api/test_s2_plan.py @@ -321,7 +321,7 @@ def test_plan_stores_labels_as_registered_strings(path: pathlib.Path) -> None: [10.0, 9.5, 9.0], [179.5, 179.75, -180.0, -179.75], { - "spatial:bbox": [179.5, 9.0, 180.25, 10.0], + "spatial:bbox": [179.5, 9.0, -179.75, 10.0], "spatial:transform": [0.25, 0.0, 179.5, 0.0, -0.5, 10.0], }, ), From 3c881acc74fde1daf9d23238c735af47f16248d8 Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Fri, 13 Nov 2026 20:46:51 +0100 Subject: [PATCH 27/45] feat!: stop writing the CF grid mapping; proj and spatial are the georeferencing BREAKING CHANGE: no `spatial_ref` grid-mapping arrays (with `crs_wkt` / `spatial_ref` attributes) and no `grid_mapping` attributes are written by the S2 plan, the S1 RTC ingest, the OLCI converter or the shared write path. The `proj` and `spatial` conventions are the only georeferencing. An array opened on its own has no CRS; read `proj:code` from its group. This breaks CRS resolution in rioxarray as released (0.23, 0.24 and its main branch). rioxarray recognizes the proj convention only under the name "proj:", while the proj v0.1 spec and zarr-cm 0.5 name it "proj". With the `spatial_ref` array gone, `ds.rio.crs` is None for this output. A strict xfail test records the break and fails once a rioxarray release reads the spec's name (#352). - S2 plan: no `spatial_ref` members, no `grid_mapping` on groups or arrays. `GridMappingAttrs` and the WKT plumbing are gone, so the product-level fallback no longer requires `proj:wkt2`. The writer and converter drop their `spatial_ref` cases. - Shared path: `strip_cf_grid_mapping` removes the grid-mapping variables and every `grid_mapping` attribute and encoding. `stream_write_dataset` applies it, and drops the encoding of the variables it removes. `write_dataset_geo_metadata` writes only the convention attributes, and now takes a CRS given as a string. - OLCI: the reprojection keeps rioxarray's CRS in memory for the computations downstream. The converter strips the grid mapping before each write. - S1: the ingest no longer adds the grid mapping, and the model no longer requires `spatial_ref`. It still accepts it, so stores ingested before validate. - The generic converter (`create_geozarr_dataset`) is built around the grid mapping and is left as it is. The output-contract test names it. - Validators: `check_grid_mapping` checks only a declared grid mapping, and the minispec validator tolerates one. Both stay, so older stores still validate. - Docs, the OLCI notebook and the changelog mark the grid mapping obsolete. The S2, OLCI and S1 fixtures are regenerated; the S1 fixture also picks up attributes the ingester already wrote. Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 12 + docs/architecture.md | 25 +- docs/converter.md | 7 +- docs/examples.md | 8 +- docs/faq.md | 9 +- docs/notebooks/sentinel3_olci_geozarr.ipynb | 8 +- src/eopf_geozarr/conversion/s1_ingest.py | 45 +- src/eopf_geozarr/conversion/utils.py | 56 +- src/eopf_geozarr/data_api/s1_rtc.py | 34 +- src/eopf_geozarr/data_api/s2_plan.py | 161 +- src/eopf_geozarr/data_api/s2_write.py | 9 +- .../s2_optimization/s2_converter.py | 4 +- .../s3_olci_optimization/olci_converter.py | 25 +- .../s3_olci_optimization/olci_reproject.py | 6 +- ...041_N0511_R122_T32TQM_20251008T122613.json | 1626 +---------------- ...309_N0511_R108_T32TLQ_20250113T122458.json | 934 ---------- ...131_N0511_R037_T29TPF_20250811T152216.json | 1626 +---------------- ...79_132_149_2160_PS1_O_NT_004-epsg4326.json | 186 -- .../s1_rtc_examples/s1-grd-rtc-31TCH.json | 449 +---- tests/test_data_api/test_s1_rtc.py | 30 +- tests/test_data_api/test_s2_plan.py | 26 +- tests/test_data_api/test_s2_write.py | 4 +- tests/test_geozarr_output_contract.py | 46 +- tests/test_olci_integration.py | 10 +- tests/test_olci_reproject.py | 9 +- tests/test_s1_rtc_ingest.py | 52 +- tests/test_s2_multiscale_geo_metadata.py | 40 +- 27 files changed, 310 insertions(+), 5137 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 513a5452..7b502db1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Breaking + +* The output's only georeferencing is the `proj` and `spatial` conventions. + The CF grid mapping of GeoZarr V0 is obsolete and no longer written, by the + S2, S1 RTC and OLCI converters and the shared write path: no `spatial_ref` + arrays (with `crs_wkt` / `spatial_ref` attributes) and no `grid_mapping` + attributes. An array opened on its own has no CRS; read `proj:code` from its + group. Stores written before are still read + ([#352](https://github.com/EOPF-Explorer/data-model/issues/352)). + ## 0.12.0 (2026-09-28) ## What's Changed diff --git a/docs/architecture.md b/docs/architecture.md index 83c74d6b..69e0e959 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -196,8 +196,7 @@ output.zarr/ │ │ │ ├── b04/ │ │ │ ├── b08/ │ │ │ ├── x/ # X coordinates -│ │ │ ├── y/ # Y coordinates -│ │ │ └── spatial_ref/ # CRS information +│ │ │ └── y/ # Y coordinates │ │ ├── 1/ # Overview level 1 (/2) │ │ └── 2/ # Overview level 2 (/4) │ ├── r20m/ # 20m resolution group @@ -348,20 +347,16 @@ y_attrs = { } ``` -### 2. Grid Mapping Variables +### 2. CRS -Each dataset includes proper grid mapping information: - -```python -# test: skip -grid_mapping_attrs = { - 'grid_mapping_name': 'transverse_mercator', # or appropriate mapping - 'projected_crs_name': crs.to_string(), - 'crs_wkt': crs.to_wkt(), - 'spatial_ref': crs.to_wkt(), - 'GeoTransform': transform_string -} -``` +Each dataset group declares its CRS with the +[proj convention](https://github.com/zarr-conventions/proj) (`proj:code`), and +its grid with the [spatial convention](https://github.com/zarr-conventions/spatial) +(`spatial:transform`, `spatial:shape`, `spatial:bbox`). These are the only +georeferencing: the CF grid mapping of GeoZarr V0 (a `spatial_ref` variable +holding `crs_wkt`, referenced by `grid_mapping` attributes) is obsolete and no +longer written ([#352](https://github.com/EOPF-Explorer/data-model/issues/352)). +An array opened on its own has no CRS; read `proj:code` from its group. ### 3. Multiscales Metadata diff --git a/docs/converter.md b/docs/converter.md index d365d931..db767ff9 100644 --- a/docs/converter.md +++ b/docs/converter.md @@ -204,9 +204,10 @@ output.zarr/ - **Native mode**: bands keep per-pixel 2-D `latitude`/`longitude`/`altitude` and per-row `time_stamp`, with no projected CRS. -- **Regular grid**: bands get 1-D `y`/`x` coordinates and a `spatial_ref` - variable referenced by `grid_mapping`. The per-row `time_stamp` is dropped; - it stays in the source product. +- **Regular grid**: bands get 1-D `y`/`x` coordinates, and each level group + declares its CRS with the `proj` convention (`proj:code`). No CF + `spatial_ref` grid-mapping variable or `grid_mapping` attribute is written. + The per-row `time_stamp` is dropped; it stays in the source product. - Radiance keeps the source packing (`uint16` with CF `scale_factor` and `_FillValue`). The tie-point groups in `conditions` are copied, not converted to the GeoZarr conventions. diff --git a/docs/examples.md b/docs/examples.md index 7da6d4c2..6b86def4 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -351,15 +351,13 @@ for level in ["0", "1", "2"]: for var_name in ds.data_vars: var = ds[var_name] has_dims = '_ARRAY_DIMENSIONS' in var.attrs - has_grid_mapping = 'grid_mapping' in var.attrs - print(f" {var_name}: dims={has_dims}, grid_mapping={has_grid_mapping}") + print(f" {var_name}: dims={has_dims}") -# Validate CRS information +# Validate CRS information: each georeferenced group declares `proj:code` for group_name in dt_check.groups: group = dt_check[group_name] if hasattr(group, 'ds') and group.ds is not None: - crs_vars = [v for v in group.ds.data_vars if 'spatial_ref' in v or 'crs' in v] - print(f"{group_name} CRS variables: {crs_vars}") + print(f"{group_name} CRS: {group.ds.attrs.get('proj:code', 'none')}") ``` ### Batch Processing diff --git a/docs/faq.md b/docs/faq.md index fbc00cdf..cc7e2017 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -293,7 +293,7 @@ zarr.consolidate_metadata("input.zarr") # test: skip # Check CRS information ds = dt["/measurements/reflectance/r10m"].ds -print("CRS variables:", [v for v in ds.data_vars if 'crs' in v.lower() or 'spatial_ref' in v]) +print("CRS:", ds.attrs.get("proj:code", "Missing")) # Check coordinate attributes print("X coord attrs:", ds.x.attrs) @@ -450,11 +450,10 @@ for level_name in ['r10m', 'r20m', 'r40m']: ds = dt[path].ds print(f"{level_name}: {dict(ds.dims)}") -# Check required attributes +# Check the georeferencing: the group's `proj` and `spatial` attributes ds = dt["/measurements/reflectance/r10m"].ds -for var_name in ds.data_vars: - var = ds[var_name] - print(f"{var_name}: grid_mapping={var.attrs.get('grid_mapping', 'Missing')}") +for key in ("proj:code", "spatial:transform", "spatial:shape"): + print(f"{key}: {ds.attrs.get(key, 'Missing')}") ``` ### What should I do if validation fails? diff --git a/docs/notebooks/sentinel3_olci_geozarr.ipynb b/docs/notebooks/sentinel3_olci_geozarr.ipynb index f9eb7208..f3fcf57c 100644 --- a/docs/notebooks/sentinel3_olci_geozarr.ipynb +++ b/docs/notebooks/sentinel3_olci_geozarr.ipynb @@ -19,7 +19,7 @@ "no projected CRS). By default, the exporter preserves that swath geometry —\n", "no reprojection — with geodesic-centroid overview geolocation. Passing\n", "`output_grid=\"EPSG:4326\"` opts into a one-time warp onto a regular grid,\n", - "where every pyramid level then declares its own CRS (`spatial_ref`/`grid_mapping`\n", + "where every pyramid level then declares its own CRS (`proj:code`\n", "plus `proj:` convention attrs). Both modes are demonstrated below.\n", "\n", "> Requires the `notebooks` dependency group:\n", @@ -688,9 +688,9 @@ "Everything above ran with the default `output_grid=\"native\"`, which keeps\n", "the instrument swath geometry untouched. Passing `output_grid=\"\"`\n", "(e.g. `\"EPSG:4326\"`) instead opts into a one-time warp of the swath onto a\n", - "regular grid: the output gains 1-D `y`/`x` dimension coordinates and a\n", - "`spatial_ref` variable, and every pyramid level declares its own CRS via\n", - "`grid_mapping` and the GeoZarr `proj:` convention metadata. The per-row\n", + "regular grid: the output gains 1-D `y`/`x` dimension coordinates,\n", + "and every pyramid level declares its own CRS via the GeoZarr `proj:`\n", + "convention metadata. The per-row\n", "`time_stamp` coordinate has no home on a regular grid, so it is dropped\n", "from the regridded output (it remains in the source product)." ] diff --git a/src/eopf_geozarr/conversion/s1_ingest.py b/src/eopf_geozarr/conversion/s1_ingest.py index 688c5d7a..0e23409e 100644 --- a/src/eopf_geozarr/conversion/s1_ingest.py +++ b/src/eopf_geozarr/conversion/s1_ingest.py @@ -32,7 +32,6 @@ import zarr.codecs from pyproj import CRS as PyprojCRS from rasterio.errors import RasterioIOError -from zarr.core.metadata.v3 import ArrayV3Metadata from zarr_cm import geo_proj from zarr_cm import multiscales as multiscales_cm from zarr_cm import spatial as spatial_cm @@ -486,40 +485,6 @@ def _create_time_coordinate_array(level_group: zarr.Group) -> None: t_arr.attrs.update(cast("dict", {**TIME_CF_ATTRS, "_ARRAY_DIMENSIONS": ["time"]})) -def _add_grid_mapping(group: zarr.Group, crs_string: CRSCode) -> None: - """Add a CF ``spatial_ref`` grid-mapping coordinate to a group holding (y, x) arrays. - - rioxarray -- and TiTiler's GeoZarr reader -- resolve the CRS from a CF - ``spatial_ref``/``crs_wkt`` coordinate; the GeoZarr ``proj:code`` attribute alone - is not read. This mirrors the S2 converter (which writes a ``spatial_ref`` - grid-mapping variable via ``rio.write_crs``). The CF attributes come from - ``pyproj.CRS.to_cf()`` -- the same source rioxarray uses -- so the projection is - described correctly for any CRS rather than hard-coded. - - The scalar ``spatial_ref`` array is created (if absent) and every (y, x) data - array in the group is given ``grid_mapping = "spatial_ref"``. - """ - cf_attrs = PyprojCRS.from_user_input(crs_string).to_cf() - # rioxarray writes both ``crs_wkt`` and a ``spatial_ref`` attr holding the WKT. - cf_attrs["spatial_ref"] = cf_attrs["crs_wkt"] - cf_attrs["_ARRAY_DIMENSIONS"] = [] - - if "spatial_ref" in group: - sref = group["spatial_ref"] - else: - sref = group.create_array("spatial_ref", shape=(), dtype="int64", fill_value=0) - sref[...] = 0 - sref.attrs.update(cf_attrs) - - for name, arr in group.arrays(): - # This store is always Zarr V3; only V3 metadata carries ``dimension_names``. - dimension_names = ( - arr.metadata.dimension_names if isinstance(arr.metadata, ArrayV3Metadata) else None - ) - if name != "spatial_ref" and {"y", "x"}.issubset(dimension_names or ()): - arr.attrs["grid_mapping"] = "spatial_ref" - - def _create_band_arrays(level_group: zarr.Group, level_h: int, level_w: int) -> None: """Create the (time, y, x) data bands (vv, vh, border_mask) for one multiscale level. @@ -756,7 +721,6 @@ def _build_orbit_group( _create_spatial_coordinate_arrays( level_group, level_h, level_w, level_entry["spatial:transform"] ) - _add_grid_mapping(level_group, metadata.crs) # `time` coordinate on every level so datetime `.sel` resolves at any rendered scale (#192). _create_time_coordinate_array(level_group) @@ -1593,10 +1557,9 @@ def ingest_s1tiling_conditions( # Heal a conditions group written before this function created x/y -- AFTER the grid # checks above, so a mismatched raster raises instead of writing coordinates that do not - # describe it. `_add_grid_mapping` below already runs unconditionally, so re-running - # `ingest-s1-conditions` restored `spatial_ref`; x/y were only ever created on the branch - # above, so an older group could not be repaired at all and the data model (which now - # requires them) rejected the store with no route back short of a full reingest. + # describe it. x/y were only ever created on the branch above, so an older group could + # not be repaired at all and the data model (which now requires them) rejected the store + # with no route back short of a full reingest. # # Per-coordinate, not both-or-nothing: a run interrupted between the two writes leaves # `x` present and `y` absent, and recreating the pair would raise `ContainsArrayError` @@ -1674,8 +1637,6 @@ def ingest_s1tiling_conditions( max=float(np.nanmax(data)), ) - _add_grid_mapping(conditions, ref_crs) - # Drop the now-stale consolidated blocks, exactly as the acquisition path does. Without this # the repair above is INVISIBLE: `stac._open_root`, xarray and TiTiler all read the # consolidated view, which still lists the pre-repair members -- so a store whose x/y were diff --git a/src/eopf_geozarr/conversion/utils.py b/src/eopf_geozarr/conversion/utils.py index b9d683e9..a51d3cc5 100644 --- a/src/eopf_geozarr/conversion/utils.py +++ b/src/eopf_geozarr/conversion/utils.py @@ -354,18 +354,49 @@ def get_subroots(groups: tuple[str, ...]) -> set[str] | None: return subroots or None +def strip_cf_grid_mapping(dataset: xr.Dataset) -> xr.Dataset: + """ + Return a copy of *dataset* without the CF grid mapping (GeoZarr V0); the + input is not modified (EOPF-Explorer/data-model#352). + + The `proj` and `spatial` conventions are the output's only georeferencing, + so the grid-mapping variables (`spatial_ref`, and any variable a + `grid_mapping` attribute or encoding names) are dropped, and + `grid_mapping` is removed from the dataset's attributes and from every + variable's attributes and encoding. rioxarray's `write_crs` adds them, so + a dataset that was reprojected through rioxarray needs this before it is + written. + """ + names = {"spatial_ref"} + for holder in (dataset.attrs, *(v.attrs for v in dataset.variables.values())): + if isinstance(holder.get("grid_mapping"), str): + names.add(holder["grid_mapping"]) + for variable in dataset.variables.values(): + if isinstance(variable.encoding.get("grid_mapping"), str): + names.add(variable.encoding["grid_mapping"]) + out = dataset.drop_vars([name for name in names if name in dataset.variables]) + out = out.copy(deep=False) + out.attrs = {key: value for key, value in out.attrs.items() if key != "grid_mapping"} + for variable in out.variables.values(): + variable.attrs = {k: v for k, v in variable.attrs.items() if k != "grid_mapping"} + variable.encoding = {k: v for k, v in variable.encoding.items() if k != "grid_mapping"} + return out + + def write_dataset_geo_metadata( dataset: xr.Dataset, - grid_mapping_var_name: str = "spatial_ref", crs: CRS | None = None, ) -> xr.Dataset: """ Return a copy of the dataset with geographic metadata added; `dataset` is not modified. Requires a crs or a dataset from which a CRS can be derived. + The metadata is the `proj` and `spatial` convention attributes only: no + CF grid mapping (`spatial_ref` variable, `grid_mapping` attributes) is + written (EOPF-Explorer/data-model#352). + Args: dataset: Dataset to add metadata to - grid_mapping_var_name: Name for grid mapping variable crs: Coordinate Reference System to use (if None, attempts to detect from dataset) Returns: @@ -386,19 +417,9 @@ def write_dataset_geo_metadata( break if crs is not None: - # Write CRS using rioxarray - # NOTE: for now rioxarray only supports writing grid mapping using CF conventions - dataset.rio.write_crs(crs, grid_mapping_name=grid_mapping_var_name, inplace=True) - dataset.rio.write_grid_mapping(grid_mapping_var_name, inplace=True) - dataset.attrs["grid_mapping"] = grid_mapping_var_name - - for var in dataset.data_vars.values(): - var.rio.write_grid_mapping(grid_mapping_var_name, inplace=True) - var.attrs["grid_mapping"] = grid_mapping_var_name - - # Also add proj: and spatial: zarr conventions at dataset level - # TODO : Remove once rioxarray supports writing these conventions directly - # https://github.com/corteva/rioxarray/pull/883 + # a CRS given as a string or EPSG code, which `rio.write_crs` used to take + crs = CRS.from_user_input(crs) + # The proj: and spatial: zarr conventions at dataset level # Assemble spatial convention data spatial_data: spatial_cm.SpatialAttrs = { @@ -482,6 +503,11 @@ def stream_write_dataset( if add_geo_metadata: dataset = write_dataset_geo_metadata(dataset, crs=crs) + # No CF grid mapping reaches the output (#352); its encoding entries go + # with the variables + dataset = strip_cf_grid_mapping(dataset) + encoding = {name: enc for name, enc in encoding.items() if name in dataset.variables} + # Sanitize NaN values in dataset attributes before writing dataset = fs_utils.sanitize_dataset_attributes(dataset) diff --git a/src/eopf_geozarr/data_api/s1_rtc.py b/src/eopf_geozarr/data_api/s1_rtc.py index 41e7aa5c..f10cc8a7 100644 --- a/src/eopf_geozarr/data_api/s1_rtc.py +++ b/src/eopf_geozarr/data_api/s1_rtc.py @@ -20,14 +20,13 @@ │ │ ├── border_mask/ # (time, Y, X) uint8 │ │ ├── time/ # (time,) int64 datetime │ │ ├── x/, y/ # (X,) / (Y,) float64 - │ │ ├── spatial_ref/ # CF grid mapping (scalar) │ │ ├── absolute_orbit/ │ │ ├── relative_orbit/ │ │ └── platform/ │ ├── r20m/ … r720m/ # overview levels: vv, vh, border_mask + - │ │ # time, x, y, spatial_ref (no orbit metadata) + │ │ # time, x, y (no orbit metadata) │ └── conditions/ - │ ├── x/, y/, spatial_ref/ + │ ├── x/, y/ │ └── gamma_area_{orbit}/ # (Y, X) float32; also lia_*/incidence_angle_* └── descending/ └── (same structure) @@ -148,8 +147,10 @@ class S1RtcConditionsAttrs(BaseModel): class S1RtcNativeResolutionMembers(TypedDict, closed=True, total=False): """Members for the native resolution dataset (r10m). - Data variables (time, Y, X), the 1-D coordinates (`time`, `y`, `x`), the per-acquisition - metadata arrays (time,) and the CF `spatial_ref` grid-mapping scalar. + Data variables (time, Y, X), the 1-D coordinates (`time`, `y`, `x`) and the per-acquisition + metadata arrays (time,). The CRS is the group's `proj:code`; a CF `spatial_ref` + grid-mapping scalar is no longer written (#352) but is accepted, so stores ingested before + are still read. Every key is optional *in the type* so the members mapping can be built up incrementally; presence of the coordinate arrays is enforced separately by `validate_coordinate_arrays`. @@ -173,8 +174,8 @@ class S1RtcNativeResolutionMembers(TypedDict, closed=True, total=False): class S1RtcOverviewResolutionMembers(TypedDict, closed=True, total=False): """Members for overview resolution datasets (r20m … r720m). - Data variables plus the same coordinate set as the native level: `x`/`y` (georeferencing), - `spatial_ref` (CF grid mapping) and `time`. `time` is replicated at every level with + Data variables plus the same coordinate set as the native level: `x`/`y` (georeferencing) + and `time` (a legacy CF `spatial_ref` is accepted, as on the native level). `time` is replicated at every level with identical values — TiTiler renders previews off a coarse level, and a level without `time` cannot be selected by datetime (data-model #192) — so an overview is *not* a data-only group. @@ -202,14 +203,15 @@ class S1RtcOverviewResolutionMembers(TypedDict, closed=True, total=False): # That is exactly the regression class this model exists to catch: `time` was missing from the # overview levels until data-model #192, which made datetime `.sel` fail on the coarse levels # TiTiler renders previews from. `x`/`y` absent means the level has no georeferencing at all -# (rioxarray falls back to an identity transform), and `spatial_ref` absent means its CRS cannot -# be resolved. Hence the explicit presence check below rather than `Required[...]`. -LEVEL_COORDINATE_ARRAYS = ("time", "x", "y", "spatial_ref") +# (rioxarray falls back to an identity transform). Hence the explicit presence check below rather +# than `Required[...]`. The CRS is the group's `proj:code`: the CF `spatial_ref` grid mapping is +# no longer written or required (#352), only accepted in stores ingested before. +LEVEL_COORDINATE_ARRAYS = ("time", "x", "y") # The conditions group holds time-invariant rasters, so it carries no `time` — but it does need # the spatial coordinates. Without them the group opens with "dimensions without coordinates" and # rioxarray infers an identity transform: the georeferencing is absent, not merely undeclared. -CONDITION_COORDINATE_ARRAYS = ("x", "y", "spatial_ref") +CONDITION_COORDINATE_ARRAYS = ("x", "y") def _validate_coordinates(members: Mapping[str, Any], kind: str, required: tuple[str, ...]) -> None: @@ -235,7 +237,7 @@ def validate_data_variables(self) -> Self: @model_validator(mode="after") def validate_coordinate_arrays(self) -> Self: - """Ensure time, x, y and spatial_ref are present (see LEVEL_COORDINATE_ARRAYS).""" + """Ensure time, x and y are present (see LEVEL_COORDINATE_ARRAYS).""" _validate_coordinates(self.members, "Native resolution dataset", LEVEL_COORDINATE_ARRAYS) return self @@ -270,7 +272,7 @@ class S1RtcOverviewResolutionDataset( @model_validator(mode="after") def validate_coordinate_arrays(self) -> Self: - """Ensure time, x, y and spatial_ref are present (see LEVEL_COORDINATE_ARRAYS).""" + """Ensure time, x and y are present (see LEVEL_COORDINATE_ARRAYS).""" _validate_coordinates(self.members, "Overview resolution dataset", LEVEL_COORDINATE_ARRAYS) return self @@ -292,7 +294,7 @@ class S1RtcConditionsGroup(GroupSpec[S1RtcConditionsAttrs, dict[str, ArraySpec[A # coordinates precisely so it exercises the other check. @model_validator(mode="after") def validate_coordinate_arrays(self) -> Self: - """Ensure x, y and spatial_ref are present (see CONDITION_COORDINATE_ARRAYS). + """Ensure x and y are present (see CONDITION_COORDINATE_ARRAYS). Same reasoning as the resolution levels: without 1-D coordinates the group opens with "dimensions without coordinates" and its rasters are not georeferenced at all. The writer @@ -382,11 +384,11 @@ class S1RtcRoot(GroupSpec[DatasetAttrs, S1RtcRootMembers]): │ │ ├── vh/ # (time, Y, X) float32 │ │ ├── border_mask/ # (time, Y, X) uint8 │ │ ├── time/ # (time,) int64 - │ │ ├── x/, y/, spatial_ref/ + │ │ ├── x/, y/ │ │ ├── absolute_orbit/ │ │ ├── relative_orbit/ │ │ └── platform/ - │ ├── r20m/ … r720m/ # + time, x, y, spatial_ref at every level + │ ├── r20m/ … r720m/ # + time, x, y at every level │ └── conditions/ │ └── gamma_area_{orbit}/ └── descending/ diff --git a/src/eopf_geozarr/data_api/s2_plan.py b/src/eopf_geozarr/data_api/s2_plan.py index d0a4a44f..04438cfc 100644 --- a/src/eopf_geozarr/data_api/s2_plan.py +++ b/src/eopf_geozarr/data_api/s2_plan.py @@ -13,8 +13,8 @@ Everything the plan emits is derived from the input model's own metadata: EOPF products carry `long_name`, the `proj:*` attributes, and the CF packing attributes on every band, so the output documents (band arrays retyped and -sharded, per-level coordinate arrays, `spatial_ref` grid-mapping arrays, the -spatial/proj convention attributes, and the multiscales layout) are all +sharded, per-level coordinate arrays, the spatial/proj convention +attributes, and the multiscales layout) are all computable from the input document alone. The reflectance pyramid follows the converter's policy @@ -26,8 +26,10 @@ chain. The `conditions` and `quality` subtrees are carried: their own multiscale groups (the classification masks and the cloud probabilities) are planned by `AUX_MULTISCALE_LEVELS`, georeferenced datasets get their spatial -attributes and `spatial_ref` grid mappings, and the quicklook groups and -scalar arrays are dropped, as the converter drops them. +attributes, and the quicklook groups and scalar arrays are dropped, as the +converter drops them. The `proj` and `spatial` conventions are the only +georeferencing: no CF `grid_mapping` attribute or `spatial_ref` grid-mapping +array is written (EOPF-Explorer/data-model#352). """ from __future__ import annotations @@ -43,17 +45,14 @@ import structlog import xarray as xr from pydantic_zarr.v2 import GroupSpec as GroupSpecV2 -from pydantic_zarr.v3 import ArraySpec as ArraySpecV3 from pydantic_zarr.v3 import GroupSpec as GroupSpecV3 from pydantic_zarr.v3 import parse_dtype_v3 -from pyproj import CRS from typing_extensions import TypedDict from zarr_cm import ConventionMetadataObject from zarr_cm.multiscales import CMO as MULTISCALES_CMO from zarr_cm.multiscales import MultiscalesAttrs from zarr_cm.proj import CMO as PROJ_CMO from zarr_cm.spatial import CMO as SPATIAL_CMO -from zarr_metadata.typed_json import check from eopf_geozarr.conversion.utils import normalize_cf_array_attrs from eopf_geozarr.data_api.geozarr.scope import GEOZARR_SCOPE @@ -72,7 +71,6 @@ from zarr_metadata.v3.codec.bytes import BytesCodecObject from zarr_metadata.v3.codec.crc32c import Crc32cCodecObject from zarr_metadata.v3.codec.sharding_indexed import ShardingIndexedCodecObject - from zarr_metadata.v3.codec.zstd import ZstdCodecObject log = structlog.get_logger() @@ -97,8 +95,8 @@ #: Band attributes carried from the input document, in the order they are #: carried; everything else (xarray bookkeeping such as `_ARRAY_DIMENSIONS` -#: and `_eopf_attrs`, and the per-band `proj:wkt2`, which the per-level -#: `spatial_ref` array carries instead) is dropped. +#: and `_eopf_attrs`, and the per-band `proj:wkt2`, which the enclosing +#: group's `proj:code` replaces) is dropped. _BAND_ATTR_CARRY = ( "add_offset", "long_name", @@ -169,29 +167,27 @@ def product_level(root: Sentinel2Root) -> S2Level: raise ValueError(msg) -def _product_proj(root: Sentinel2Root) -> tuple[tuple[float, float], int, str] | None: +def _product_proj(root: Sentinel2Root) -> tuple[tuple[float, float], int] | None: """ - The product-level georeferencing, as (origin, EPSG, WKT2), from the - `proj:*` keys of `stac_discovery` `properties` — the only place the Zarr - V3 baselines (N0512) declare it. The origin is the bbox's (min-x, max-y) - corner. Returns None when any of the three is missing or malformed. + The product-level georeferencing, as (origin, EPSG), from the `proj:*` + keys of `stac_discovery` `properties` — the only place the Zarr V3 + baselines (N0512) declare it. The origin is the bbox's (min-x, max-y) + corner. Returns None when either is missing or malformed. """ properties = root.attributes.stac_discovery.get("properties") if not isinstance(properties, dict): return None bbox = properties.get("proj:bbox") code = properties.get("proj:code") - wkt2 = properties.get("proj:wkt2") if ( not isinstance(bbox, (list, tuple)) or len(bbox) < 4 or not all(isinstance(value, (int, float)) for value in bbox[:4]) or not isinstance(code, str) or not code.startswith("EPSG:") - or not isinstance(wkt2, str) ): return None - return (float(bbox[0]), float(bbox[3])), int(code.removeprefix("EPSG:")), wkt2 + return (float(bbox[0]), float(bbox[3])), int(code.removeprefix("EPSG:")) def _shard_and_inner(shape: tuple[int, ...]) -> tuple[tuple[int, ...], tuple[int, ...]]: @@ -223,7 +219,6 @@ def _plan_band( """One band array of one *native* level: input attributes mapped and carried.""" attributes: dict[str, object] = { "_FillValue": source_attrs.get("fill_value", fill_value), - "grid_mapping": "spatial_ref", "units": "1", } for key in _BAND_ATTR_CARRY: @@ -307,80 +302,9 @@ def _plan_coordinate(name: str, size: int) -> DataArray: ) -class GridMappingAttrs(TypedDict, closed=True): - """ - The attributes of a Sentinel-2 `spatial_ref` grid-mapping array: pyproj's - CF encoding of the tile's UTM (transverse mercator) CRS, plus the WKT1 - spellings rioxarray stores (CF's `crs_wkt` and GDAL's `spatial_ref`). - """ - - crs_wkt: str - false_easting: float - false_northing: float - geographic_crs_name: str - grid_mapping_name: str - horizontal_datum_name: str - inverse_flattening: float - latitude_of_projection_origin: float - longitude_of_central_meridian: float - longitude_of_prime_meridian: float - prime_meridian_name: str - projected_crs_name: str - reference_ellipsoid_name: str - scale_factor_at_central_meridian: float - semi_major_axis: float - semi_minor_axis: float - spatial_ref: str - - -def _grid_mapping_attributes(wkt2: str) -> GridMappingAttrs: - """ - The CF grid-mapping attributes of a CRS, rioxarray-style, derived from - the product's own `proj:wkt2` (rather than re-deriving from the EPSG - code, which is hostage to the installed PROJ database's naming). - """ - # round-trip through CF: the stored grid mapping is exactly what a reader - # reconstructs from the CF attributes, with the authority bookkeeping the - # CF form cannot carry dropped from the WKT - crs = CRS.from_cf(CRS.from_wkt(wkt2).to_cf()) - attributes: dict[str, object] = dict(crs.to_cf()) - wkt = crs.to_wkt("WKT1_GDAL") - attributes["crs_wkt"] = wkt - attributes["spatial_ref"] = wkt - checked, problems = check(attributes, GridMappingAttrs) - if checked is None or problems: - details = "; ".join(f"{'.'.join(map(str, p.loc))}: {p.message}" for p in problems) - msg = f"The product CRS is not the expected transverse-mercator grid mapping: {details}" - raise ValueError(msg) - return checked - - -def _plan_spatial_ref(wkt2: str, *, native: bool) -> ArraySpecV3: - """ - The dimensionless `spatial_ref` grid-mapping array of one level. - - A plain `pydantic_zarr.v3.ArraySpec` rather than a GeoZarr `DataArray`: - the grid-mapping array has no dimensions, which `DataArray` requires. - The levels written natively carry a zstd codec; the coarsened levels are - written uncompressed (mirroring the two write paths of the converter). - """ - codecs: tuple[BytesCodecObject | ZstdCodecObject, ...] = (_BYTES_LITTLE,) - if native: - codecs = (*codecs, {"name": "zstd", "configuration": {"level": 0, "checksum": False}}) - # create_default supplies the scalar chunk grid, the `/` chunk key - # encoding and the zero fill value - return ArraySpecV3.create_default( - attributes=_grid_mapping_attributes(wkt2), - shape=(), - data_type="int64", - codecs=codecs, - ) - - SpatialGroupAttrs = TypedDict( "SpatialGroupAttrs", { - "grid_mapping": str, "proj:code": str, "spatial:bbox": list[float], "spatial:dimensions": list[str], @@ -425,8 +349,7 @@ def _plan_spatial_ref(wkt2: str, *, native: bool) -> ArraySpecV3: """The attributes of a multiscale pyramid's root group: zarr-cm's multiscales attributes plus the finest level's georeferencing, its `spatial:shape` with its `spatial:transform` so the transform says what grid it describes -(EOPF-Explorer/data-model#355); no `grid_mapping`, which belongs to the level -groups.""" +(EOPF-Explorer/data-model#355).""" def _spatial_dataset_attributes( @@ -438,7 +361,6 @@ def _spatial_dataset_attributes( res_x, _, x0, _, res_y, y0 = transform rows, cols = shape return { - "grid_mapping": "spatial_ref", "proj:code": f"EPSG:{epsg}", "spatial:bbox": [x0, y0 + rows * res_y, x0 + cols * res_x, y0], "spatial:dimensions": ["y", "x"], @@ -469,7 +391,7 @@ def plan_reflectance(root: Sentinel2Root) -> AnyGroupSpec: `REFLECTANCE_SCALE_LEVELS`, native levels carried from the input (with the product level's finer bands injected), coarser levels derived from the level before them, each holding sharded uint16 band arrays, float64 - `x`/`y` coordinates and a `spatial_ref` grid-mapping array, under a + `x`/`y` coordinates, under a multiscales layout attribute. """ level = product_level(root) @@ -496,25 +418,22 @@ def plan_reflectance(root: Sentinel2Root) -> AnyGroupSpec: first_band_attrs: Mapping[str, object] = finest.members[first_band_name].attributes transform = first_band_attrs.get("proj:transform") band_epsg = first_band_attrs.get("proj:epsg") - band_wkt2 = first_band_attrs.get("proj:wkt2") if ( isinstance(transform, (list, tuple)) and len(transform) >= 6 and isinstance(band_epsg, (int, str)) - and isinstance(band_wkt2, str) ): origin = (float(transform[2]), float(transform[5])) epsg = int(band_epsg) - wkt2 = band_wkt2 else: product = _product_proj(root) if product is None: msg = ( - f"Band {first_band_name!r} carries no usable proj:transform/proj:epsg/proj:wkt2 " + f"Band {first_band_name!r} carries no usable proj:transform/proj:epsg " "and the product declares no stac_discovery proj georeferencing" ) raise ValueError(msg) - origin, epsg, wkt2 = product + origin, epsg = product # per-level planned bands: name -> (source attrs, shape, dtype itemsize) planned_levels: dict[int, dict[str, DataArray]] = {} @@ -584,10 +503,9 @@ def plan_reflectance(root: Sentinel2Root) -> AnyGroupSpec: planned_levels[meters] = bands rows, cols = level_shape shape2d = (rows, cols) - level_members: dict[str, DataArray | ArraySpecV3] = dict(bands) + level_members: dict[str, DataArray] = dict(bands) level_members["x"] = _plan_coordinate("x", cols) level_members["y"] = _plan_coordinate("y", rows) - level_members["spatial_ref"] = _plan_spatial_ref(wkt2, native=native) level_attributes[meters] = _level_spatial_attributes( meters=meters, shape=shape2d, origin=origin, epsg=epsg @@ -782,21 +700,18 @@ def _carried_array_attributes( attrs: Mapping[str, object], *, is_float: bool, - grid_mapping: bool, name: str, dtype: np.dtype[Any], level_meters: int | None = None, ) -> dict[str, object]: """The output attributes of a carried array: sanitized, the CF attributes - put right for its data type, with the CF float fill, the grid-mapping - reference, the SCL flag table and a per-level `short_name`.""" + put right for its data type, with the CF float fill, the SCL flag table + and a per-level `short_name`.""" out = normalize_cf_array_attrs( {key: value for key, value in attrs.items() if key not in _DROPPED_ATTRS}, dtype ) if is_float: out["_FillValue"] = _NAN_FLOAT64_B64 - if grid_mapping: - out["grid_mapping"] = "spatial_ref" if name == "scl": # the converter's SCL flag table and NO_DATA fill declaration out.update(SCL_ATTRS) @@ -804,9 +719,7 @@ def _carried_array_attributes( return _with_level_short_name(out, name, level_meters) -def _plan_carried_array( - name: str, doc: _ArrayDoc, *, spatial: bool, level_meters: int | None = None -) -> DataArray: +def _plan_carried_array(name: str, doc: _ArrayDoc, *, level_meters: int | None = None) -> DataArray: """ One carried (non-reflectance) array, translated to its output document: `x`/`y` become the float64 coordinate arrays, other coordinate arrays @@ -829,7 +742,6 @@ def _plan_carried_array( attributes = _carried_array_attributes( attrs, is_float=parsed.kind == "f", - grid_mapping=spatial and "proj:epsg" in attrs, name=name, dtype=parsed, level_meters=level_meters, @@ -879,8 +791,8 @@ def _spatial_anchor(arrays: Mapping[str, _ArrayDoc]) -> tuple[str, _ArrayDoc] | _Transform6 = tuple[float, float, float, float, float, float] -def _proj_of(name: str, doc: _ArrayDoc) -> tuple[_Transform6, int, str]: - """The (transform, EPSG, WKT2) a proj-bearing input array carries.""" +def _proj_of(name: str, doc: _ArrayDoc) -> tuple[_Transform6, int]: + """The (transform, EPSG) a proj-bearing input array carries.""" attrs = _doc_attrs(doc) transform = attrs.get("proj:transform") if not isinstance(transform, (list, tuple)) or len(transform) < 6: @@ -890,7 +802,6 @@ def _proj_of(name: str, doc: _ArrayDoc) -> tuple[_Transform6, int, str]: return ( (a, b, c, d, e, f), int(attrs["proj:epsg"]), # type: ignore[call-overload] - str(attrs["proj:wkt2"]), ) @@ -900,7 +811,7 @@ def _plan_dataset( """ Plan one carried leaf dataset: every non-scalar array translated, and — when the dataset is georeferenced (an array carries proj attributes) — - the group's spatial attributes and a `spatial_ref` grid-mapping array. + the group's spatial attributes. Returns `None` for a dataset with no arrays to carry. """ arrays = _carried_arrays(group) @@ -908,8 +819,8 @@ def _plan_dataset( return None anchor = _spatial_anchor(arrays) meters = _level_meters(path) - members: dict[str, DataArray | ArraySpecV3] = { - name: _plan_carried_array(name, member, spatial=anchor is not None, level_meters=meters) + members: dict[str, DataArray] = { + name: _plan_carried_array(name, member, level_meters=meters) for name, member in arrays.items() } if anchor is None: @@ -938,8 +849,7 @@ def _plan_dataset( reason=str(error), ) return GroupSpecV3(attributes=attributes, members=members) - transform, epsg, wkt2 = _proj_of(*anchor) - members["spatial_ref"] = _plan_spatial_ref(wkt2, native=True) + transform, epsg = _proj_of(*anchor) return GroupSpecV3( attributes=_spatial_dataset_attributes(transform, tuple(anchor[1]["shape"]), epsg), members=members, @@ -950,7 +860,7 @@ def _plan_aux_multiscale( group: _GroupDoc, path: str, scale_levels: tuple[int, ...], - product_proj: tuple[tuple[float, float], int, str] | None = None, + product_proj: tuple[tuple[float, float], int] | None = None, ) -> AnyGroupSpec: """ Plan an auxiliary multiscale group (a classification mask or the cloud @@ -976,12 +886,12 @@ def _plan_aux_multiscale( } anchor = _spatial_anchor(finest_arrays) if anchor is not None: - transform, epsg, wkt2 = _proj_of(*anchor) + transform, epsg = _proj_of(*anchor) origin = (transform[2], transform[5]) elif product_proj is not None: # Zarr V3 baselines carry no proj attributes on the mask arrays; the # pyramid is georeferenced from the product-level declaration instead - origin, epsg, wkt2 = product_proj + origin, epsg = product_proj else: msg = f"The {path} group's finest level carries no proj attributes" raise ValueError(msg) @@ -1000,9 +910,7 @@ def _plan_aux_multiscale( for name, member in _carried_arrays(input_levels[meters]).items(): if name in ("x", "y"): continue - variables[name] = _plan_carried_array( - name, member, spatial=True, level_meters=meters - ) + variables[name] = _plan_carried_array(name, member, level_meters=meters) if not variables: msg = f"The {path} r{meters}m dataset holds no arrays" raise ValueError(msg) @@ -1038,10 +946,9 @@ def _plan_aux_multiscale( ) planned_levels[meters] = variables rows, cols = next(iter(variables.values())).shape - level_members: dict[str, DataArray | ArraySpecV3] = dict(variables) + level_members: dict[str, DataArray] = dict(variables) level_members["x"] = _plan_coordinate("x", cols) level_members["y"] = _plan_coordinate("y", rows) - level_members["spatial_ref"] = _plan_spatial_ref(wkt2, native=native) level_attributes[meters] = _level_spatial_attributes( meters=meters, shape=(rows, cols), origin=origin, epsg=epsg ) @@ -1095,7 +1002,7 @@ def _plan_aux_multiscale( def _plan_subtree( group: _GroupDoc, path: str, - product_proj: tuple[tuple[float, float], int, str] | None = None, + product_proj: tuple[tuple[float, float], int] | None = None, coordinate_values: CoordinateValues | None = None, ) -> AnyGroupSpec | None: """ diff --git a/src/eopf_geozarr/data_api/s2_write.py b/src/eopf_geozarr/data_api/s2_write.py index 20cf0a6d..6875c9d6 100644 --- a/src/eopf_geozarr/data_api/s2_write.py +++ b/src/eopf_geozarr/data_api/s2_write.py @@ -163,11 +163,8 @@ def _fill_group(spec: AnyGroupSpec, source: SourceReader, output: zarr.Group, pa def _fill_carried_array(source: SourceReader, output: zarr.Group, path: str) -> None: - """Copy one carried array's data from the input (grid mappings hold 0).""" + """Copy one carried array's data from the input.""" out_array = _output_array(output, path) - if path.rsplit("/", 1)[-1] == "spatial_ref": - out_array[...] = 0 - return values = source.values(path) if values is None: msg = f"The input source holds no array at {path!r}" @@ -201,8 +198,6 @@ def _fill_pyramid(spec: AnyGroupSpec, source: SourceReader, output: zarr.Group, data: dict[str, np.ndarray] = {} coords: dict[str, np.ndarray] = {} for var, member in level_spec.members.items(): - if var == "spatial_ref": - continue if var in ("x", "y"): coords[var] = _level_coordinate( source, @@ -226,8 +221,6 @@ def _fill_pyramid(spec: AnyGroupSpec, source: SourceReader, output: zarr.Group, ) for var, values in {**data, **coords}.items(): _output_array(output, f"{level_path}/{var}")[...] = values - if "spatial_ref" in level_spec.members: - _output_array(output, f"{level_path}/spatial_ref")[...] = 0 previous_data, previous_coords, previous_meters = data, coords, meters diff --git a/src/eopf_geozarr/s2_optimization/s2_converter.py b/src/eopf_geozarr/s2_optimization/s2_converter.py index 1fc4e7c2..06696b91 100644 --- a/src/eopf_geozarr/s2_optimization/s2_converter.py +++ b/src/eopf_geozarr/s2_optimization/s2_converter.py @@ -285,9 +285,7 @@ def walk(spec: AnyGroupSpec, path: str) -> None: names = tuple( name for name, member in spec.members.items() - if is_array_spec(member) - and name != "spatial_ref" - and (member.dimension_names or ()) != (name,) + if is_array_spec(member) and (member.dimension_names or ()) != (name,) ) if names: index[path] = names diff --git a/src/eopf_geozarr/s3_olci_optimization/olci_converter.py b/src/eopf_geozarr/s3_olci_optimization/olci_converter.py index 33b956f6..4c04819c 100644 --- a/src/eopf_geozarr/s3_olci_optimization/olci_converter.py +++ b/src/eopf_geozarr/s3_olci_optimization/olci_converter.py @@ -13,7 +13,7 @@ from rasterio.crs import CRS from eopf_geozarr.conversion.constants import ZARR_FORMAT -from eopf_geozarr.conversion.utils import build_convention_attrs +from eopf_geozarr.conversion.utils import build_convention_attrs, strip_cf_grid_mapping from eopf_geozarr.data_api.s3_olci import Sentinel3OlciRoot from eopf_geozarr.s3_olci_optimization.olci_band_mapping import OLCI_BANDS from eopf_geozarr.s3_olci_optimization.olci_multiscale import ( @@ -162,8 +162,9 @@ def _copy_subtree(node: xr.DataTree, output_path: str, *, root_group: str) -> No ds = child.to_dataset() if not ds.data_vars and not ds.coords: continue - # Strip any inherited Zarr v2 encoding before writing to a v3 store. - ds = _clear_encoding(ds) + # Strip any inherited Zarr v2 encoding, and any CF grid mapping (#352), + # before writing to a v3 store. + ds = _clear_encoding(strip_cf_grid_mapping(ds)) # Build the group path: strip the ancestor prefix and prepend root_group. relative = child.path[len(node_path) :] # "" for root, "/sub" for children group_path = root_group + relative @@ -302,16 +303,14 @@ def convert_olci_optimized( ) from e if crs_obj is not None: - # Warp the curvilinear swath onto a regular grid (1-D y/x coords, - # spatial_ref + grid_mapping on every variable) at (approximately) - # native resolution. Everything downstream — the pyramid, spatial - # attrs, and CRS metadata — operates on this gridded dataset. + # Warp the curvilinear swath onto a regular grid (1-D y/x coords) at + # (approximately) native resolution. Everything downstream — the + # pyramid, spatial attrs, and CRS metadata — operates on this gridded + # dataset. The `proj`/`spatial` attributes are the only georeferencing + # written, so the CF grid mapping rioxarray adds is stripped (#352), + # and the inherited encoding is cleared once more after the warp. measurements = reproject_olci(measurements, target_crs=output_grid) - # rioxarray's write_crs records grid_mapping in both .attrs and - # .encoding; xarray's to_zarr refuses to serialize a variable whose - # attrs and encoding disagree on an encoding-owned key, so clear the - # inherited encoding once more after the warp. - measurements = _clear_encoding(measurements) + measurements = _clear_encoding(strip_cf_grid_mapping(measurements)) pyramid_dims = GRID_DIMS else: pyramid_dims = SWATH_DIMS @@ -349,7 +348,7 @@ def convert_olci_optimized( current = measurements for level in range(1, n_levels + 1): current = reduce_swath(current, factor=2, dims=pyramid_dims) - current = _clear_encoding(current) + current = _clear_encoding(strip_cf_grid_mapping(current)) # Attrs already sanitized at native level and passed through by # reduce_swath; no second sanitize pass needed. if base_transform is not None: diff --git a/src/eopf_geozarr/s3_olci_optimization/olci_reproject.py b/src/eopf_geozarr/s3_olci_optimization/olci_reproject.py index f1700abe..e190d5fa 100644 --- a/src/eopf_geozarr/s3_olci_optimization/olci_reproject.py +++ b/src/eopf_geozarr/s3_olci_optimization/olci_reproject.py @@ -209,8 +209,6 @@ def reproject_olci( out = out.rio.write_crs(target_crs) if not isinstance(out, xr.Dataset): raise TypeError(f"expected an xarray.Dataset after write_crs, got {type(out).__name__}") - # rioxarray records grid_mapping in encoding; pin it in attrs so it is - # guaranteed to reach the zarr store. - for name in out.data_vars: - out[name].attrs["grid_mapping"] = "spatial_ref" + # the CRS stays on the dataset for the computations downstream; the CF grid + # mapping rioxarray records is stripped before writing (#352) return out diff --git a/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json b/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json index 00a94273..86a00e3d 100644 --- a/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json +++ b/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json @@ -412,7 +412,6 @@ "members": { "r10m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 699960.0, @@ -457,7 +456,6 @@ "members": { "b02": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 699960.0, @@ -551,7 +549,6 @@ }, "b03": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 699960.0, @@ -645,7 +642,6 @@ }, "b04": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 699960.0, @@ -739,7 +735,6 @@ }, "b08": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 699960.0, @@ -831,60 +826,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -967,7 +908,6 @@ }, "r20m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 699960.0, @@ -1012,7 +952,6 @@ "members": { "b05": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 699960.0, @@ -1106,7 +1045,6 @@ }, "b06": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 699960.0, @@ -1200,7 +1138,6 @@ }, "b07": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 699960.0, @@ -1294,7 +1231,6 @@ }, "b11": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 699960.0, @@ -1388,7 +1324,6 @@ }, "b12": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 699960.0, @@ -1482,7 +1417,6 @@ }, "b8a": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 699960.0, @@ -1574,60 +1508,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -1710,7 +1590,6 @@ }, "r60m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 699960.0, @@ -1755,7 +1634,6 @@ "members": { "b01": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 699960.0, @@ -1849,7 +1727,6 @@ }, "b09": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 699960.0, @@ -1943,7 +1820,6 @@ }, "b10": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 699960.0, @@ -2035,60 +1911,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -2324,7 +2146,6 @@ "members": { "r120m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 699960.0, @@ -2375,7 +2196,6 @@ 4 ], "flag_meanings": "OPAQUE CIRRUS SNOW_ICE", - "grid_mapping": "spatial_ref", "long_name": "cloud classification mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 699960.0, @@ -2444,53 +2264,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -2573,7 +2346,6 @@ }, "r360m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 699960.0, @@ -2624,7 +2396,6 @@ 4 ], "flag_meanings": "OPAQUE CIRRUS SNOW_ICE", - "grid_mapping": "spatial_ref", "long_name": "cloud classification mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 699960.0, @@ -2693,53 +2464,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -2822,7 +2546,6 @@ }, "r60m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 699960.0, @@ -2873,7 +2596,6 @@ 4 ], "flag_meanings": "OPAQUE CIRRUS SNOW_ICE", - "grid_mapping": "spatial_ref", "long_name": "cloud classification mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 699960.0, @@ -2965,60 +2687,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -3101,7 +2769,6 @@ }, "r720m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 699960.0, @@ -3152,7 +2819,6 @@ 4 ], "flag_meanings": "OPAQUE CIRRUS SNOW_ICE", - "grid_mapping": "spatial_ref", "long_name": "cloud classification mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 699960.0, @@ -3221,53 +2887,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -3529,7 +3148,6 @@ "members": { "r120m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 699960.0, @@ -3590,7 +3208,6 @@ 10, 11 ], - "grid_mapping": "spatial_ref", "proj:bbox": [ 699960.0, 4590240.0, @@ -3658,53 +3275,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -3787,7 +3357,6 @@ }, "r20m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 699960.0, @@ -3848,7 +3417,6 @@ 10, 11 ], - "grid_mapping": "spatial_ref", "proj:bbox": [ 699960.0, 4590240.0, @@ -3939,60 +3507,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -4075,7 +3589,6 @@ }, "r360m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 699960.0, @@ -4136,7 +3649,6 @@ 10, 11 ], - "grid_mapping": "spatial_ref", "proj:bbox": [ 699960.0, 4590240.0, @@ -4204,53 +3716,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -4333,7 +3798,6 @@ }, "r60m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 699960.0, @@ -4394,7 +3858,6 @@ 10, 11 ], - "grid_mapping": "spatial_ref", "proj:bbox": [ 699960.0, 4590240.0, @@ -4478,64 +3941,10 @@ ], "fill_value": 0, "node_type": "array", - "shape": [ - 1830, - 1830 - ], - "storage_transformers": [], - "zarr_format": 3 - }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], + "shape": [ + 1830, + 1830 + ], "storage_transformers": [], "zarr_format": 3 }, @@ -4621,7 +4030,6 @@ }, "r720m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 699960.0, @@ -4682,7 +4090,6 @@ 10, 11 ], - "grid_mapping": "spatial_ref", "proj:bbox": [ 699960.0, 4590240.0, @@ -4750,53 +4157,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -6690,7 +6050,6 @@ "members": { "r10m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 699960.0, @@ -6737,7 +6096,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b02 492.7 nm", "proj:bbox": [ 699960.0, @@ -6840,7 +6198,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b03 559.8 nm", "proj:bbox": [ 699960.0, @@ -6943,7 +6300,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b04 664.6 nm", "proj:bbox": [ 699960.0, @@ -7046,7 +6402,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b08 832.8 nm", "proj:bbox": [ 699960.0, @@ -7145,60 +6500,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -7281,7 +6582,6 @@ }, "r120m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 699960.0, @@ -7328,7 +6628,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b01 442.7 nm", "proj:bbox": [ 699960.0, @@ -7408,7 +6707,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b02 492.7 nm", "proj:bbox": [ 699960.0, @@ -7488,7 +6786,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b03 559.8 nm", "proj:bbox": [ 699960.0, @@ -7568,7 +6865,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b04 664.6 nm", "proj:bbox": [ 699960.0, @@ -7648,7 +6944,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b05 704.1 nm", "proj:bbox": [ 699960.0, @@ -7728,7 +7023,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b06 740.5 nm", "proj:bbox": [ 699960.0, @@ -7808,7 +7102,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b07 782.8 nm", "proj:bbox": [ 699960.0, @@ -7888,7 +7181,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b08 832.8 nm", "proj:bbox": [ 699960.0, @@ -7968,7 +7260,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b09 945.1 nm", "proj:bbox": [ 699960.0, @@ -8048,7 +7339,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b11 1613.7 nm", "proj:bbox": [ 699960.0, @@ -8128,7 +7418,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b12 2202.4 nm", "proj:bbox": [ 699960.0, @@ -8208,7 +7497,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b8a 864.7 nm", "proj:bbox": [ 699960.0, @@ -8284,53 +7572,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -8413,7 +7654,6 @@ }, "r20m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 699960.0, @@ -8460,7 +7700,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b01 442.7 nm", "proj:bbox": [ 699960.0, @@ -8563,7 +7802,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b02 492.7 nm", "proj:bbox": [ 699960.0, @@ -8666,7 +7904,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b03 559.8 nm", "proj:bbox": [ 699960.0, @@ -8769,7 +8006,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b04 664.6 nm", "proj:bbox": [ 699960.0, @@ -8872,7 +8108,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b05 704.1 nm", "proj:bbox": [ 699960.0, @@ -8975,7 +8210,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b06 740.5 nm", "proj:bbox": [ 699960.0, @@ -9078,7 +8312,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b07 782.8 nm", "proj:bbox": [ 699960.0, @@ -9181,7 +8414,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b08 832.8 nm", "proj:bbox": [ 699960.0, @@ -9284,7 +8516,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b11 1613.7 nm", "proj:bbox": [ 699960.0, @@ -9387,7 +8618,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b12 2202.4 nm", "proj:bbox": [ 699960.0, @@ -9490,7 +8720,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b8a 864.7 nm", "proj:bbox": [ 699960.0, @@ -9589,60 +8818,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -9725,7 +8900,6 @@ }, "r360m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 699960.0, @@ -9772,7 +8946,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b01 442.7 nm", "proj:bbox": [ 699960.0, @@ -9852,7 +9025,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b02 492.7 nm", "proj:bbox": [ 699960.0, @@ -9932,7 +9104,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b03 559.8 nm", "proj:bbox": [ 699960.0, @@ -10012,7 +9183,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b04 664.6 nm", "proj:bbox": [ 699960.0, @@ -10092,7 +9262,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b05 704.1 nm", "proj:bbox": [ 699960.0, @@ -10172,7 +9341,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b06 740.5 nm", "proj:bbox": [ 699960.0, @@ -10252,7 +9420,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b07 782.8 nm", "proj:bbox": [ 699960.0, @@ -10332,7 +9499,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b08 832.8 nm", "proj:bbox": [ 699960.0, @@ -10412,7 +9578,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b09 945.1 nm", "proj:bbox": [ 699960.0, @@ -10492,7 +9657,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b11 1613.7 nm", "proj:bbox": [ 699960.0, @@ -10572,7 +9736,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b12 2202.4 nm", "proj:bbox": [ 699960.0, @@ -10652,7 +9815,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b8a 864.7 nm", "proj:bbox": [ 699960.0, @@ -10728,53 +9890,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -10857,7 +9972,6 @@ }, "r60m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 699960.0, @@ -10904,7 +10018,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b01 442.7 nm", "proj:bbox": [ 699960.0, @@ -11007,7 +10120,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b02 492.7 nm", "proj:bbox": [ 699960.0, @@ -11110,7 +10222,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b03 559.8 nm", "proj:bbox": [ 699960.0, @@ -11213,7 +10324,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b04 664.6 nm", "proj:bbox": [ 699960.0, @@ -11316,7 +10426,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b05 704.1 nm", "proj:bbox": [ 699960.0, @@ -11419,7 +10528,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b06 740.5 nm", "proj:bbox": [ 699960.0, @@ -11522,7 +10630,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b07 782.8 nm", "proj:bbox": [ 699960.0, @@ -11625,7 +10732,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b08 832.8 nm", "proj:bbox": [ 699960.0, @@ -11728,7 +10834,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b09 945.1 nm", "proj:bbox": [ 699960.0, @@ -11831,7 +10936,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b11 1613.7 nm", "proj:bbox": [ 699960.0, @@ -11934,7 +11038,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b12 2202.4 nm", "proj:bbox": [ 699960.0, @@ -12037,7 +11140,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b8a 864.7 nm", "proj:bbox": [ 699960.0, @@ -12136,60 +11238,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -12272,7 +11320,6 @@ }, "r720m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 699960.0, @@ -12319,7 +11366,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b01 442.7 nm", "proj:bbox": [ 699960.0, @@ -12399,7 +11445,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b02 492.7 nm", "proj:bbox": [ 699960.0, @@ -12479,7 +11524,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b03 559.8 nm", "proj:bbox": [ 699960.0, @@ -12559,7 +11603,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b04 664.6 nm", "proj:bbox": [ 699960.0, @@ -12639,7 +11682,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b05 704.1 nm", "proj:bbox": [ 699960.0, @@ -12719,7 +11761,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b06 740.5 nm", "proj:bbox": [ 699960.0, @@ -12799,7 +11840,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b07 782.8 nm", "proj:bbox": [ 699960.0, @@ -12879,7 +11919,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b08 832.8 nm", "proj:bbox": [ 699960.0, @@ -12959,7 +11998,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b09 945.1 nm", "proj:bbox": [ 699960.0, @@ -13039,7 +12077,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b11 1613.7 nm", "proj:bbox": [ 699960.0, @@ -13119,7 +12156,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b12 2202.4 nm", "proj:bbox": [ 699960.0, @@ -13199,7 +12235,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b8a 864.7 nm", "proj:bbox": [ 699960.0, @@ -13275,53 +12310,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -13418,7 +12406,6 @@ "members": { "r10m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 699960.0, @@ -13463,7 +12450,6 @@ "members": { "aot": { "attributes": { - "grid_mapping": "spatial_ref", "proj:bbox": [ 699960.0, 4590240.0, @@ -13557,63 +12543,8 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "wvp": { "attributes": { - "grid_mapping": "spatial_ref", "proj:bbox": [ 699960.0, 4590240.0, @@ -13789,7 +12720,6 @@ }, "r20m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 699960.0, @@ -13834,7 +12764,6 @@ "members": { "aot": { "attributes": { - "grid_mapping": "spatial_ref", "proj:bbox": [ 699960.0, 4590240.0, @@ -13928,63 +12857,8 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "wvp": { "attributes": { - "grid_mapping": "spatial_ref", "proj:bbox": [ 699960.0, 4590240.0, @@ -14160,7 +13034,6 @@ }, "r60m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 699960.0, @@ -14205,7 +13078,6 @@ "members": { "aot": { "attributes": { - "grid_mapping": "spatial_ref", "proj:bbox": [ 699960.0, 4590240.0, @@ -14299,63 +13171,8 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "wvp": { "attributes": { - "grid_mapping": "spatial_ref", "proj:bbox": [ 699960.0, 4590240.0, @@ -14538,7 +13355,6 @@ "members": { "r10m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 699960.0, @@ -14594,7 +13410,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 699960.0, @@ -14699,7 +13514,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 699960.0, @@ -14804,7 +13618,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 699960.0, @@ -14909,7 +13722,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 699960.0, @@ -15001,60 +13813,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -15137,7 +13895,6 @@ }, "r20m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 699960.0, @@ -15193,7 +13950,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 699960.0, @@ -15298,7 +14054,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 699960.0, @@ -15403,7 +14158,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 699960.0, @@ -15508,7 +14262,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 699960.0, @@ -15613,7 +14366,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 699960.0, @@ -15718,7 +14470,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 699960.0, @@ -15810,60 +14561,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -15946,7 +14643,6 @@ }, "r60m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 699960.0, @@ -16002,7 +14698,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 699960.0, @@ -16107,7 +14802,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 699960.0, @@ -16212,7 +14906,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 699960.0, @@ -16304,60 +14997,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -16619,7 +15258,6 @@ "members": { "r120m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 699960.0, @@ -16665,7 +15303,6 @@ "cld": { "attributes": { "coordinates": "band", - "grid_mapping": "spatial_ref", "proj:bbox": [ 699960.0, 4590240.0, @@ -16736,7 +15373,6 @@ "snw": { "attributes": { "coordinates": "band", - "grid_mapping": "spatial_ref", "proj:bbox": [ 699960.0, 4590240.0, @@ -16804,53 +15440,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -16933,7 +15522,6 @@ }, "r20m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 699960.0, @@ -16979,7 +15567,6 @@ "cld": { "attributes": { "coordinates": "band", - "grid_mapping": "spatial_ref", "proj:bbox": [ 699960.0, 4590240.0, @@ -17073,7 +15660,6 @@ "snw": { "attributes": { "coordinates": "band", - "grid_mapping": "spatial_ref", "proj:bbox": [ 699960.0, 4590240.0, @@ -17164,60 +15750,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -17300,7 +15832,6 @@ }, "r360m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 699960.0, @@ -17346,7 +15877,6 @@ "cld": { "attributes": { "coordinates": "band", - "grid_mapping": "spatial_ref", "proj:bbox": [ 699960.0, 4590240.0, @@ -17417,7 +15947,6 @@ "snw": { "attributes": { "coordinates": "band", - "grid_mapping": "spatial_ref", "proj:bbox": [ 699960.0, 4590240.0, @@ -17485,53 +16014,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -17614,7 +16096,6 @@ }, "r60m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 699960.0, @@ -17660,7 +16141,6 @@ "cld": { "attributes": { "coordinates": "band", - "grid_mapping": "spatial_ref", "proj:bbox": [ 699960.0, 4590240.0, @@ -17754,7 +16234,6 @@ "snw": { "attributes": { "coordinates": "band", - "grid_mapping": "spatial_ref", "proj:bbox": [ 699960.0, 4590240.0, @@ -17845,53 +16324,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -17974,7 +16406,6 @@ }, "r720m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 699960.0, @@ -18020,7 +16451,6 @@ "cld": { "attributes": { "coordinates": "band", - "grid_mapping": "spatial_ref", "proj:bbox": [ 699960.0, 4590240.0, @@ -18091,7 +16521,6 @@ "snw": { "attributes": { "coordinates": "band", - "grid_mapping": "spatial_ref", "proj:bbox": [ 699960.0, 4590240.0, @@ -18159,53 +16588,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" diff --git a/tests/_test_data/optimized_geozarr_examples/S2B_MSIL1C_20250113T103309_N0511_R108_T32TLQ_20250113T122458.json b/tests/_test_data/optimized_geozarr_examples/S2B_MSIL1C_20250113T103309_N0511_R108_T32TLQ_20250113T122458.json index 979945e8..fa63e9af 100644 --- a/tests/_test_data/optimized_geozarr_examples/S2B_MSIL1C_20250113T103309_N0511_R108_T32TLQ_20250113T122458.json +++ b/tests/_test_data/optimized_geozarr_examples/S2B_MSIL1C_20250113T103309_N0511_R108_T32TLQ_20250113T122458.json @@ -412,7 +412,6 @@ "members": { "r10m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 300000.0, @@ -457,7 +456,6 @@ "members": { "b02": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 300000.0, @@ -551,7 +549,6 @@ }, "b03": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 300000.0, @@ -645,7 +642,6 @@ }, "b04": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 300000.0, @@ -739,7 +735,6 @@ }, "b08": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 300000.0, @@ -831,60 +826,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -967,7 +908,6 @@ }, "r20m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 300000.0, @@ -1012,7 +952,6 @@ "members": { "b05": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 300000.0, @@ -1106,7 +1045,6 @@ }, "b06": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 300000.0, @@ -1200,7 +1138,6 @@ }, "b07": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 300000.0, @@ -1294,7 +1231,6 @@ }, "b11": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 300000.0, @@ -1388,7 +1324,6 @@ }, "b12": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 300000.0, @@ -1482,7 +1417,6 @@ }, "b8a": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 300000.0, @@ -1574,60 +1508,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -1710,7 +1590,6 @@ }, "r60m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 300000.0, @@ -1755,7 +1634,6 @@ "members": { "b01": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 300000.0, @@ -1849,7 +1727,6 @@ }, "b09": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 300000.0, @@ -1943,7 +1820,6 @@ }, "b10": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 300000.0, @@ -2035,60 +1911,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -2324,7 +2146,6 @@ "members": { "r120m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 300000.0, @@ -2375,7 +2196,6 @@ 4 ], "flag_meanings": "OPAQUE CIRRUS SNOW_ICE", - "grid_mapping": "spatial_ref", "long_name": "cloud classification mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 300000.0, @@ -2444,53 +2264,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -2573,7 +2346,6 @@ }, "r360m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 300000.0, @@ -2624,7 +2396,6 @@ 4 ], "flag_meanings": "OPAQUE CIRRUS SNOW_ICE", - "grid_mapping": "spatial_ref", "long_name": "cloud classification mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 300000.0, @@ -2693,53 +2464,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -2822,7 +2546,6 @@ }, "r60m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 300000.0, @@ -2873,7 +2596,6 @@ 4 ], "flag_meanings": "OPAQUE CIRRUS SNOW_ICE", - "grid_mapping": "spatial_ref", "long_name": "cloud classification mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 300000.0, @@ -2965,60 +2687,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -3101,7 +2769,6 @@ }, "r720m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 300000.0, @@ -3152,7 +2819,6 @@ 4 ], "flag_meanings": "OPAQUE CIRRUS SNOW_ICE", - "grid_mapping": "spatial_ref", "long_name": "cloud classification mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 300000.0, @@ -3221,53 +2887,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -5161,7 +4780,6 @@ "members": { "r10m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 300000.0, @@ -5208,7 +4826,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b02 492.3 nm", "proj:bbox": [ 300000.0, @@ -5311,7 +4928,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b03 559.0 nm", "proj:bbox": [ 300000.0, @@ -5414,7 +5030,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b04 665.0 nm", "proj:bbox": [ 300000.0, @@ -5517,7 +5132,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b08 833.0 nm", "proj:bbox": [ 300000.0, @@ -5616,60 +5230,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -5752,7 +5312,6 @@ }, "r120m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 300000.0, @@ -5799,7 +5358,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b01 442.3 nm", "proj:bbox": [ 300000.0, @@ -5879,7 +5437,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b02 492.3 nm", "proj:bbox": [ 300000.0, @@ -5959,7 +5516,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b03 559.0 nm", "proj:bbox": [ 300000.0, @@ -6039,7 +5595,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b04 665.0 nm", "proj:bbox": [ 300000.0, @@ -6119,7 +5674,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b05 703.8 nm", "proj:bbox": [ 300000.0, @@ -6199,7 +5753,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b06 739.1 nm", "proj:bbox": [ 300000.0, @@ -6279,7 +5832,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b07 779.7 nm", "proj:bbox": [ 300000.0, @@ -6359,7 +5911,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b08 833.0 nm", "proj:bbox": [ 300000.0, @@ -6439,7 +5990,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b09 943.2 nm", "proj:bbox": [ 300000.0, @@ -6519,7 +6069,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b10 1376.9 nm", "proj:bbox": [ 300000.0, @@ -6599,7 +6148,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b11 1610.4 nm", "proj:bbox": [ 300000.0, @@ -6679,7 +6227,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b12 2185.7 nm", "proj:bbox": [ 300000.0, @@ -6759,7 +6306,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b8a 864.0 nm", "proj:bbox": [ 300000.0, @@ -6835,53 +6381,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -6964,7 +6463,6 @@ }, "r20m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 300000.0, @@ -7011,7 +6509,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b02 492.3 nm", "proj:bbox": [ 300000.0, @@ -7114,7 +6611,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b03 559.0 nm", "proj:bbox": [ 300000.0, @@ -7217,7 +6713,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b04 665.0 nm", "proj:bbox": [ 300000.0, @@ -7320,7 +6815,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b05 703.8 nm", "proj:bbox": [ 300000.0, @@ -7423,7 +6917,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b06 739.1 nm", "proj:bbox": [ 300000.0, @@ -7526,7 +7019,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b07 779.7 nm", "proj:bbox": [ 300000.0, @@ -7629,7 +7121,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b08 833.0 nm", "proj:bbox": [ 300000.0, @@ -7732,7 +7223,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b11 1610.4 nm", "proj:bbox": [ 300000.0, @@ -7835,7 +7325,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b12 2185.7 nm", "proj:bbox": [ 300000.0, @@ -7938,7 +7427,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b8a 864.0 nm", "proj:bbox": [ 300000.0, @@ -8037,60 +7525,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -8173,7 +7607,6 @@ }, "r360m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 300000.0, @@ -8220,7 +7653,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b01 442.3 nm", "proj:bbox": [ 300000.0, @@ -8300,7 +7732,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b02 492.3 nm", "proj:bbox": [ 300000.0, @@ -8380,7 +7811,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b03 559.0 nm", "proj:bbox": [ 300000.0, @@ -8460,7 +7890,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b04 665.0 nm", "proj:bbox": [ 300000.0, @@ -8540,7 +7969,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b05 703.8 nm", "proj:bbox": [ 300000.0, @@ -8620,7 +8048,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b06 739.1 nm", "proj:bbox": [ 300000.0, @@ -8700,7 +8127,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b07 779.7 nm", "proj:bbox": [ 300000.0, @@ -8780,7 +8206,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b08 833.0 nm", "proj:bbox": [ 300000.0, @@ -8860,7 +8285,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b09 943.2 nm", "proj:bbox": [ 300000.0, @@ -8940,7 +8364,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b10 1376.9 nm", "proj:bbox": [ 300000.0, @@ -9020,7 +8443,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b11 1610.4 nm", "proj:bbox": [ 300000.0, @@ -9100,7 +8522,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b12 2185.7 nm", "proj:bbox": [ 300000.0, @@ -9180,7 +8601,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b8a 864.0 nm", "proj:bbox": [ 300000.0, @@ -9256,53 +8676,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -9385,7 +8758,6 @@ }, "r60m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 300000.0, @@ -9432,7 +8804,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b01 442.3 nm", "proj:bbox": [ 300000.0, @@ -9535,7 +8906,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b02 492.3 nm", "proj:bbox": [ 300000.0, @@ -9638,7 +9008,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b03 559.0 nm", "proj:bbox": [ 300000.0, @@ -9741,7 +9110,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b04 665.0 nm", "proj:bbox": [ 300000.0, @@ -9844,7 +9212,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b05 703.8 nm", "proj:bbox": [ 300000.0, @@ -9947,7 +9314,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b06 739.1 nm", "proj:bbox": [ 300000.0, @@ -10050,7 +9416,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b07 779.7 nm", "proj:bbox": [ 300000.0, @@ -10153,7 +9518,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b08 833.0 nm", "proj:bbox": [ 300000.0, @@ -10256,7 +9620,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b09 943.2 nm", "proj:bbox": [ 300000.0, @@ -10359,7 +9722,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b10 1376.9 nm", "proj:bbox": [ 300000.0, @@ -10462,7 +9824,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b11 1610.4 nm", "proj:bbox": [ 300000.0, @@ -10565,7 +9926,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b12 2185.7 nm", "proj:bbox": [ 300000.0, @@ -10668,7 +10028,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b8a 864.0 nm", "proj:bbox": [ 300000.0, @@ -10767,60 +10126,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -10903,7 +10208,6 @@ }, "r720m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 300000.0, @@ -10950,7 +10254,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b01 442.3 nm", "proj:bbox": [ 300000.0, @@ -11030,7 +10333,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b02 492.3 nm", "proj:bbox": [ 300000.0, @@ -11110,7 +10412,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b03 559.0 nm", "proj:bbox": [ 300000.0, @@ -11190,7 +10491,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b04 665.0 nm", "proj:bbox": [ 300000.0, @@ -11270,7 +10570,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b05 703.8 nm", "proj:bbox": [ 300000.0, @@ -11350,7 +10649,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b06 739.1 nm", "proj:bbox": [ 300000.0, @@ -11430,7 +10728,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b07 779.7 nm", "proj:bbox": [ 300000.0, @@ -11510,7 +10807,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b08 833.0 nm", "proj:bbox": [ 300000.0, @@ -11590,7 +10886,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b09 943.2 nm", "proj:bbox": [ 300000.0, @@ -11670,7 +10965,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b10 1376.9 nm", "proj:bbox": [ 300000.0, @@ -11750,7 +11044,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b11 1610.4 nm", "proj:bbox": [ 300000.0, @@ -11830,7 +11123,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b12 2185.7 nm", "proj:bbox": [ 300000.0, @@ -11910,7 +11202,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "TOA reflectance from MSI acquisition at spectral band b8a 864.0 nm", "proj:bbox": [ 300000.0, @@ -11986,53 +11277,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -12129,7 +11373,6 @@ "members": { "r10m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 300000.0, @@ -12185,7 +11428,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 300000.0, @@ -12290,7 +11532,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 300000.0, @@ -12395,7 +11636,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 300000.0, @@ -12500,7 +11740,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 300000.0, @@ -12592,60 +11831,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -12728,7 +11913,6 @@ }, "r20m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 300000.0, @@ -12784,7 +11968,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 300000.0, @@ -12889,7 +12072,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 300000.0, @@ -12994,7 +12176,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 300000.0, @@ -13099,7 +12280,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 300000.0, @@ -13204,7 +12384,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 300000.0, @@ -13309,7 +12488,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 300000.0, @@ -13401,60 +12579,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -13537,7 +12661,6 @@ }, "r60m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ 300000.0, @@ -13593,7 +12716,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 300000.0, @@ -13698,7 +12820,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 300000.0, @@ -13803,7 +12924,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 300000.0, @@ -13895,60 +13015,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" diff --git a/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json b/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json index d213040f..c09971e1 100644 --- a/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json +++ b/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json @@ -412,7 +412,6 @@ "members": { "r10m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32629", "spatial:bbox": [ 600000.0, @@ -457,7 +456,6 @@ "members": { "b02": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 600000.0, @@ -551,7 +549,6 @@ }, "b03": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 600000.0, @@ -645,7 +642,6 @@ }, "b04": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 600000.0, @@ -739,7 +735,6 @@ }, "b08": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 600000.0, @@ -831,60 +826,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -967,7 +908,6 @@ }, "r20m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32629", "spatial:bbox": [ 600000.0, @@ -1012,7 +952,6 @@ "members": { "b05": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 600000.0, @@ -1106,7 +1045,6 @@ }, "b06": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 600000.0, @@ -1200,7 +1138,6 @@ }, "b07": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 600000.0, @@ -1294,7 +1231,6 @@ }, "b11": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 600000.0, @@ -1388,7 +1324,6 @@ }, "b12": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 600000.0, @@ -1482,7 +1417,6 @@ }, "b8a": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 600000.0, @@ -1574,60 +1508,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -1710,7 +1590,6 @@ }, "r60m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32629", "spatial:bbox": [ 600000.0, @@ -1755,7 +1634,6 @@ "members": { "b01": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 600000.0, @@ -1849,7 +1727,6 @@ }, "b09": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 600000.0, @@ -1943,7 +1820,6 @@ }, "b10": { "attributes": { - "grid_mapping": "spatial_ref", "long_name": "detector footprint mask provided in the final reference frame (ground geometry). 0 = no detector, 1-12 = detector 1-12", "proj:bbox": [ 600000.0, @@ -2035,60 +1911,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -2324,7 +2146,6 @@ "members": { "r120m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32629", "spatial:bbox": [ 600000.0, @@ -2375,7 +2196,6 @@ 4 ], "flag_meanings": "OPAQUE CIRRUS SNOW_ICE", - "grid_mapping": "spatial_ref", "long_name": "cloud classification mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 600000.0, @@ -2444,53 +2264,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -2573,7 +2346,6 @@ }, "r360m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32629", "spatial:bbox": [ 600000.0, @@ -2624,7 +2396,6 @@ 4 ], "flag_meanings": "OPAQUE CIRRUS SNOW_ICE", - "grid_mapping": "spatial_ref", "long_name": "cloud classification mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 600000.0, @@ -2693,53 +2464,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -2822,7 +2546,6 @@ }, "r60m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32629", "spatial:bbox": [ 600000.0, @@ -2873,7 +2596,6 @@ 4 ], "flag_meanings": "OPAQUE CIRRUS SNOW_ICE", - "grid_mapping": "spatial_ref", "long_name": "cloud classification mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 600000.0, @@ -2965,60 +2687,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -3101,7 +2769,6 @@ }, "r720m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32629", "spatial:bbox": [ 600000.0, @@ -3152,7 +2819,6 @@ 4 ], "flag_meanings": "OPAQUE CIRRUS SNOW_ICE", - "grid_mapping": "spatial_ref", "long_name": "cloud classification mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 600000.0, @@ -3221,53 +2887,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -3529,7 +3148,6 @@ "members": { "r120m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32629", "spatial:bbox": [ 600000.0, @@ -3590,7 +3208,6 @@ 10, 11 ], - "grid_mapping": "spatial_ref", "proj:bbox": [ 600000.0, 4490220.0, @@ -3658,53 +3275,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -3787,7 +3357,6 @@ }, "r20m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32629", "spatial:bbox": [ 600000.0, @@ -3848,7 +3417,6 @@ 10, 11 ], - "grid_mapping": "spatial_ref", "proj:bbox": [ 600000.0, 4490220.0, @@ -3939,60 +3507,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -4075,7 +3589,6 @@ }, "r360m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32629", "spatial:bbox": [ 600000.0, @@ -4136,7 +3649,6 @@ 10, 11 ], - "grid_mapping": "spatial_ref", "proj:bbox": [ 600000.0, 4490220.0, @@ -4204,53 +3716,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -4333,7 +3798,6 @@ }, "r60m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32629", "spatial:bbox": [ 600000.0, @@ -4394,7 +3858,6 @@ 10, 11 ], - "grid_mapping": "spatial_ref", "proj:bbox": [ 600000.0, 4490220.0, @@ -4478,64 +3941,10 @@ ], "fill_value": 0, "node_type": "array", - "shape": [ - 1830, - 1830 - ], - "storage_transformers": [], - "zarr_format": 3 - }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], + "shape": [ + 1830, + 1830 + ], "storage_transformers": [], "zarr_format": 3 }, @@ -4621,7 +4030,6 @@ }, "r720m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32629", "spatial:bbox": [ 600000.0, @@ -4682,7 +4090,6 @@ 10, 11 ], - "grid_mapping": "spatial_ref", "proj:bbox": [ 600000.0, 4490220.0, @@ -4750,53 +4157,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -6690,7 +6050,6 @@ "members": { "r10m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32629", "spatial:bbox": [ 600000.0, @@ -6737,7 +6096,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b02 489.0 nm", "proj:bbox": [ 600000.0, @@ -6840,7 +6198,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b03 560.6 nm", "proj:bbox": [ 600000.0, @@ -6943,7 +6300,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b04 666.5 nm", "proj:bbox": [ 600000.0, @@ -7046,7 +6402,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b08 834.6 nm", "proj:bbox": [ 600000.0, @@ -7145,60 +6500,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -7281,7 +6582,6 @@ }, "r120m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32629", "spatial:bbox": [ 600000.0, @@ -7328,7 +6628,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b01 444.2 nm", "proj:bbox": [ 600000.0, @@ -7408,7 +6707,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b02 489.0 nm", "proj:bbox": [ 600000.0, @@ -7488,7 +6786,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b03 560.6 nm", "proj:bbox": [ 600000.0, @@ -7568,7 +6865,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b04 666.5 nm", "proj:bbox": [ 600000.0, @@ -7648,7 +6944,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b05 707.1 nm", "proj:bbox": [ 600000.0, @@ -7728,7 +7023,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b06 741.1 nm", "proj:bbox": [ 600000.0, @@ -7808,7 +7102,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b07 784.7 nm", "proj:bbox": [ 600000.0, @@ -7888,7 +7181,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b08 834.6 nm", "proj:bbox": [ 600000.0, @@ -7968,7 +7260,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b09 947.2 nm", "proj:bbox": [ 600000.0, @@ -8048,7 +7339,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b11 1612.0 nm", "proj:bbox": [ 600000.0, @@ -8128,7 +7418,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b12 2191.3 nm", "proj:bbox": [ 600000.0, @@ -8208,7 +7497,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b8a 865.6 nm", "proj:bbox": [ 600000.0, @@ -8284,53 +7572,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -8413,7 +7654,6 @@ }, "r20m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32629", "spatial:bbox": [ 600000.0, @@ -8460,7 +7700,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b01 444.2 nm", "proj:bbox": [ 600000.0, @@ -8563,7 +7802,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b02 489.0 nm", "proj:bbox": [ 600000.0, @@ -8666,7 +7904,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b03 560.6 nm", "proj:bbox": [ 600000.0, @@ -8769,7 +8006,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b04 666.5 nm", "proj:bbox": [ 600000.0, @@ -8872,7 +8108,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b05 707.1 nm", "proj:bbox": [ 600000.0, @@ -8975,7 +8210,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b06 741.1 nm", "proj:bbox": [ 600000.0, @@ -9078,7 +8312,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b07 784.7 nm", "proj:bbox": [ 600000.0, @@ -9181,7 +8414,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b08 834.6 nm", "proj:bbox": [ 600000.0, @@ -9284,7 +8516,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b11 1612.0 nm", "proj:bbox": [ 600000.0, @@ -9387,7 +8618,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b12 2191.3 nm", "proj:bbox": [ 600000.0, @@ -9490,7 +8720,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b8a 865.6 nm", "proj:bbox": [ 600000.0, @@ -9589,60 +8818,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -9725,7 +8900,6 @@ }, "r360m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32629", "spatial:bbox": [ 600000.0, @@ -9772,7 +8946,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b01 444.2 nm", "proj:bbox": [ 600000.0, @@ -9852,7 +9025,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b02 489.0 nm", "proj:bbox": [ 600000.0, @@ -9932,7 +9104,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b03 560.6 nm", "proj:bbox": [ 600000.0, @@ -10012,7 +9183,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b04 666.5 nm", "proj:bbox": [ 600000.0, @@ -10092,7 +9262,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b05 707.1 nm", "proj:bbox": [ 600000.0, @@ -10172,7 +9341,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b06 741.1 nm", "proj:bbox": [ 600000.0, @@ -10252,7 +9420,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b07 784.7 nm", "proj:bbox": [ 600000.0, @@ -10332,7 +9499,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b08 834.6 nm", "proj:bbox": [ 600000.0, @@ -10412,7 +9578,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b09 947.2 nm", "proj:bbox": [ 600000.0, @@ -10492,7 +9657,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b11 1612.0 nm", "proj:bbox": [ 600000.0, @@ -10572,7 +9736,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b12 2191.3 nm", "proj:bbox": [ 600000.0, @@ -10652,7 +9815,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b8a 865.6 nm", "proj:bbox": [ 600000.0, @@ -10728,53 +9890,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -10857,7 +9972,6 @@ }, "r60m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32629", "spatial:bbox": [ 600000.0, @@ -10904,7 +10018,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b01 444.2 nm", "proj:bbox": [ 600000.0, @@ -11007,7 +10120,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b02 489.0 nm", "proj:bbox": [ 600000.0, @@ -11110,7 +10222,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b03 560.6 nm", "proj:bbox": [ 600000.0, @@ -11213,7 +10324,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b04 666.5 nm", "proj:bbox": [ 600000.0, @@ -11316,7 +10426,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b05 707.1 nm", "proj:bbox": [ 600000.0, @@ -11419,7 +10528,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b06 741.1 nm", "proj:bbox": [ 600000.0, @@ -11522,7 +10630,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b07 784.7 nm", "proj:bbox": [ 600000.0, @@ -11625,7 +10732,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b08 834.6 nm", "proj:bbox": [ 600000.0, @@ -11728,7 +10834,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b09 947.2 nm", "proj:bbox": [ 600000.0, @@ -11831,7 +10936,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b11 1612.0 nm", "proj:bbox": [ 600000.0, @@ -11934,7 +11038,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b12 2191.3 nm", "proj:bbox": [ 600000.0, @@ -12037,7 +11140,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b8a 865.6 nm", "proj:bbox": [ 600000.0, @@ -12136,60 +11238,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -12272,7 +11320,6 @@ }, "r720m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32629", "spatial:bbox": [ 600000.0, @@ -12319,7 +11366,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b01 444.2 nm", "proj:bbox": [ 600000.0, @@ -12399,7 +11445,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b02 489.0 nm", "proj:bbox": [ 600000.0, @@ -12479,7 +11524,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b03 560.6 nm", "proj:bbox": [ 600000.0, @@ -12559,7 +11603,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b04 666.5 nm", "proj:bbox": [ 600000.0, @@ -12639,7 +11682,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b05 707.1 nm", "proj:bbox": [ 600000.0, @@ -12719,7 +11761,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b06 741.1 nm", "proj:bbox": [ 600000.0, @@ -12799,7 +11840,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b07 784.7 nm", "proj:bbox": [ 600000.0, @@ -12879,7 +11919,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b08 834.6 nm", "proj:bbox": [ 600000.0, @@ -12959,7 +11998,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b09 947.2 nm", "proj:bbox": [ 600000.0, @@ -13039,7 +12077,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b11 1612.0 nm", "proj:bbox": [ 600000.0, @@ -13119,7 +12156,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b12 2191.3 nm", "proj:bbox": [ 600000.0, @@ -13199,7 +12235,6 @@ "attributes": { "_FillValue": 0, "add_offset": -0.1, - "grid_mapping": "spatial_ref", "long_name": "BOA reflectance from MSI acquisition at spectral band b8a 865.6 nm", "proj:bbox": [ 600000.0, @@ -13275,53 +12310,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -13418,7 +12406,6 @@ "members": { "r10m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32629", "spatial:bbox": [ 600000.0, @@ -13463,7 +12450,6 @@ "members": { "aot": { "attributes": { - "grid_mapping": "spatial_ref", "proj:bbox": [ 600000.0, 4490220.0, @@ -13557,63 +12543,8 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "wvp": { "attributes": { - "grid_mapping": "spatial_ref", "proj:bbox": [ 600000.0, 4490220.0, @@ -13789,7 +12720,6 @@ }, "r20m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32629", "spatial:bbox": [ 600000.0, @@ -13834,7 +12764,6 @@ "members": { "aot": { "attributes": { - "grid_mapping": "spatial_ref", "proj:bbox": [ 600000.0, 4490220.0, @@ -13928,63 +12857,8 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "wvp": { "attributes": { - "grid_mapping": "spatial_ref", "proj:bbox": [ 600000.0, 4490220.0, @@ -14160,7 +13034,6 @@ }, "r60m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32629", "spatial:bbox": [ 600000.0, @@ -14205,7 +13078,6 @@ "members": { "aot": { "attributes": { - "grid_mapping": "spatial_ref", "proj:bbox": [ 600000.0, 4490220.0, @@ -14299,63 +13171,8 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "wvp": { "attributes": { - "grid_mapping": "spatial_ref", "proj:bbox": [ 600000.0, 4490220.0, @@ -14538,7 +13355,6 @@ "members": { "r10m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32629", "spatial:bbox": [ 600000.0, @@ -14594,7 +13410,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 600000.0, @@ -14699,7 +13514,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 600000.0, @@ -14804,7 +13618,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 600000.0, @@ -14909,7 +13722,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 600000.0, @@ -15001,60 +13813,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -15137,7 +13895,6 @@ }, "r20m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32629", "spatial:bbox": [ 600000.0, @@ -15193,7 +13950,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 600000.0, @@ -15298,7 +14054,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 600000.0, @@ -15403,7 +14158,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 600000.0, @@ -15508,7 +14262,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 600000.0, @@ -15613,7 +14366,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 600000.0, @@ -15718,7 +14470,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 600000.0, @@ -15810,60 +14561,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -15946,7 +14643,6 @@ }, "r60m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32629", "spatial:bbox": [ 600000.0, @@ -16002,7 +14698,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 600000.0, @@ -16107,7 +14802,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 600000.0, @@ -16212,7 +14906,6 @@ 128 ], "flag_meanings": "ANC_LOST ANC_DEG MSI_LOST MSI_DEG QT_DEFECTIVE_PIXELS QT_NODATA_PIXELS QT_PARTIALLY_CORRECTED_PIXELS QT_SATURATED_PIXELS_L1A", - "grid_mapping": "spatial_ref", "long_name": "quality mask provided in the final reference frame (ground geometry)", "proj:bbox": [ 600000.0, @@ -16304,60 +14997,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -16619,7 +15258,6 @@ "members": { "r120m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32629", "spatial:bbox": [ 600000.0, @@ -16665,7 +15303,6 @@ "cld": { "attributes": { "coordinates": "band", - "grid_mapping": "spatial_ref", "proj:bbox": [ 600000.0, 4490220.0, @@ -16736,7 +15373,6 @@ "snw": { "attributes": { "coordinates": "band", - "grid_mapping": "spatial_ref", "proj:bbox": [ 600000.0, 4490220.0, @@ -16804,53 +15440,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -16933,7 +15522,6 @@ }, "r20m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32629", "spatial:bbox": [ 600000.0, @@ -16979,7 +15567,6 @@ "cld": { "attributes": { "coordinates": "band", - "grid_mapping": "spatial_ref", "proj:bbox": [ 600000.0, 4490220.0, @@ -17073,7 +15660,6 @@ "snw": { "attributes": { "coordinates": "band", - "grid_mapping": "spatial_ref", "proj:bbox": [ 600000.0, 4490220.0, @@ -17164,60 +15750,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -17300,7 +15832,6 @@ }, "r360m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32629", "spatial:bbox": [ 600000.0, @@ -17346,7 +15877,6 @@ "cld": { "attributes": { "coordinates": "band", - "grid_mapping": "spatial_ref", "proj:bbox": [ 600000.0, 4490220.0, @@ -17417,7 +15947,6 @@ "snw": { "attributes": { "coordinates": "band", - "grid_mapping": "spatial_ref", "proj:bbox": [ 600000.0, 4490220.0, @@ -17485,53 +16014,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -17614,7 +16096,6 @@ }, "r60m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32629", "spatial:bbox": [ 600000.0, @@ -17660,7 +16141,6 @@ "cld": { "attributes": { "coordinates": "band", - "grid_mapping": "spatial_ref", "proj:bbox": [ 600000.0, 4490220.0, @@ -17754,7 +16234,6 @@ "snw": { "attributes": { "coordinates": "band", - "grid_mapping": "spatial_ref", "proj:bbox": [ 600000.0, 4490220.0, @@ -17845,53 +16324,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" @@ -17974,7 +16406,6 @@ }, "r720m": { "attributes": { - "grid_mapping": "spatial_ref", "proj:code": "EPSG:32629", "spatial:bbox": [ 600000.0, @@ -18020,7 +16451,6 @@ "cld": { "attributes": { "coordinates": "band", - "grid_mapping": "spatial_ref", "proj:bbox": [ 600000.0, 4490220.0, @@ -18091,7 +16521,6 @@ "snw": { "attributes": { "coordinates": "band", - "grid_mapping": "spatial_ref", "proj:bbox": [ 600000.0, 4490220.0, @@ -18159,53 +16588,6 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - } - ], - "data_type": "int64", - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "x": { "attributes": { "_FillValue": "AAAAAAAA+H8=" diff --git a/tests/_test_data/optimized_olci_examples/S3A_OL_1_EFR____20251101T073957_20251101T074257_20251102T084255_0179_132_149_2160_PS1_O_NT_004-epsg4326.json b/tests/_test_data/optimized_olci_examples/S3A_OL_1_EFR____20251101T073957_20251101T074257_20251102T084255_0179_132_149_2160_PS1_O_NT_004-epsg4326.json index c0924b7e..4d07a152 100644 --- a/tests/_test_data/optimized_olci_examples/S3A_OL_1_EFR____20251101T073957_20251101T074257_20251102T084255_0179_132_149_2160_PS1_O_NT_004-epsg4326.json +++ b/tests/_test_data/optimized_olci_examples/S3A_OL_1_EFR____20251101T073957_20251101T074257_20251102T084255_0179_132_149_2160_PS1_O_NT_004-epsg4326.json @@ -4343,7 +4343,6 @@ "altitude": { "attributes": { "_FillValue": 32767, - "coordinates": "spatial_ref", "dimensions": [ "rows", "columns" @@ -4352,7 +4351,6 @@ "eopf_is_masked": true, "eopf_target_dtype": " None: # and a level without `time` cannot be selected by datetime. This assertion used to # demand the opposite -- it was written against a fixture that predated #192, and it is # the reason a writer/model mismatch survived in the suite. - for coord in ("time", "x", "y", "spatial_ref"): + for coord in ("time", "x", "y"): assert coord in group.members, f"{level} is missing the {coord!r} coordinate" @@ -166,8 +166,8 @@ def test_s1_rtc_rejects_conditions_without_condition_arrays( """ data = copy.deepcopy(s1_rtc_json_example) cond_members = _nav(data, "members", "descending", "members", "conditions", "members") - kept = {name: spec for name, spec in cond_members.items() if name in ("x", "y", "spatial_ref")} - assert set(kept) == {"x", "y", "spatial_ref"}, "fixture lost its conditions coordinates" + kept = {name: spec for name, spec in cond_members.items() if name in ("x", "y")} + assert set(kept) == {"x", "y"}, "fixture lost its conditions coordinates" kept["some_other"] = next(iter(cond_members.values())) _nav(data, "members", "descending", "members", "conditions")["members"] = kept with pytest.raises(Exception, match="at least one condition array"): @@ -272,10 +272,10 @@ def test_ingested_store_validates(self, tmp_path: Path, condition_kwargs: list[s for level in ("r10m", "r20m", "r60m", "r120m", "r360m", "r720m"): group = model.ascending.get_resolution(level) assert group is not None, f"missing level {level}" - for coord in ("time", "x", "y", "spatial_ref"): + for coord in ("time", "x", "y"): assert coord in group.members, f"{level} lost {coord!r}" - @pytest.mark.parametrize("coordinate", ["time", "x", "y", "spatial_ref"]) + @pytest.mark.parametrize("coordinate", ["time", "x", "y"]) def test_overview_missing_coordinate_is_rejected(self, tmp_path: Path, coordinate: str) -> None: """Deleting a coordinate from one overview level must fail validation. @@ -354,7 +354,7 @@ def _split(members: set[str]) -> tuple[set[str], set[str]]: assert ingested_conditions <= fixture_conditions -@pytest.mark.parametrize("coordinate", ["time", "x", "y", "spatial_ref"]) +@pytest.mark.parametrize("coordinate", ["time", "x", "y"]) def test_native_missing_coordinate_is_rejected( s1_rtc_json_example: dict[str, object], coordinate: str ) -> None: @@ -369,7 +369,7 @@ def test_native_missing_coordinate_is_rejected( S1RtcRoot.model_validate(data) -@pytest.mark.parametrize("coordinate", ["x", "y", "spatial_ref"]) +@pytest.mark.parametrize("coordinate", ["x", "y"]) def test_conditions_missing_coordinate_is_rejected( s1_rtc_json_example: dict[str, object], coordinate: str ) -> None: @@ -383,3 +383,19 @@ def test_conditions_missing_coordinate_is_rejected( del _nav(data, "members", "descending", "members", "conditions", "members")[coordinate] with pytest.raises(Exception, match="coordinate arrays"): S1RtcRoot.model_validate(data) + + +def test_store_ingested_with_a_cf_grid_mapping_still_validates( + s1_rtc_json_example: dict[str, object], +) -> None: + """ + The ingester no longer writes the CF `spatial_ref` grid mapping (#352), and the + model no longer requires it, but a store ingested before still holds it: the + model accepts it on the levels and in the conditions group. + """ + data = copy.deepcopy(s1_rtc_json_example) + for group in ("r10m", "r60m", "conditions"): + members = _nav(data, "members", "descending", "members", group, "members") + assert "spatial_ref" not in members, "the fixture is written without a grid mapping" + members["spatial_ref"] = copy.deepcopy(members["x"]) + S1RtcRoot.model_validate(data) diff --git a/tests/test_data_api/test_s2_plan.py b/tests/test_data_api/test_s2_plan.py index 27d511e7..673a2e7e 100644 --- a/tests/test_data_api/test_s2_plan.py +++ b/tests/test_data_api/test_s2_plan.py @@ -13,7 +13,6 @@ from pydantic import ValidationError from pydantic_zarr.v2 import GroupSpec as GroupSpecV2 from pydantic_zarr.v3 import GroupSpec as GroupSpecV3 -from pyproj import CRS from eopf_geozarr.data_api.s2 import Sentinel2Root from eopf_geozarr.data_api.s2_plan import ( @@ -71,9 +70,10 @@ def test_plan_matches_snapshot(path: pathlib.Path) -> None: def test_plan_georeferencing_is_self_consistent(path: pathlib.Path) -> None: """ Every planned level's spatial attributes derive from the product's own - band attributes: the transform is the level resolution over the finest - band's origin, the bbox is the transform applied to the level shape, and - the grid-mapping array holds the band's own CRS. + band attributes: the CRS is the band's own, the transform is the level + resolution over the finest band's origin, and the bbox is the transform + applied to the level shape. `proj:code` is the only CRS statement: there + is no grid-mapping array (#352). """ planned = _planned_reflectance(path) finest = planned["members"][f"r{REFLECTANCE_SCALE_LEVELS[0]}m"] @@ -95,8 +95,7 @@ def test_plan_georeferencing_is_self_consistent(path: pathlib.Path) -> None: x0 + cols * meters, y0, ] - crs = CRS.from_wkt(level["members"]["spatial_ref"]["attributes"]["crs_wkt"]) - assert crs.to_epsg() == epsg + assert "spatial_ref" not in level["members"] def _groups(node: dict[str, Any], path: str = "") -> list[tuple[str, dict[str, Any]]]: @@ -444,6 +443,21 @@ def test_plan_carries_an_ungeoreferenceable_grid_without_georeferencing( assert "proj:code" not in attributes +@pytest.mark.parametrize("path", _INPUT_PATHS, ids=lambda p: p.stem[:26]) +def test_plan_writes_no_cf_grid_mapping(path: pathlib.Path) -> None: + """`proj` and `spatial` are the only georeferencing: no group or array has + a `grid_mapping` attribute and there is no `spatial_ref` array (#352).""" + planned = _planned_root(path) + with_grid_mapping = [ + node_path + for node_path, node in [*_groups(planned), *_arrays(planned)] + if "grid_mapping" in node["attributes"] + ] + spatial_refs = [p for p, _ in _arrays(planned) if p.endswith("/spatial_ref")] + assert with_grid_mapping == [] + assert spatial_refs == [] + + def test_plan_reflectance_requires_product_georeferencing() -> None: """A product whose bands carry no proj attributes and whose stac_discovery declares none is refused with a ValueError, not a KeyError.""" diff --git a/tests/test_data_api/test_s2_write.py b/tests/test_data_api/test_s2_write.py index 0efef872..4f7c8f94 100644 --- a/tests/test_data_api/test_s2_write.py +++ b/tests/test_data_api/test_s2_write.py @@ -212,8 +212,8 @@ def read(group: zarr.Group, path: str) -> np.ndarray: x_generated, x_native[: x_generated.shape[0] * 2].reshape(-1, 2).mean(axis=1) ) - # grid-mapping arrays hold zero - assert read(output, "measurements/reflectance/r120m/spatial_ref") == 0 + # no CF grid-mapping array is written: proj:code is the CRS (#352) + assert "spatial_ref" not in output["measurements/reflectance/r120m"] @pytest.mark.parametrize("factor", [2, 3]) diff --git a/tests/test_geozarr_output_contract.py b/tests/test_geozarr_output_contract.py index 5e53c944..58311f11 100644 --- a/tests/test_geozarr_output_contract.py +++ b/tests/test_geozarr_output_contract.py @@ -319,10 +319,25 @@ def walk(group: zarr.Group, path: str) -> None: return found +#: Products whose converter still writes the CF grid mapping of GeoZarr V0: +#: the generic converter (`create_geozarr_dataset`), which #352 leaves as it is. +#: Every other converter declares the CRS with the proj convention only. +_CF_GRID_MAPPING_PRODUCTS = frozenset({"s1", "s2"}) + +_RIOXARRAY_PROJ_NAME = ( + "rioxarray (0.23, 0.24 and its main branch) recognizes the proj convention only under the " + "name 'proj:', while the proj v0.1 spec and zarr-cm name it 'proj'; with no CF grid mapping " + "in the output (#352), rioxarray resolves no CRS. Strict, so this fails once a rioxarray " + "release reads the spec's name: then drop the marker." +) + + def test_every_level_is_regular_grid_with_crs( converted_store: tuple[pathlib.Path, str], ) -> None: - """Hard requirement: each pyramid level is a regular grid with a real CRS.""" + """Hard requirement: each pyramid level is a regular grid with a real CRS. A + converter without the CF grid mapping declares it with the proj convention, + its only georeferencing (#352).""" store, name = converted_store levels = _multiscale_level_paths(store) assert levels, f"{name}: no multiscale groups found in {store}" @@ -330,10 +345,16 @@ def test_every_level_is_regular_grid_with_crs( ds = xr.open_dataset( str(store), group=level, engine="zarr", consolidated=False, decode_coords="all" ) - crs = ds.rio.crs - assert crs is not None, f"{name}:{level}: no CRS declared" - # CRS round-trips through pyproj - ProjCRS.from_user_input(crs.to_wkt()) + if name in _CF_GRID_MAPPING_PRODUCTS: + crs = ds.rio.crs + assert crs is not None, f"{name}:{level}: no CRS declared" + code = crs.to_wkt() + else: + code = ds.attrs.get("proj:code") + assert isinstance(code, str), f"{name}:{level}: no CRS declared" + assert "spatial_ref" not in ds.variables, f"{name}:{level}: CF grid mapping written" + # the CRS resolves through pyproj + ProjCRS.from_user_input(code) for dim in ("y", "x"): assert dim in ds.sizes, f"{name}:{level}: missing spatial dim {dim}" coord = ds[dim] @@ -376,3 +397,18 @@ def test_olci_native_store_opens_with_swath_geolocation( assert ds["longitude"].dims == ("rows", "columns") assert "spatial_ref" not in ds.variables assert ds.rio.crs is None + + +def test_rioxarray_resolves_the_level_crs( + converted_store: tuple[pathlib.Path, str], request: pytest.FixtureRequest +) -> None: + """rioxarray resolves each pyramid level's CRS. It does from the CF grid + mapping, and not yet from the proj convention alone (strict xfail).""" + store, name = converted_store + if name not in _CF_GRID_MAPPING_PRODUCTS: + request.applymarker(pytest.mark.xfail(strict=True, reason=_RIOXARRAY_PROJ_NAME)) + for level in _multiscale_level_paths(store): + ds = xr.open_dataset( + str(store), group=level, engine="zarr", consolidated=False, decode_coords="all" + ) + assert ds.rio.crs is not None, f"{name}:{level}: rioxarray resolves no CRS" diff --git a/tests/test_olci_integration.py b/tests/test_olci_integration.py index 60524f9a..ebf7cb77 100644 --- a/tests/test_olci_integration.py +++ b/tests/test_olci_integration.py @@ -226,18 +226,18 @@ def test_convert_olci_regridded_output_opens_as_datatree(tmp_path: object) -> No assert set(r0.sizes) == {"y", "x"} for i in range(1, 22): assert f"oa{i:02d}_radiance" in r0 - # CRS declared at every level, 1-D regular coordinates + # CRS declared at every level with the proj convention (the only + # georeferencing, #352), 1-D regular coordinates for level in ("r0", "r2", "r4"): ds = opened[f"/measurements/{level}"].to_dataset() - assert ds.rio.crs is not None, f"{level}: no CRS" - assert ds.rio.crs.to_epsg() == 4326 + assert ds.attrs.get("proj:code") == "EPSG:4326", f"{level}: no CRS" for dim in ("y", "x"): coord = ds[dim] assert coord.ndim == 1 steps = np.diff(coord.values) assert np.allclose(steps, steps[0]) - band = ds["oa01_radiance"] - assert band.attrs["grid_mapping"] == "spatial_ref" + assert "spatial_ref" not in ds.variables + assert "grid_mapping" not in ds["oa01_radiance"].attrs # halving structure relative to observed r0 r2 = opened["/measurements/r2"].to_dataset() assert r2.sizes["y"] == r0.sizes["y"] // 2 diff --git a/tests/test_olci_reproject.py b/tests/test_olci_reproject.py index d985890e..bc9b9f52 100644 --- a/tests/test_olci_reproject.py +++ b/tests/test_olci_reproject.py @@ -63,11 +63,12 @@ def test_reproject_olci_produces_regular_grid_with_crs() -> None: # y descends (north-up grid) assert out["y"].values[0] > out["y"].values[-1] - # CRS declared in both idioms + # rioxarray's CRS stays on the in-memory dataset for the computations + # downstream; no `grid_mapping` attribute is pinned, and the converter strips + # the CF grid mapping before writing (#352) assert out.rio.crs is not None assert out.rio.crs.to_epsg() == 4326 - assert "spatial_ref" in out.coords or "spatial_ref" in out.variables - assert out["oa01_radiance"].attrs["grid_mapping"] == "spatial_ref" + assert "grid_mapping" not in out["oa01_radiance"].attrs # dtype and CF scaling preserved; fill recorded band = out["oa01_radiance"] @@ -145,7 +146,7 @@ def test_reproject_olci_projected_target_crs() -> None: assert coord.attrs["units"] == "m" band = out["oa01_radiance"] assert band.dtype == np.dtype("uint16") - assert band.attrs["grid_mapping"] == "spatial_ref" + assert "grid_mapping" not in band.attrs def test_reproject_olci_unpacks_cf_packed_geolocation() -> None: diff --git a/tests/test_s1_rtc_ingest.py b/tests/test_s1_rtc_ingest.py index a0cba7fc..4eb8a645 100644 --- a/tests/test_s1_rtc_ingest.py +++ b/tests/test_s1_rtc_ingest.py @@ -324,28 +324,19 @@ def test_no_tile_matrix_set( assert "tile_matrix_set" not in ms assert "layout" in ms - def test_cf_grid_mapping_resolves_crs( + def test_crs_is_declared_with_proj_only( self, s1_store_path: Path, sample_metadata: S1TilingMetadata ) -> None: - # Each resolution level carries a CF spatial_ref grid-mapping so rioxarray (and - # TiTiler's GeoZarr reader) can resolve the CRS -- the geozarr proj:code attr - # alone is not read by rioxarray. - import rioxarray # noqa: F401 -- registers the .rio accessor - + # Each resolution level declares its CRS with the proj convention, the only + # georeferencing: no CF spatial_ref grid mapping is written (#352). rioxarray does not + # yet read the spec's convention name, so it resolves no CRS from this alone. create_s1_store(s1_store_path, "ascending", sample_metadata) root = zarr.open_group(str(s1_store_path), mode="r", zarr_format=3) r10m = _group(_group(root, "ascending"), "r10m") - assert "spatial_ref" in list(r10m.array_keys()) - assert dict(_array(r10m, "vv").attrs).get("grid_mapping") == "spatial_ref" - assert dict(_array(r10m, "vh").attrs).get("grid_mapping") == "spatial_ref" - - ds = xr.open_zarr( - str(s1_store_path / "ascending" / "r10m"), - consolidated=False, - decode_coords="all", - ) - assert ds.rio.crs is not None - assert ds.rio.crs.to_epsg() == 32633 + assert dict(r10m.attrs)["proj:code"] == "EPSG:32633" + assert "spatial_ref" not in list(r10m.array_keys()) + assert "grid_mapping" not in dict(_array(r10m, "vv").attrs) + assert "grid_mapping" not in dict(_array(r10m, "vh").attrs) def test_coordinate_variables( self, s1_store_path: Path, sample_metadata: S1TilingMetadata @@ -892,9 +883,9 @@ def test_conditions_group_attributes( assert isinstance(transform, list) assert len(transform) == 6 assert attrs["spatial:shape"] == [SIZE, SIZE] - # CF grid-mapping so rioxarray can resolve the CRS of the condition arrays - assert "spatial_ref" in list(conditions.array_keys()) - assert dict(_array(conditions, "gamma_area_037").attrs).get("grid_mapping") == "spatial_ref" + # the proj convention is the only georeferencing: no CF grid mapping (#352) + assert "spatial_ref" not in list(conditions.array_keys()) + assert "grid_mapping" not in dict(_array(conditions, "gamma_area_037").attrs) def test_gamma_area_array_shape_and_dtype( self, s1_store_with_acquisition: Path, gamma_area_geotiff: Path @@ -2179,7 +2170,7 @@ def test_repair_is_visible_through_the_consolidated_view(self, tmp_path: Path) - root = zarr.open_group(str(store), mode="r", zarr_format=3) conditions = _group(_group(root, "ascending"), "conditions") members = set(conditions) - for coord in ("x", "y", "spatial_ref"): + for coord in ("x", "y"): assert coord in members, f"{coord} is missing from the consolidated view: {members}" assert "gamma_area_008" in members, "the newly written raster is absent from the view" @@ -2205,14 +2196,9 @@ def test_repaired_store_accepts_a_further_conditions_call(self, tmp_path: Path) conditions = _group(_group(root, "ascending"), "conditions") assert {"gamma_area_008", "gamma_area_009", "x", "y"} <= set(conditions) - def test_every_condition_array_gets_its_grid_mapping(self, tmp_path: Path) -> None: - """A raster created during the same call must not miss `grid_mapping`. - - `_add_grid_mapping` enumerates `group.arrays()`; resolved through a stale block that - enumeration omitted the array just written, so `gamma_area_008` shipped with no CRS - while its sibling on the identical grid had one -- silently, with no error or warning. - rioxarray and TiTiler resolve the CRS through `grid_mapping` -> `spatial_ref`. - """ + def test_condition_arrays_take_the_group_crs(self, tmp_path: Path) -> None: + """Every condition array, the one written in the same call included, is georeferenced + by the group's `proj:code`: none carries a CF `grid_mapping` (#352).""" store = self._store_with_legacy_conditions(tmp_path) gamma = tmp_path / "GAMMA_AREA_32TQM_037.tif" @@ -2225,11 +2211,9 @@ def test_every_condition_array_gets_its_grid_mapping(self, tmp_path: Path) -> No root = zarr.open_group(str(store), mode="r", zarr_format=3) conditions = _group(_group(root, "ascending"), "conditions") - for name in ("gamma_area_037", "gamma_area_008"): - attrs = dict(_array(conditions, name).attrs) - assert attrs.get("grid_mapping") == "spatial_ref", ( - f"{name} has no grid_mapping, so it opens with no CRS: {sorted(attrs)}" - ) + assert "proj:code" in dict(conditions.attrs) + attrs = dict(_array(conditions, "gamma_area_008").attrs) + assert "grid_mapping" not in attrs, f"gamma_area_008 carries a grid mapping: {attrs}" def test_half_repaired_group_is_completed_not_rejected(self, tmp_path: Path) -> None: """Only the missing coordinate is created. diff --git a/tests/test_s2_multiscale_geo_metadata.py b/tests/test_s2_multiscale_geo_metadata.py index 14d158d2..fc200508 100644 --- a/tests/test_s2_multiscale_geo_metadata.py +++ b/tests/test_s2_multiscale_geo_metadata.py @@ -95,10 +95,9 @@ def test_write_dataset_geo_metadata_with_rio_crs( # Call the method result = write_dataset_geo_metadata(sample_dataset_with_crs) - # Verify CRS was written - assert hasattr(result, "rio") - assert result.rio.crs is not None - assert result.rio.crs.to_epsg() == 32632 + # The CRS is declared with the proj convention only (#352) + assert result.attrs["proj:code"] == "EPSG:32632" + assert "spatial_ref" not in result.variables def test_write_dataset_geo_metadata_with_epsg_attrs( self, sample_dataset_with_epsg_attrs: xr.Dataset @@ -114,10 +113,8 @@ def test_write_dataset_geo_metadata_with_epsg_attrs( # Call the method result = write_dataset_geo_metadata(sample_dataset_with_epsg_attrs) - # Verify CRS was written from attributes - assert hasattr(result, "rio") - assert result.rio.crs is not None - assert result.rio.crs.to_epsg() == 32632 + # The CRS read from the attributes is declared with the proj convention + assert result.attrs["proj:code"] == "EPSG:32632" def test_write_dataset_geo_metadata_no_crs(self, sample_dataset_no_crs: xr.Dataset) -> None: """Test _write_dataset_geo_metadata with dataset that has no CRS information.""" @@ -131,18 +128,16 @@ def test_write_dataset_geo_metadata_no_crs(self, sample_dataset_no_crs: xr.Datas # Verify no CRS was added (method handles gracefully) assert result.rio.crs is None - def test_write_dataset_geo_metadata_custom_grid_mapping_name( + def test_write_dataset_geo_metadata_writes_no_cf_grid_mapping( self, sample_dataset_with_crs: xr.Dataset ) -> None: - """Test _write_dataset_geo_metadata with custom grid_mapping variable name.""" - - # Call the method with custom grid mapping name - custom_name = "custom_spatial_ref" - result = write_dataset_geo_metadata(sample_dataset_with_crs, custom_name) + """The proj and spatial conventions are the only georeferencing written: no + `spatial_ref` variable and no `grid_mapping` attribute (#352).""" + result = write_dataset_geo_metadata(sample_dataset_with_crs) - # Verify CRS was written - assert hasattr(result, "rio") - assert result.rio.crs is not None + assert "spatial_ref" not in result.variables + assert "grid_mapping" not in result.attrs + assert all("grid_mapping" not in result[name].attrs for name in result.data_vars) def test_write_dataset_geo_metadata_preserves_existing_data( self, sample_dataset_with_crs: xr.Dataset @@ -245,15 +240,16 @@ def test_write_dataset_geo_metadata_integration_with_stream_write(self, tmp_path add_geo_metadata=True, ) - # Re-open the written dataset to verify CRS was persisted + # Re-open the written dataset to verify the CRS was persisted written_ds = xr.open_dataset( tmp_path, engine="zarr", chunks={}, decode_coords="all", group=dataset_path ) - # Verify CRS was written and persisted - assert hasattr(written_ds, "rio") - assert written_ds.rio.crs is not None - assert written_ds.rio.crs.to_epsg() == 32632 + # The CRS persists as the proj convention; the CF grid mapping the input + # carried (rio.write_crs) is not written (#352) + assert written_ds.attrs["proj:code"] == "EPSG:32632" + assert "spatial_ref" not in written_ds.variables + assert "grid_mapping" not in written_ds["b02"].attrs def test_write_dataset_geo_metadata_prefers_coordinate_transform_for_inconsistent_rio( self, From 85e48193274a6e048d34c7e5fd3c1d08cd701803 Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Fri, 13 Nov 2026 20:47:20 +0100 Subject: [PATCH 28/45] fix(s2-plan): normalize bbox longitudes by whole turns Addresses roborev's finding on 85366f4. Moving a longitude by one turn left a value more than one turn out of range past 180. That happens when a wide 0-360 grid starts above 180 and wraps past 0. Longitudes outside [-180, 180] are now normalized modulo 360. In-range values, the antimeridian's 180 included, are kept as written. A test covers a wide 0-360 grid. Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 --- src/eopf_geozarr/data_api/s2_plan.py | 12 ++++++------ tests/test_data_api/test_s2_plan.py | 16 +++++++++++++++- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/eopf_geozarr/data_api/s2_plan.py b/src/eopf_geozarr/data_api/s2_plan.py index 04438cfc..ca70d523 100644 --- a/src/eopf_geozarr/data_api/s2_plan.py +++ b/src/eopf_geozarr/data_api/s2_plan.py @@ -605,12 +605,12 @@ def _carried_group_attributes(group: Mapping[str, Any]) -> dict[str, object]: def _in_longitude_range(longitude: float) -> float: - """`longitude` moved by a turn into [-180, 180] when outside it, else as it is.""" - if longitude > 180.0: - return longitude - 360.0 - if longitude < -180.0: - return longitude + 360.0 - return longitude + """`longitude` moved by whole turns into [-180, 180] when outside it, else as it is.""" + if -180.0 <= longitude <= 180.0: + return longitude + wrapped = (longitude + 180.0) % 360.0 - 180.0 + # a positive multiple of 180 lands on the antimeridian's eastern spelling + return 180.0 if wrapped == -180.0 and longitude > 0 else wrapped def _lat_lon_attributes(latitude: np.ndarray, longitude: np.ndarray) -> LatLonGroupAttrs: diff --git a/tests/test_data_api/test_s2_plan.py b/tests/test_data_api/test_s2_plan.py index 673a2e7e..0b7cde74 100644 --- a/tests/test_data_api/test_s2_plan.py +++ b/tests/test_data_api/test_s2_plan.py @@ -324,13 +324,27 @@ def test_plan_stores_labels_as_registered_strings(path: pathlib.Path) -> None: "spatial:transform": [0.25, 0.0, 179.5, 0.0, -0.5, 10.0], }, ), + ( + [10.0, 9.5], + [300.0, 330.0, 0.0, 30.0, 60.0, 90.0, 120.0, 150.0, 180.0, 210.0], + { + "spatial:bbox": [-60.0, 9.5, -150.0, 10.0], + "spatial:transform": [30.0, 0.0, 300.0, 0.0, -0.5, 10.0], + }, + ), ( np.linspace(48.0, 44.8, 9, dtype="float32").tolist(), np.linspace(8.0, 11.2, 9, dtype="float32").tolist(), {"spatial:shape": [9, 9]}, ), ], - ids=["latitude-decreasing", "latitude-increasing", "antimeridian", "float32-rounding"], + ids=[ + "latitude-decreasing", + "latitude-increasing", + "antimeridian", + "wide-0-360-grid", + "float32-rounding", + ], ) def test_lat_lon_attributes( latitude: list[float], longitude: list[float], expected: dict[str, object] From 2d8e58a9312861f0008ec0478b7d82b475bb5497 Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Fri, 13 Nov 2026 20:58:10 +0100 Subject: [PATCH 29/45] fix(conversion): carry a grid mapping's CRS over before stripping it Addresses roborev's findings on 3c881ac. - `stream_write_dataset` stripped the CF grid mapping even when it added no `proj` attributes. That is the case for the generic rechunker, so an input whose CRS lived only in the grid mapping was written with no CRS. `strip_cf_grid_mapping` now carries the CRS over as the `proj` convention attributes when the dataset declares no `proj:*` attribute. It drops a `spatial_ref` variable only when that variable is a grid mapping. - The CRS parameters of `write_dataset_geo_metadata` and `stream_write_dataset` take a string or EPSG code, matching what the code accepts. - The changelog and architecture docs say that the generic converter still writes the grid mapping, and that rioxarray does not yet read the proj convention under its spec name. Tests cover the strip helper (CRS carried over, a declared `proj:code` kept, an unrelated `spatial_ref` kept) and a stream write of a grid-mapped input. Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 18 +++++--- docs/architecture.md | 15 ++++--- src/eopf_geozarr/conversion/utils.py | 40 ++++++++++++----- tests/test_s2_multiscale_geo_metadata.py | 55 ++++++++++++++++++++++++ 4 files changed, 105 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b502db1..9618ece9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,13 +9,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Breaking -* The output's only georeferencing is the `proj` and `spatial` conventions. - The CF grid mapping of GeoZarr V0 is obsolete and no longer written, by the - S2, S1 RTC and OLCI converters and the shared write path: no `spatial_ref` - arrays (with `crs_wkt` / `spatial_ref` attributes) and no `grid_mapping` - attributes. An array opened on its own has no CRS; read `proj:code` from its - group. Stores written before are still read - ([#352](https://github.com/EOPF-Explorer/data-model/issues/352)). +* The S2, S1 RTC and OLCI converters and the shared write path no longer write + the CF grid mapping of GeoZarr V0: no `spatial_ref` arrays (with `crs_wkt` / + `spatial_ref` attributes) and no `grid_mapping` attributes. Their only + georeferencing is the `proj` and `spatial` conventions; an input's grid + mapping is carried over as `proj:code`. An array opened on its own has no + CRS; read `proj:code` from its group. Stores written before are still read. + The generic converter (`create_geozarr_dataset`) still writes the grid + mapping ([#352](https://github.com/EOPF-Explorer/data-model/issues/352)). +* This breaks CRS resolution in rioxarray as released (0.23 and 0.24): it + recognizes the proj convention only under the name `"proj:"`, while the proj + v0.1 spec names it `"proj"`, so `ds.rio.crs` is `None` for this output. ## 0.12.0 (2026-09-28) diff --git a/docs/architecture.md b/docs/architecture.md index 69e0e959..1002dfcc 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -196,7 +196,8 @@ output.zarr/ │ │ │ ├── b04/ │ │ │ ├── b08/ │ │ │ ├── x/ # X coordinates -│ │ │ └── y/ # Y coordinates +│ │ │ ├── y/ # Y coordinates +│ │ │ └── spatial_ref/ # CF grid mapping (generic converter only) │ │ ├── 1/ # Overview level 1 (/2) │ │ └── 2/ # Overview level 2 (/4) │ ├── r20m/ # 20m resolution group @@ -353,10 +354,14 @@ Each dataset group declares its CRS with the [proj convention](https://github.com/zarr-conventions/proj) (`proj:code`), and its grid with the [spatial convention](https://github.com/zarr-conventions/spatial) (`spatial:transform`, `spatial:shape`, `spatial:bbox`). These are the only -georeferencing: the CF grid mapping of GeoZarr V0 (a `spatial_ref` variable -holding `crs_wkt`, referenced by `grid_mapping` attributes) is obsolete and no -longer written ([#352](https://github.com/EOPF-Explorer/data-model/issues/352)). -An array opened on its own has no CRS; read `proj:code` from its group. +georeferencing of the S2, S1 RTC and OLCI converters: the CF grid mapping of +GeoZarr V0 (a `spatial_ref` variable holding `crs_wkt`, referenced by +`grid_mapping` attributes) is obsolete and no longer written by them +([#352](https://github.com/EOPF-Explorer/data-model/issues/352)). The generic +converter (`create_geozarr_dataset`), whose layout is shown above, still writes +it. An array opened on its own has no CRS; read `proj:code` from its group. +rioxarray (0.23, 0.24) does not yet read the proj convention under its spec +name, `"proj"`, so it resolves no CRS from these groups. ### 3. Multiscales Metadata diff --git a/src/eopf_geozarr/conversion/utils.py b/src/eopf_geozarr/conversion/utils.py index a51d3cc5..f9641b7a 100644 --- a/src/eopf_geozarr/conversion/utils.py +++ b/src/eopf_geozarr/conversion/utils.py @@ -360,23 +360,41 @@ def strip_cf_grid_mapping(dataset: xr.Dataset) -> xr.Dataset: input is not modified (EOPF-Explorer/data-model#352). The `proj` and `spatial` conventions are the output's only georeferencing, - so the grid-mapping variables (`spatial_ref`, and any variable a - `grid_mapping` attribute or encoding names) are dropped, and - `grid_mapping` is removed from the dataset's attributes and from every - variable's attributes and encoding. rioxarray's `write_crs` adds them, so - a dataset that was reprojected through rioxarray needs this before it is - written. + so the grid-mapping variables (any variable a `grid_mapping` attribute or + encoding names, and a `spatial_ref` variable holding CF grid-mapping + attributes) are dropped, and `grid_mapping` is removed from the dataset's + attributes and from every variable's attributes and encoding. rioxarray's + `write_crs` adds them, so a dataset that was reprojected through rioxarray + needs this before it is written. + + The CRS is not lost: when the dataset declares no `proj:*` attribute, the + grid mapping's CRS is carried over as the `proj` convention attributes + before the grid mapping is dropped. """ - names = {"spatial_ref"} + names: set[str] = set() + reference = dataset.variables.get("spatial_ref") + if reference is not None and not {"crs_wkt", "grid_mapping_name", "spatial_ref"}.isdisjoint( + reference.attrs + ): + names.add("spatial_ref") for holder in (dataset.attrs, *(v.attrs for v in dataset.variables.values())): if isinstance(holder.get("grid_mapping"), str): names.add(holder["grid_mapping"]) for variable in dataset.variables.values(): if isinstance(variable.encoding.get("grid_mapping"), str): names.add(variable.encoding["grid_mapping"]) - out = dataset.drop_vars([name for name in names if name in dataset.variables]) + names = {name for name in names if name in dataset.variables} + carried: dict[str, Any] = {} + if names and not any(str(key).startswith("proj:") for key in dataset.attrs): + crs = dataset.rio.crs + if crs is not None: + carried = dict(build_convention_attrs(spatial=None, crs=CRS.from_user_input(crs))) + out = dataset.drop_vars(sorted(names)) out = out.copy(deep=False) - out.attrs = {key: value for key, value in out.attrs.items() if key != "grid_mapping"} + out.attrs = { + **{key: value for key, value in out.attrs.items() if key != "grid_mapping"}, + **carried, + } for variable in out.variables.values(): variable.attrs = {k: v for k, v in variable.attrs.items() if k != "grid_mapping"} variable.encoding = {k: v for k, v in variable.encoding.items() if k != "grid_mapping"} @@ -385,7 +403,7 @@ def strip_cf_grid_mapping(dataset: xr.Dataset) -> xr.Dataset: def write_dataset_geo_metadata( dataset: xr.Dataset, - crs: CRS | None = None, + crs: CRS | str | int | None = None, ) -> xr.Dataset: """ Return a copy of the dataset with geographic metadata added; `dataset` is not modified. @@ -458,7 +476,7 @@ def stream_write_dataset( encoding: dict[str, XarrayDataArrayEncoding], add_geo_metadata: bool = False, chunk_and_shard_coords: bool = True, - crs: CRS | None = None, + crs: CRS | str | int | None = None, ) -> xr.Dataset: """ Stream write a lazy dataset with advanced chunking and sharding. diff --git a/tests/test_s2_multiscale_geo_metadata.py b/tests/test_s2_multiscale_geo_metadata.py index fc200508..6098914f 100644 --- a/tests/test_s2_multiscale_geo_metadata.py +++ b/tests/test_s2_multiscale_geo_metadata.py @@ -18,6 +18,7 @@ _rechunk_ds, create_uniform_encoding, stream_write_dataset, + strip_cf_grid_mapping, write_dataset_geo_metadata, ) @@ -421,3 +422,57 @@ def test_write_dataset_geo_metadata_no_crs_no_conventions( # Verify zarr_conventions was not added since no CRS was available assert "zarr_conventions" not in result.attrs + + +def _grid_mapped_dataset() -> xr.Dataset: + """A dataset whose CRS is declared only by a CF grid mapping (rioxarray's).""" + ds = xr.Dataset( + {"b02": (["y", "x"], np.zeros((4, 4)))}, + coords={"x": np.arange(4) * 10.0 + 5, "y": 35.0 - np.arange(4) * 10.0}, + ) + out = ds.rio.write_crs("EPSG:32632") + assert isinstance(out, xr.Dataset) + return out + + +@pytest.mark.parametrize( + ("case", "expected_code", "kept_spatial_ref"), + [ + ("grid-mapped", "EPSG:32632", False), + ("grid-mapped-with-proj", "EPSG:4326", False), + ("unrelated-spatial_ref", None, True), + ], +) +def test_strip_cf_grid_mapping( + case: str, expected_code: str | None, kept_spatial_ref: bool +) -> None: + """ + The CF grid mapping is dropped, its CRS carried over as `proj:code` when the + dataset declares none (#352); a declared `proj:code` is kept, and a variable + named `spatial_ref` that is not a grid mapping is not touched. + """ + if case == "unrelated-spatial_ref": + ds = xr.Dataset({"spatial_ref": (["n"], np.arange(3))}) + else: + ds = _grid_mapped_dataset() + if case == "grid-mapped-with-proj": + ds.attrs["proj:code"] = "EPSG:4326" + result = strip_cf_grid_mapping(ds) + assert result.attrs.get("proj:code") == expected_code + assert ("spatial_ref" in result.variables) is kept_spatial_ref + assert all("grid_mapping" not in v.attrs for v in result.variables.values()) + assert all("grid_mapping" not in v.encoding for v in result.variables.values()) + + +def test_stream_write_keeps_the_crs_of_a_grid_mapped_input(tmp_path: Path) -> None: + """ + Without `add_geo_metadata` (the generic rechunker), a dataset whose CRS is + declared only by a CF grid mapping is written with that CRS as `proj:code`, + not with no CRS at all, and without the grid mapping (#352). + """ + ds = _rechunk_ds(_grid_mapped_dataset(), spatial_chunk=1024) + encoding = create_uniform_encoding(ds, enable_sharding=True) + stream_write_dataset(ds, path="/data", group=zarr.create_group(tmp_path), encoding=encoding) + written = xr.open_dataset(tmp_path, engine="zarr", group="/data", decode_coords="all") + assert written.attrs["proj:code"] == "EPSG:32632" + assert "spatial_ref" not in written.variables From 997b1234bf8c7e170edfb44dc2eec20ebedd700e Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Fri, 13 Nov 2026 21:01:33 +0100 Subject: [PATCH 30/45] fix(conversion): extend declared conventions when carrying a grid mapping's CRS Addresses roborev's findings on 2d8e58a. - The carried `proj` attributes replaced the dataset's `zarr_conventions`, dropping a declared spatial or multiscales convention. The proj entry is now appended to the declared ones, unless already declared. - The carry-over is skipped only when the dataset declares a proj convention key (`proj:code`, `proj:wkt2`, `proj:projjson`), the rule the validator uses. A legacy `proj:epsg` no longer counts. Test cases cover a legacy `proj:epsg` and a declared spatial convention. Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 --- src/eopf_geozarr/conversion/utils.py | 19 +++++++++++++------ tests/test_s2_multiscale_geo_metadata.py | 12 ++++++++++++ 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/eopf_geozarr/conversion/utils.py b/src/eopf_geozarr/conversion/utils.py index f9641b7a..8f87f7ac 100644 --- a/src/eopf_geozarr/conversion/utils.py +++ b/src/eopf_geozarr/conversion/utils.py @@ -384,17 +384,24 @@ def strip_cf_grid_mapping(dataset: xr.Dataset) -> xr.Dataset: if isinstance(variable.encoding.get("grid_mapping"), str): names.add(variable.encoding["grid_mapping"]) names = {name for name in names if name in dataset.variables} - carried: dict[str, Any] = {} - if names and not any(str(key).startswith("proj:") for key in dataset.attrs): + attrs = {key: value for key, value in dataset.attrs.items() if key != "grid_mapping"} + # the convention's own keys, as the validator reads them (a legacy + # `proj:epsg` is not a declaration) + if names and geo_proj_cm.CONVENTION_KEYS.isdisjoint(dataset.attrs): crs = dataset.rio.crs if crs is not None: carried = dict(build_convention_attrs(spatial=None, crs=CRS.from_user_input(crs))) + # extend the declared conventions rather than replace them + declared = list(attrs.get("zarr_conventions") or []) + uuids = {entry.get("uuid") for entry in declared if isinstance(entry, dict)} + carried_conventions = cast("list[dict[str, Any]]", carried.pop("zarr_conventions", [])) + declared.extend( + entry for entry in carried_conventions if entry.get("uuid") not in uuids + ) + attrs = {**attrs, **carried, "zarr_conventions": declared} out = dataset.drop_vars(sorted(names)) out = out.copy(deep=False) - out.attrs = { - **{key: value for key, value in out.attrs.items() if key != "grid_mapping"}, - **carried, - } + out.attrs = attrs for variable in out.variables.values(): variable.attrs = {k: v for k, v in variable.attrs.items() if k != "grid_mapping"} variable.encoding = {k: v for k, v in variable.encoding.items() if k != "grid_mapping"} diff --git a/tests/test_s2_multiscale_geo_metadata.py b/tests/test_s2_multiscale_geo_metadata.py index 6098914f..12045819 100644 --- a/tests/test_s2_multiscale_geo_metadata.py +++ b/tests/test_s2_multiscale_geo_metadata.py @@ -13,6 +13,7 @@ from affine import Affine from zarr_cm import geo_proj from zarr_cm import spatial as spatial_cm +from zarr_cm.spatial import CMO as SPATIAL_CMO from eopf_geozarr.conversion.utils import ( _rechunk_ds, @@ -441,6 +442,8 @@ def _grid_mapped_dataset() -> xr.Dataset: ("grid-mapped", "EPSG:32632", False), ("grid-mapped-with-proj", "EPSG:4326", False), ("unrelated-spatial_ref", None, True), + ("grid-mapped-with-legacy-epsg", "EPSG:32632", False), + ("grid-mapped-with-spatial-declared", "EPSG:32632", False), ], ) def test_strip_cf_grid_mapping( @@ -457,8 +460,17 @@ def test_strip_cf_grid_mapping( ds = _grid_mapped_dataset() if case == "grid-mapped-with-proj": ds.attrs["proj:code"] = "EPSG:4326" + elif case == "grid-mapped-with-legacy-epsg": + # a legacy key, not a proj convention declaration + ds.attrs["proj:epsg"] = 32632 + elif case == "grid-mapped-with-spatial-declared": + ds.attrs["zarr_conventions"] = [dict(SPATIAL_CMO)] result = strip_cf_grid_mapping(ds) assert result.attrs.get("proj:code") == expected_code + if case == "grid-mapped-with-spatial-declared": + # the carried proj declaration extends the declared ones + names = [entry["name"] for entry in result.attrs["zarr_conventions"]] + assert names == ["spatial", "proj"] assert ("spatial_ref" in result.variables) is kept_spatial_ref assert all("grid_mapping" not in v.attrs for v in result.variables.values()) assert all("grid_mapping" not in v.encoding for v in result.variables.values()) From d2d4512b7e92874a663315f69b35bbf75ab3125b Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Fri, 13 Nov 2026 21:08:51 +0100 Subject: [PATCH 31/45] docs(conversion): state when strip_cf_grid_mapping carries the CRS over Addresses roborev's finding on 997b123: the docstring still described the old any-`proj:*` rule. Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 --- src/eopf_geozarr/conversion/utils.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/eopf_geozarr/conversion/utils.py b/src/eopf_geozarr/conversion/utils.py index 8f87f7ac..dbb0e127 100644 --- a/src/eopf_geozarr/conversion/utils.py +++ b/src/eopf_geozarr/conversion/utils.py @@ -367,9 +367,11 @@ def strip_cf_grid_mapping(dataset: xr.Dataset) -> xr.Dataset: `write_crs` adds them, so a dataset that was reprojected through rioxarray needs this before it is written. - The CRS is not lost: when the dataset declares no `proj:*` attribute, the - grid mapping's CRS is carried over as the `proj` convention attributes - before the grid mapping is dropped. + The CRS is not lost: when the dataset has none of the proj convention + keys (`proj:code`, `proj:wkt2`, `proj:projjson`; a legacy `proj:epsg` does + not count), the grid mapping's CRS is carried over as the `proj` + convention attributes before the grid mapping is dropped, and the proj + declaration is added to the dataset's existing `zarr_conventions`. """ names: set[str] = set() reference = dataset.variables.get("spatial_ref") From dcac05b756d7efb0215b676d3c95fabcdea15655 Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Sun, 15 Nov 2026 21:46:19 +0100 Subject: [PATCH 32/45] build(deps): take pydantic-zarr 0.11.0 from PyPI pydantic-zarr 0.11.0 is published, so the git-tag source override is removed and the lock resolves `pydantic-zarr>=0.11.0` from the registry. The resolved version and code are unchanged. Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 --- pyproject.toml | 6 ------ uv.lock | 8 ++++++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 706dca93..98e14048 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -261,9 +261,3 @@ constraint-dependencies = [ "pygments>=2.20.0", ] -[tool.uv.sources] -# pydantic-zarr 0.11.0 is tagged but not yet on PyPI; drop this source once -# it is published. -pydantic-zarr = { git = "https://github.com/zarr-developers/pydantic-zarr.git", tag = "v0.11.0" } - - diff --git a/uv.lock b/uv.lock index afc83919..32c78658 100644 --- a/uv.lock +++ b/uv.lock @@ -1735,7 +1735,7 @@ requires-dist = [ { name = "eopf", marker = "python_full_version >= '3.13' and extra == 'cpm'", specifier = ">=3.0.0" }, { name = "numpy", specifier = ">=2.3.1" }, { name = "pydantic", specifier = ">=2.14.1" }, - { name = "pydantic-zarr", git = "https://github.com/zarr-developers/pydantic-zarr.git?tag=v0.11.0" }, + { name = "pydantic-zarr", specifier = ">=0.11.0" }, { name = "pygit2", specifier = ">=1.20.1" }, { name = "pyproj", specifier = ">=3.7.0" }, { name = "pystac", specifier = ">=1.8.0" }, @@ -4535,7 +4535,7 @@ wheels = [ [[package]] name = "pydantic-zarr" version = "0.11.0" -source = { git = "https://github.com/zarr-developers/pydantic-zarr.git?tag=v0.11.0#aca8ee0ff45e3ae6ee1ffb0b9eeb67745814d750" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "numpy", version = "2.4.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.13'" }, { name = "numpy", version = "2.5.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.13'" }, @@ -4544,6 +4544,10 @@ dependencies = [ { name = "typing-extensions" }, { name = "zarr-metadata" }, ] +sdist = { url = "https://files.pythonhosted.org/packages/8e/bd/dbb12e9f640aa168a938a003d91eb9e667deacd030b3a31cff3c1727008e/pydantic_zarr-0.11.0.tar.gz", hash = "sha256:04598e5242ebb9094ca0bbf7c2fe50ff8a7efc1d0473eb7355d3a7841bfe786f", size = 402725, upload-time = "2026-11-13T17:05:58.267Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/cf/01/74405093d36dfb8fcf27368284bb7f0a8e4784dfcaf69104e4eb66434bbb/pydantic_zarr-0.11.0-py3-none-any.whl", hash = "sha256:b7399ee0724ff845a206c9e410cb925f84cefaedbe995e771692fe5b4a61e900", size = 94324, upload-time = "2026-11-13T17:05:56.886Z" }, +] [[package]] name = "pygit2" From 4091426c56178536d31b853ca6fa1c25d9ed11ad Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Sun, 15 Nov 2026 22:21:00 +0100 Subject: [PATCH 33/45] refactor(s2): parse level names in one place Addresses roborev's finding on 47265cc. The merge left two parsers of level names (`r60m`): a regex in s2_plan and string slicing in s2_write. s2_plan's `level_meters` is now the only one. The writer's `_level_meters` and `_is_level_name` call it, and `_level_meters` raises for a non-level name. Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 --- src/eopf_geozarr/data_api/s2_plan.py | 8 +++++--- src/eopf_geozarr/data_api/s2_write.py | 11 ++++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/eopf_geozarr/data_api/s2_plan.py b/src/eopf_geozarr/data_api/s2_plan.py index 78c159f8..908208ac 100644 --- a/src/eopf_geozarr/data_api/s2_plan.py +++ b/src/eopf_geozarr/data_api/s2_plan.py @@ -800,8 +800,10 @@ def _proj_of(name: str, doc: _ArrayDoc) -> tuple[_Transform6, int, str]: """The name of a resolution level group (`r10m`, `r720m`), its metres captured.""" -def _level_meters(path: str) -> int | None: - """The resolution in metres of the level group at `path`, if it is one.""" +def level_meters(path: str) -> int | None: + """The resolution in metres of the level group at `path` (`r10m`, or a path + ending in it), or None if it is not a level group; the one parser of level + names, which the writer uses too.""" match = _LEVEL_GROUP.fullmatch(path.rsplit("/", 1)[-1]) return int(match.group(1)) if match else None @@ -891,7 +893,7 @@ def _tile_attributes( "Carrying the geometry group without georeferencing", group=path, reason=str(error) ) return None - meters = _level_meters(path) + meters = level_meters(path) if meters is None or not path.startswith(("conditions/mask/", "quality/")): return None shape = next( diff --git a/src/eopf_geozarr/data_api/s2_write.py b/src/eopf_geozarr/data_api/s2_write.py index 6d9e60b1..bee341f8 100644 --- a/src/eopf_geozarr/data_api/s2_write.py +++ b/src/eopf_geozarr/data_api/s2_write.py @@ -34,7 +34,7 @@ import zarr from pydantic_zarr.v3 import is_group_spec -from eopf_geozarr.data_api.s2_plan import plan_geozarr +from eopf_geozarr.data_api.s2_plan import level_meters, plan_geozarr from eopf_geozarr.pyz.datatree import encoded_variable from eopf_geozarr.s2_optimization.s2_resampling import determine_variable_type @@ -356,11 +356,16 @@ def _integer_fill(member: AnyArraySpec | AnyGroupSpec) -> int | None: def _level_meters(name: str) -> int: - return int(name[1:-1]) + """The resolution in metres of a level group the plan names (`level_meters`).""" + meters = level_meters(name) + if meters is None: + msg = f"{name!r} is not a resolution level name" + raise ValueError(msg) + return meters def _is_level_name(name: str) -> bool: - return name.startswith("r") and name.endswith("m") and name[1:-1].isdigit() + return level_meters(name) is not None def _output_array(output: zarr.Group, path: str) -> zarr.Array: From 0af1dff14925bb5cdac8bd0e46c7267828cc5004 Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Sun, 15 Nov 2026 22:34:14 +0100 Subject: [PATCH 34/45] refactor(s2-plan): stop a parameter shadowing level_meters Addresses roborev's finding on 47481e8. The `level_meters` keyword parameter of `_carried_array_attributes` and `_plan_carried_array` shadowed the module-level `level_meters` once the merge made it public. The parameter is now `meters`, as in `_with_level_short_name`. Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 --- src/eopf_geozarr/data_api/s2_plan.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/eopf_geozarr/data_api/s2_plan.py b/src/eopf_geozarr/data_api/s2_plan.py index 5d0d8fd0..4eaea2e8 100644 --- a/src/eopf_geozarr/data_api/s2_plan.py +++ b/src/eopf_geozarr/data_api/s2_plan.py @@ -725,7 +725,7 @@ def _carried_array_attributes( is_float: bool, name: str, dtype: np.dtype[Any], - level_meters: int | None = None, + meters: int | None = None, ) -> dict[str, object]: """The output attributes of a carried array: sanitized, the CF attributes put right for its data type, with the CF float fill, the SCL flag table @@ -739,10 +739,10 @@ def _carried_array_attributes( # the converter's SCL flag table and NO_DATA fill declaration out.update(SCL_ATTRS) out["_FillValue"] = SCL_NODATA - return _with_level_short_name(out, name, level_meters) + return _with_level_short_name(out, name, meters) -def _plan_carried_array(name: str, doc: _ArrayDoc, *, level_meters: int | None = None) -> DataArray: +def _plan_carried_array(name: str, doc: _ArrayDoc, *, meters: int | None = None) -> DataArray: """ One carried (non-reflectance) array, translated to its output document: `x`/`y` become the float64 coordinate arrays, other coordinate arrays @@ -767,7 +767,7 @@ def _plan_carried_array(name: str, doc: _ArrayDoc, *, level_meters: int | None = is_float=parsed.kind == "f", name=name, dtype=parsed, - level_meters=level_meters, + meters=meters, ) if parsed.kind in "US": # fixed-length unicode or bytes labels (the geometry `angle`, `band` @@ -956,8 +956,7 @@ def _plan_dataset( anchor = _spatial_anchor(arrays) meters = level_meters(path) members: dict[str, DataArray] = { - name: _plan_carried_array(name, member, level_meters=meters) - for name, member in arrays.items() + name: _plan_carried_array(name, member, meters=meters) for name, member in arrays.items() } if anchor is not None: transform, epsg = _proj_of(*anchor) @@ -1028,7 +1027,7 @@ def _plan_aux_multiscale( for name, member in _carried_arrays(input_levels[meters]).items(): if name in ("x", "y"): continue - variables[name] = _plan_carried_array(name, member, level_meters=meters) + variables[name] = _plan_carried_array(name, member, meters=meters) if not variables: msg = f"The {path} r{meters}m dataset holds no arrays" raise ValueError(msg) From 8c7598eb5ab40433078588b985aa5bb7ee9d280b Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Sun, 15 Nov 2026 22:52:49 +0100 Subject: [PATCH 35/45] build(deps): upgrade tornado to 6.6.1 for CVE-2026-126347 The security check's pip-audit blocked on tornado 6.6 (CVE-2026-126347, fixed in 6.6.1), a transitive dependency through dask's distributed scheduler. Only tornado moves in the lock. Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 --- uv.lock | 92 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/uv.lock b/uv.lock index 3882597a..50afc497 100644 --- a/uv.lock +++ b/uv.lock @@ -6064,52 +6064,52 @@ wheels = [ [[package]] name = "tornado" -version = "6.6" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/d0/02/5f549b1ad5da6267ed1e1fac2eef69257b1979cc812497002499b7895ff9/tornado-6.6.tar.gz", hash = "sha256:34c4aa916d7f2b2d5cadee2c6850f5a4a7f3d688cbf58399ea9bd3057af4abd5", size = 617998, upload-time = "2026-10-21T15:31:04.733Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/df/f5/d3e6f76b945f9812842db742d0708a3b6287e850e81be3ca10e290c103c6/tornado-6.6-cp311-abi3-macosx_10_9_universal2.whl", hash = "sha256:01abf15429d64f04ccfafc238b191cc2c177108b7a331f4461707ad77198c8c2", size = 528326, upload-time = "2026-10-21T15:30:05.528Z" }, - { url = "https://files.pythonhosted.org/packages/30/69/b20cf3a8bf641ec792a5a6050aa153e8f120604f9c23471142de535113e5/tornado-6.6-cp311-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:11bb97c00981eb8254e55bd6a5ad960c983ae343fef8ae3ae5584cd1fb70236a", size = 529544, upload-time = "2026-10-21T15:30:07.126Z" }, - { url = "https://files.pythonhosted.org/packages/0f/f4/d9d8d3ac345aa9df3a132ad03bd443160c2ab24ad4003b4e8d6d5af06371/tornado-6.6-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4e152a3b2d3eae113b836d979823f7bb2320f7e334a84449729964921f374a4c", size = 530523, upload-time = "2026-10-21T15:30:08.478Z" }, - { url = "https://files.pythonhosted.org/packages/ad/82/1296ade1c14dee5a4906e5ca092997622ece7c4dc768c68ed9caaf895d1b/tornado-6.6-cp311-abi3-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e912d4c4babd04db6f34b25b748174a4a176debe86c8610beedf1815f9af7fdd", size = 530739, upload-time = "2026-10-21T15:30:09.98Z" }, - { url = "https://files.pythonhosted.org/packages/66/30/6ac1eab66c81af46dafd93c9b24bd311f82e199d9d7b8ce2a64a91b6a200/tornado-6.6-cp311-abi3-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:33aabe8a03d426cef4e0fe5669f0643cadd983b54957f1a7ac2789ec326e9644", size = 529738, upload-time = "2026-10-21T15:30:11.498Z" }, - { url = "https://files.pythonhosted.org/packages/24/b4/6c1f6aa1fd148e4d0f500a10cd0c9949e7bf385e161ff497c81de5b3ae4f/tornado-6.6-cp311-abi3-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:9aaf0e1c2fb9f046f30e2036b8d2060666399e8464d0a72769e43c754089567b", size = 527908, upload-time = "2026-10-21T15:30:13.298Z" }, - { url = "https://files.pythonhosted.org/packages/54/5b/67d3d452b1179bc9e265cebd381a56ab4cf2d7b2a54607aedd8d6e1ebc2e/tornado-6.6-cp311-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:61fc5513cea97720ab9bf54b04827ac0f4500c63f0b072b963d6145c798b4661", size = 530367, upload-time = "2026-10-21T15:30:15.183Z" }, - { url = "https://files.pythonhosted.org/packages/74/14/4e8e9a14f77bcafb2408634b2d4c8c676ad7a43bf8dac4ee2d48370698f9/tornado-6.6-cp311-abi3-musllinux_1_2_ppc64le.whl", hash = "sha256:31e1a0d5cd704d2fe8a008c1cc27a0e2b67269ca263630a27985dddc160b5537", size = 530456, upload-time = "2026-10-21T15:30:16.741Z" }, - { url = "https://files.pythonhosted.org/packages/56/12/e3ddef99a2089ccfc86f32bd3f39caaad87bee4868be1bacbf213a0b07a2/tornado-6.6-cp311-abi3-musllinux_1_2_riscv64.whl", hash = "sha256:74416e41e9bdf70fbc2fb242f6fbbc7a58ec11e59d39f15fc5a421ecb6845118", size = 529610, upload-time = "2026-10-21T15:30:18.031Z" }, - { url = "https://files.pythonhosted.org/packages/35/3d/62a692343d46b37e852e5078e0f6513534d925f70a04580072e3c127b129/tornado-6.6-cp311-abi3-musllinux_1_2_s390x.whl", hash = "sha256:8cdd69104ae9d705b3f04d2563aa96e357043e267a455802daae9a1e633a37c8", size = 529803, upload-time = "2026-10-21T15:30:19.326Z" }, - { url = "https://files.pythonhosted.org/packages/49/04/6c59a9413adfe4810f648a4dd9fdf476f13b0495f9cc25ef856b71f9ce1e/tornado-6.6-cp311-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:fc7c8a3263501fbe97518cd699101bc3c5f499a7dd4f75fc6cbb3bd9ee1db1f1", size = 529751, upload-time = "2026-10-21T15:30:20.826Z" }, - { url = "https://files.pythonhosted.org/packages/31/36/a1b3b84cd347ae43f982d3bf95628de6c6365668dba2543af47c6a1c888e/tornado-6.6-cp311-abi3-win32.whl", hash = "sha256:b54ca69ff93d0374efb083a12a1e9ec2dd2036e8496d197e0e8ef77b8d9135c3", size = 530643, upload-time = "2026-10-21T15:30:22.428Z" }, - { url = "https://files.pythonhosted.org/packages/b7/50/dc813fe35a672e14ee8bed8b5c634eeb343a05c98eb455318a169de24567/tornado-6.6-cp311-abi3-win_amd64.whl", hash = "sha256:48f26ed9d7beb64e5f06adc864524e581ab6d62ba8ff46eaaa1ac2d0e6d753fd", size = 530886, upload-time = "2026-10-21T15:30:23.975Z" }, - { url = "https://files.pythonhosted.org/packages/0d/71/62a9b9e980026d38874740d0a7c162f53eb0563f6a441e3aff84c48db7e8/tornado-6.6-cp311-abi3-win_arm64.whl", hash = "sha256:29114ffd4e4de869d390393df9e9a0f191065aae1a96f38a58d35e464c04a867", size = 530899, upload-time = "2026-10-21T15:30:25.264Z" }, - { url = "https://files.pythonhosted.org/packages/ac/4c/633e3568eb574df555d6ddd2dac44b7793a5c26cd63b444e653fcfb1d6ec/tornado-6.6-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:63fc8d243b52fd8dd9ed4ad02d0df08f2024f9aea632a433a8a6c91075076d44", size = 528432, upload-time = "2026-10-21T15:30:26.578Z" }, - { url = "https://files.pythonhosted.org/packages/37/eb/b525d1870ad28a56f47b664dd8fd3fab4f7ddd237c87c14e97248bf4762f/tornado-6.6-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:8d4b85cac795bfc6a7f20ba81871abb8c2ae8fba019061b8a9ae1c2f97e29637", size = 532586, upload-time = "2026-10-21T15:30:28.027Z" }, - { url = "https://files.pythonhosted.org/packages/b7/35/909a33c253352346ca081a27ca66b45c1398468adf784b767597ca773c28/tornado-6.6-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e035c065edadfa696529d05eebcbeb25154c129b5aee6dbfb697a6abf5d4f697", size = 533641, upload-time = "2026-10-21T15:30:29.318Z" }, - { url = "https://files.pythonhosted.org/packages/6f/64/100202666d6e3d96288ab184827762415456c139798a15c962547f9fabf9/tornado-6.6-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:5b94e589ab855090c448b5c0937b3a75f1c1a604b7b36207e8236d209f720b9c", size = 533869, upload-time = "2026-10-21T15:30:30.882Z" }, - { url = "https://files.pythonhosted.org/packages/b1/e0/af3ed62bc15830d60328d5b4a1a9076b35ea0ba142cb17b1c1772cb15c59/tornado-6.6-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:1a394c8c9db9137f2a2b42869d9f7b91398fcf19da120d0dde4c4546172710f7", size = 532767, upload-time = "2026-10-21T15:30:32.273Z" }, - { url = "https://files.pythonhosted.org/packages/24/d7/1e2e1a6932eb62d63324b64dba2f62e6eaf79ad883dd209352c297b7848c/tornado-6.6-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0215d1df6e4b5e736ddad5adf0af4138cf7437fdd39c77c5e69768e37850a632", size = 530956, upload-time = "2026-10-21T15:30:33.746Z" }, - { url = "https://files.pythonhosted.org/packages/70/65/3b9a0e53d7a4c39f2ebe95486540fa8eeb67bfb6e8c437d603c00d35b128/tornado-6.6-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:4d711790e0a9576ad924d942c4607e4e401d697588ea6f30f6662824008a7add", size = 533372, upload-time = "2026-10-21T15:30:35.085Z" }, - { url = "https://files.pythonhosted.org/packages/44/48/90979cbfaa3ff941324a2605eb794af0f087c670cd99f18a69ab40498073/tornado-6.6-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:034a66bae0f55421d007803e2385d2a59707d8829b2f026373d42f08256e9922", size = 533425, upload-time = "2026-10-21T15:30:36.425Z" }, - { url = "https://files.pythonhosted.org/packages/bb/c4/ce743a86d91f85c255b77a4282eb5b2716b61e74430eb9d1df8578a539d2/tornado-6.6-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:5cb38483b077129056a94dd415a71d29ab4e42b46da894fee8b4657003f10b21", size = 532545, upload-time = "2026-10-21T15:30:37.789Z" }, - { url = "https://files.pythonhosted.org/packages/02/5e/a82131e35778540fc19139229d02aa8cf2453a8022e202be50c88f0f8ac3/tornado-6.6-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:46bbbd107efa37777ac4b83601866d19b4dbd5b770a7a9123582633d95959ad3", size = 532700, upload-time = "2026-10-21T15:30:39.336Z" }, - { url = "https://files.pythonhosted.org/packages/3a/09/6dac8c2c677c65d60b3d7dae94176dbfe392f314e7c8e2d709623edd6a26/tornado-6.6-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:b85e9d0263cdbc027b95947c8b873a7bc7fd6a08d16bfb4f5047350b0808e464", size = 532712, upload-time = "2026-10-21T15:30:40.698Z" }, - { url = "https://files.pythonhosted.org/packages/b2/ac/71e5776cbcdc3264e81aa6db28c69717ba50607a9eb8d5b766f11a4b020e/tornado-6.6-cp314-cp314t-win32.whl", hash = "sha256:4276eef0880e5fe4488e6799c2842f59af3b06637e9313ab4fb506f9c9c2d6cb", size = 530491, upload-time = "2026-10-21T15:30:42.115Z" }, - { url = "https://files.pythonhosted.org/packages/d8/0f/0b6a6908a5b5aa8320009dfdb84434b1cf160b577a00456e59ab9e6ea598/tornado-6.6-cp314-cp314t-win_amd64.whl", hash = "sha256:10d4af98c6df09f8429b1340ccaea3a72887b86f695dfb8056bda517c8115a00", size = 530780, upload-time = "2026-10-21T15:30:43.414Z" }, - { url = "https://files.pythonhosted.org/packages/3c/39/c152e1cc5371f75f5f9f0a4f44bf2dc9396be9407d384de7428446fb4651/tornado-6.6-cp314-cp314t-win_arm64.whl", hash = "sha256:b1f0ef20a5278854f5fdac31637bafadb055405df28b7fc945e54add12b172e3", size = 530781, upload-time = "2026-10-21T15:30:44.741Z" }, - { url = "https://files.pythonhosted.org/packages/0c/c5/f96c7d7a8895745bb37dfb6e6107e1ee40ad02a4b162d7d6c143644455ab/tornado-6.6-cp315-cp315t-macosx_10_15_universal2.whl", hash = "sha256:8f8e382da30fe042f27f27a871e21aefc2613870e5a41648de18446c72d6ea59", size = 528446, upload-time = "2026-10-21T15:30:46.112Z" }, - { url = "https://files.pythonhosted.org/packages/c0/dd/ab8f6500d274b9c55b025798eb54e92591bcff27515799bec443bd54e35a/tornado-6.6-cp315-cp315t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:8c7a8a328396c2195454a2ecd9499512441bbce99505544a717e6a87d16ff6f9", size = 532774, upload-time = "2026-10-21T15:30:47.393Z" }, - { url = "https://files.pythonhosted.org/packages/87/23/b78e7d1bf329160b8157284005395421ea941864c16c7f04c3e48c98bcf9/tornado-6.6-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ca025bb0da81c294aef26f27427316df1525220820315f4bf32dc1e84a4d2232", size = 533872, upload-time = "2026-10-21T15:30:48.884Z" }, - { url = "https://files.pythonhosted.org/packages/e0/4f/ab66b614ad0bc9a219484be6bc2c002c8de9916a7b6c7b27fe6273838e5c/tornado-6.6-cp315-cp315t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:59c22ebc905ac2a267f8d9d8a878f86afbcbbde329d75c485f1422fc45a81b83", size = 534027, upload-time = "2026-10-21T15:30:50.157Z" }, - { url = "https://files.pythonhosted.org/packages/da/63/501fa15a36bace2f4b9158228cf922d606403261bf71c960c433ec3ca0a4/tornado-6.6-cp315-cp315t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f89802bc0bcd15f988d9325b4e6d2171bb04ea68d188732556335e10d3fd00bd", size = 532936, upload-time = "2026-10-21T15:30:51.45Z" }, - { url = "https://files.pythonhosted.org/packages/7f/b7/82d643f635f0300bda98613ca2660b4f3134b6fb594c6fddfa4de706806c/tornado-6.6-cp315-cp315t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:70043256d5958f9c655066153d23d60ea3e29bf9854f7fb75850e223c477758a", size = 531254, upload-time = "2026-10-21T15:30:52.865Z" }, - { url = "https://files.pythonhosted.org/packages/d4/53/92c40891a94750bc09257310af964bf25c59e3531d6199736c318baa864f/tornado-6.6-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:82b49495e3849d644b841ef33b35491160055997deaa93720ff647ef019421db", size = 533566, upload-time = "2026-10-21T15:30:54.15Z" }, - { url = "https://files.pythonhosted.org/packages/7e/88/b82f5c5efde731b88d839ad99cb6ace2a521f03bb6d7346d2de089c76da8/tornado-6.6-cp315-cp315t-musllinux_1_2_ppc64le.whl", hash = "sha256:07b2bcaa4bf447bdbfb664e4c28344226540db3f0ebccd74886528338a240765", size = 533567, upload-time = "2026-10-21T15:30:55.451Z" }, - { url = "https://files.pythonhosted.org/packages/02/2c/e9a7f5d0fca0bdbcd48b2d9c7884dd0b32669c9945d98bc6d303a80ecfea/tornado-6.6-cp315-cp315t-musllinux_1_2_riscv64.whl", hash = "sha256:c36b921374c302e54909bae17d9f354061d80e7ae7d8c94f73abbcc217866460", size = 532849, upload-time = "2026-10-21T15:30:56.729Z" }, - { url = "https://files.pythonhosted.org/packages/d0/f5/4ade737340ca6ce9c677ea0c2843591c8ad065d07f0913c28d922c7e078e/tornado-6.6-cp315-cp315t-musllinux_1_2_s390x.whl", hash = "sha256:7412d9e37aa9f7048e4b591f520a95f7a097278ffab15f1ddf3f5c2320cf6648", size = 532873, upload-time = "2026-10-21T15:30:58.067Z" }, - { url = "https://files.pythonhosted.org/packages/8e/04/6acdc937d0bb6189ddb34ceded517d7bd1c7b3bded5d4e1b3442160e6b6f/tornado-6.6-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:15bc95112b2d24b0bfaee9a004e3f974da929e33b4244a7f695a22f45b08a5e5", size = 532883, upload-time = "2026-10-21T15:30:59.395Z" }, - { url = "https://files.pythonhosted.org/packages/ab/27/0a766fac6b1cc629d96346329a0485287fd2857c51a887a3a154f2a69938/tornado-6.6-cp315-cp315t-win32.whl", hash = "sha256:f661c21117b875d612371f3eb243d0c69f56d9bdd6aee38b7c24453419dfe554", size = 530488, upload-time = "2026-10-21T15:31:00.77Z" }, - { url = "https://files.pythonhosted.org/packages/5c/80/3e4142570883da27b3f60ae82c638ac96e60997eac684740613557519c96/tornado-6.6-cp315-cp315t-win_amd64.whl", hash = "sha256:ee8853ab35da510dc952879ebd9995c82bc10ffb7925fd87930dc0d6916f4b39", size = 530777, upload-time = "2026-10-21T15:31:02.087Z" }, - { url = "https://files.pythonhosted.org/packages/17/57/4a85c617b6349962320b4afbe1386d5b05fd57218ee8ad6e82e0110ec9ee/tornado-6.6-cp315-cp315t-win_arm64.whl", hash = "sha256:7de62e2dfdf559fd7154d2b9aa58ff3d9cff8304ae0519341feb082618bc2a33", size = 530780, upload-time = "2026-10-21T15:31:03.425Z" }, +version = "6.6.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/64/2b/8ff2b41620cbba0eeb0862fed21dcaa5a2ad36c6dd9bb465f9ff7a147be2/tornado-6.6.1.tar.gz", hash = "sha256:28e6311402af59c8b02e3fa0f5e7d8eb465b25081381803b127d97e6a4395d5a", size = 623388, upload-time = "2026-11-09T21:09:22.71Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/77/d3/ef3a4d38d1a72c52ad07483ed760dbb93027d28f19c3a2d98148abdd63e1/tornado-6.6.1-cp311-abi3-macosx_10_9_universal2.whl", hash = "sha256:a8d3e6acde5a80d13b13b5e4c7c226ca682f31d0a62b6c33cea038714bc2de1b", size = 533249, upload-time = "2026-11-09T21:08:22.475Z" }, + { url = "https://files.pythonhosted.org/packages/38/4d/c65ea949a3cdc185f1afac8c337074d4f2d029b48293d2db4d2c3dea4849/tornado-6.6.1-cp311-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:1b6ff57cc69b339f8feb9e7b567b0e0eacb16bfaf234159496623ef7a67ba640", size = 534470, upload-time = "2026-11-09T21:08:24.27Z" }, + { url = "https://files.pythonhosted.org/packages/03/ff/20911f85dd399b56761496e8138810e8608ea25f0912377f4205d52af853/tornado-6.6.1-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:da6ce2da215810d56539fa6cac77d9e27f4d8139c6868c53436b2fe933f43c79", size = 535446, upload-time = "2026-11-09T21:08:25.625Z" }, + { url = "https://files.pythonhosted.org/packages/be/70/a4a159dd4f1fef39ff8eadae655b133a85722b39087a89e21ce463af9832/tornado-6.6.1-cp311-abi3-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:8cd28b2cacbe63d53e28a38546a3492b488417eeb3f7ecf10954476fc2508882", size = 535664, upload-time = "2026-11-09T21:08:27.191Z" }, + { url = "https://files.pythonhosted.org/packages/ed/d5/db70d5d23d3b4eaea0b26b710f28d2ca387bb44e68ccfede60ba3bbc2096/tornado-6.6.1-cp311-abi3-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:25b2619274bca77d0eb7b4d96dcf2d1142bb9bf172ad6a7491a1e1f82e6e48fa", size = 534660, upload-time = "2026-11-09T21:08:28.78Z" }, + { url = "https://files.pythonhosted.org/packages/f7/f6/0528ee039266902e707edd9996ee3ce7364dc1baf08bed585d8e6fb3ccd0/tornado-6.6.1-cp311-abi3-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:77dd6e0c659fdc45824e0746988ac5c060c2a9fee9b8cbbcdb999b3f29d3cd10", size = 532834, upload-time = "2026-11-09T21:08:30.432Z" }, + { url = "https://files.pythonhosted.org/packages/a6/bb/b733df2d487a78283080663bd6d96955121b58b6d445d9cb832607da9786/tornado-6.6.1-cp311-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:b62fded687e55acaf9e36c1230b006066a35b3f6df093ba1fd3b2ff592070e1d", size = 535289, upload-time = "2026-11-09T21:08:31.692Z" }, + { url = "https://files.pythonhosted.org/packages/a7/7c/c81cb83f2bbb5740fcba1eb83d794b6d6fab2063b16a475cc9039266091e/tornado-6.6.1-cp311-abi3-musllinux_1_2_ppc64le.whl", hash = "sha256:ecef88054d8a77878f61061ff67dfc5e1c17d1f7334890ab508b310e8e68ee46", size = 535382, upload-time = "2026-11-09T21:08:33.282Z" }, + { url = "https://files.pythonhosted.org/packages/8a/ae/c499da4cc8be1c1f31a5d8df2328f2aae091de2db13302ad5c20ed704ec4/tornado-6.6.1-cp311-abi3-musllinux_1_2_riscv64.whl", hash = "sha256:ca95e762df1ca761f330e3f2a034c15ac144569844b52527a5a9eca9f524c0f1", size = 534534, upload-time = "2026-11-09T21:08:34.57Z" }, + { url = "https://files.pythonhosted.org/packages/61/7c/6b163c9e58ca9df0c941bda9ba2dcabbd87ecb81c5fa546f54eeac689232/tornado-6.6.1-cp311-abi3-musllinux_1_2_s390x.whl", hash = "sha256:8cae3d8f2585be01670da9fd5010c61724c51b61ecd4c06820e95874739daf7c", size = 534728, upload-time = "2026-11-09T21:08:35.828Z" }, + { url = "https://files.pythonhosted.org/packages/18/11/b5107ac6a278387635d73d283e7ab5a5c76fb8ccf402efa57006ea25852f/tornado-6.6.1-cp311-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:6596f3e939962f13099ce8d1a96b83226e908ca369b193370a6efa84585a1601", size = 534676, upload-time = "2026-11-09T21:08:37.209Z" }, + { url = "https://files.pythonhosted.org/packages/65/df/0574c4479c565d9233def796afc9179fa840f41f8c240f740609f746da67/tornado-6.6.1-cp311-abi3-win32.whl", hash = "sha256:0f0f596a0dab6826aa21d103c7bc242e3fb7cfc99c5c3d44a35ba8c83abbdca4", size = 535565, upload-time = "2026-11-09T21:08:38.518Z" }, + { url = "https://files.pythonhosted.org/packages/36/57/35439a779582e3b19c98e799b6a41519fb3bdaa3a21b7a94ce4dd7b3b732/tornado-6.6.1-cp311-abi3-win_amd64.whl", hash = "sha256:5cb82ca38596e1350fceaf994f287847f82f7b8436380d36ba0937a03107d0ee", size = 535806, upload-time = "2026-11-09T21:08:39.892Z" }, + { url = "https://files.pythonhosted.org/packages/89/b8/2cb42845af01ea7e70ac23e6f6fe2f26b9b158bce186c6991c057c9abe1d/tornado-6.6.1-cp311-abi3-win_arm64.whl", hash = "sha256:58d2f47e7b54fded3407dbbbe4e59d29ca627f85bf6c0f21f0b151c6c7fc9c53", size = 535825, upload-time = "2026-11-09T21:08:41.339Z" }, + { url = "https://files.pythonhosted.org/packages/10/de/cfeae9e75c144ca22018ee3b858e343c1658d6edd2184f35d810ec1ef789/tornado-6.6.1-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:ed0bc5a1a9f6346e7bdadc106fa2d4c6e79d71d8b2df4366260ab3baf36a8399", size = 533356, upload-time = "2026-11-09T21:08:42.603Z" }, + { url = "https://files.pythonhosted.org/packages/3d/d8/7812a729c797fb8c15748c9a69faeaaa13630075cf9b76ba9f7fbcfb7f42/tornado-6.6.1-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:54c80f9bed0bf1533ecf5a90dc59651645622d62b0bcffa2692d108a1f794917", size = 537511, upload-time = "2026-11-09T21:08:43.84Z" }, + { url = "https://files.pythonhosted.org/packages/70/47/ebef304487feea6d8efb6a7d2642964ecb1f5cc785f687628e1d7cac4326/tornado-6.6.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:eb67ba2cbf598e842f14684eab029a5a4ba7ab587e8c4e40940a77ed0596b31e", size = 538566, upload-time = "2026-11-09T21:08:45.203Z" }, + { url = "https://files.pythonhosted.org/packages/a3/6a/87532e6745c415eb2daa9bc1c9c89c69ce9e8255b1c0bde9938f3299440b/tornado-6.6.1-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:d83bac141bd9360d8e995ec512097be19ead2e9213c3e7088510a036f3192b8d", size = 538793, upload-time = "2026-11-09T21:08:46.478Z" }, + { url = "https://files.pythonhosted.org/packages/e4/c7/26af60f71f7c32f19257bad58711500628f579edf1a2c3d8328ad15aae04/tornado-6.6.1-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:60aad449dbcebaa8d69bff50c6ba39858fab8d256e779a99bb30ebf6724b9b48", size = 537691, upload-time = "2026-11-09T21:08:47.975Z" }, + { url = "https://files.pythonhosted.org/packages/ba/9d/af233b8bf4311d3466099ab267eb595ec6f1655607d290dc7f706b6dbd6f/tornado-6.6.1-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:b9ce0d6548bd73b1329075b247d3fdc61538922f558ee42059e08f5df53fc197", size = 535877, upload-time = "2026-11-09T21:08:49.76Z" }, + { url = "https://files.pythonhosted.org/packages/95/66/78e7583ce69f66e5177c65988a98373be2ab25c1d22405d274e037acbc58/tornado-6.6.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:ce5a18654f5d56d11400ab5d87103660e14deceab41818a06a42acc8dbbe427d", size = 538295, upload-time = "2026-11-09T21:08:51.221Z" }, + { url = "https://files.pythonhosted.org/packages/a3/3a/ad336d4994547cf268a3bd6d10f6ef691e1e888fc776940c0bfe02e8d85c/tornado-6.6.1-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:3298fce72c35f836eab4c4db8b960104ff1ea718033a6b5e236f04efe3a1b6e1", size = 538349, upload-time = "2026-11-09T21:08:52.761Z" }, + { url = "https://files.pythonhosted.org/packages/cf/cf/563d24516afd266f6b3c3f1c7ac15ad39b8668966d2bccce917c169ab0c0/tornado-6.6.1-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:0223e827cedf4e35ebb035e57a0d9974563cd043e3a53f8bb72a859b6f53777e", size = 537469, upload-time = "2026-11-09T21:08:54.279Z" }, + { url = "https://files.pythonhosted.org/packages/c8/ea/1705ff4014c8bad5d7045022647156cfebd6c7014886da47e13512d27c08/tornado-6.6.1-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:533185c89be3ffb01656c9425da4ff42587a3af784b37d39fe762e8fce3b2dbe", size = 537624, upload-time = "2026-11-09T21:08:55.648Z" }, + { url = "https://files.pythonhosted.org/packages/50/5d/421168e62c8b80e3ef88f80d642e9a7e5b1d0c6e8cd136d99064f663951c/tornado-6.6.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:fbaa022a49a27b65668592cf43b898ff3978cbe4e6926fdfe24dbef59053bd26", size = 537632, upload-time = "2026-11-09T21:08:57.797Z" }, + { url = "https://files.pythonhosted.org/packages/6a/b4/13b2f98a3141c152915fa3e69531a04bdc1cd7dd203f442136f3792a486f/tornado-6.6.1-cp314-cp314t-win32.whl", hash = "sha256:4bc6c60faf86162df25ba2ff5611d27b6ef8226de9d61c07a0fab53c169630a5", size = 535424, upload-time = "2026-11-09T21:08:59.145Z" }, + { url = "https://files.pythonhosted.org/packages/84/83/6d54c37b3e437ab0ff2bddd71249c6ea2a17051104dd2995cb4e181e95a7/tornado-6.6.1-cp314-cp314t-win_amd64.whl", hash = "sha256:71c16b382b22d3234913a3f74a1ea84bede197d11eb03871df17bb123088dfa5", size = 535715, upload-time = "2026-11-09T21:09:00.456Z" }, + { url = "https://files.pythonhosted.org/packages/d4/38/75419d8cd577b7c4f335f4c5e75f127af286545ad49047a73afffdf877fe/tornado-6.6.1-cp314-cp314t-win_arm64.whl", hash = "sha256:510c7261ed986ecd6f74edc1a13412759e7abc2e8be3a6c85e15f6c53e1f3c84", size = 535718, upload-time = "2026-11-09T21:09:01.783Z" }, + { url = "https://files.pythonhosted.org/packages/91/8b/96e460653f3e2ad83d70328414394132d73d5655047c692ce7b69ae2f6c0/tornado-6.6.1-cp315-cp315t-macosx_10_15_universal2.whl", hash = "sha256:01dc73e3697eb94d78c42e03931ab621da97d12fdfb6339e64ff5a934b220fcf", size = 533376, upload-time = "2026-11-09T21:09:03.097Z" }, + { url = "https://files.pythonhosted.org/packages/1a/1e/644bace0700e533235f01ffa68a7b5e3d6cc9eb7380e3929039d04b648b9/tornado-6.6.1-cp315-cp315t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:95bd4751357bef52aa655e236b9667ff054885de4b118e4ce9ba5c06e12ef5d0", size = 537696, upload-time = "2026-11-09T21:09:04.519Z" }, + { url = "https://files.pythonhosted.org/packages/e6/0a/afccc23d1ed71bcb1ce4a5b6e0f61f82c7a0b275f3b377ee7aee6680a565/tornado-6.6.1-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:29bce3190c2973fcd2171c95eeab8bf06d2f7a7eb107455ce3e4662c704aecdb", size = 538796, upload-time = "2026-11-09T21:09:05.956Z" }, + { url = "https://files.pythonhosted.org/packages/e5/24/69692f8ba851ed2738c2623eab592360d646f0a2e16b6deea16516aa8595/tornado-6.6.1-cp315-cp315t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:b777fbe0bdb2c4dc764aadf5f70e9b23b2e536c339d61c799d3ea1b575a7c285", size = 538951, upload-time = "2026-11-09T21:09:07.298Z" }, + { url = "https://files.pythonhosted.org/packages/00/82/234306b41b33600a470da7e595b8064b85e2f509f64f5c1d39387c0abbb8/tornado-6.6.1-cp315-cp315t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:15443805d6b7aa11610cc6c5be7e71b4a93369aeb2ca5a13c2def53a3af5ba45", size = 537861, upload-time = "2026-11-09T21:09:08.857Z" }, + { url = "https://files.pythonhosted.org/packages/5b/87/6d13a60c320c0379cbfa4c2520b4ba076780c33e6a01ba3073fff74b71db/tornado-6.6.1-cp315-cp315t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:b77ab23d1520c807d11e703e79b020d3bc3676a0f5ebc8531f46d3fac8aecb2f", size = 536178, upload-time = "2026-11-09T21:09:10.424Z" }, + { url = "https://files.pythonhosted.org/packages/96/c7/e27f2a21e05d7c5aa9886db7368436e6436880b85349072988b4f62422e3/tornado-6.6.1-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:872249311539281c1e8a5d8d6f27f478bf705a9bd931bf374b6b31b05177dfda", size = 538491, upload-time = "2026-11-09T21:09:11.968Z" }, + { url = "https://files.pythonhosted.org/packages/f3/c7/1f981336039c51d81ee6f895e3412178edc409bd709e38767365c55c0daa/tornado-6.6.1-cp315-cp315t-musllinux_1_2_ppc64le.whl", hash = "sha256:08b808e8d3312c268f9fe1ffebfcfaaf342e7fe4ac40d219a7e1b58bac547d6f", size = 538491, upload-time = "2026-11-09T21:09:13.226Z" }, + { url = "https://files.pythonhosted.org/packages/5d/4f/7dafc65726778ac148b68c91920605892e84bf0ffcc02890aaf1a7d0ba8d/tornado-6.6.1-cp315-cp315t-musllinux_1_2_riscv64.whl", hash = "sha256:8d475f4053c693b5c1483eb4845824129b0b51c65712e736b3c2ea1c8f6080cd", size = 537775, upload-time = "2026-11-09T21:09:14.697Z" }, + { url = "https://files.pythonhosted.org/packages/a1/25/85c852307f9e49896b6dc5119f6a0131f5f6d97c478a687654c2c0c3f0f4/tornado-6.6.1-cp315-cp315t-musllinux_1_2_s390x.whl", hash = "sha256:e923e75c9d641cdb8bbac60070a2dccdb684fc555af2bff48b0eaded0f88c2dc", size = 537798, upload-time = "2026-11-09T21:09:15.946Z" }, + { url = "https://files.pythonhosted.org/packages/60/43/a37ec29b0f98c3c639da495e1d547d6c44c69a6727b9864cf149bf346433/tornado-6.6.1-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:a72f70b1aa630fa2106d39a025e2be75c272b7ec8233da94e2f407ea754cc32d", size = 537809, upload-time = "2026-11-09T21:09:17.265Z" }, + { url = "https://files.pythonhosted.org/packages/3b/d4/13973391071552e03acb308d93f6deb4fb535a769a6bbdafdb4cafcb2f91/tornado-6.6.1-cp315-cp315t-win32.whl", hash = "sha256:2fbfd2510b6163b189773155a8246c025cb260ccc7cd12ad18c36c54f5617bb9", size = 535422, upload-time = "2026-11-09T21:09:18.525Z" }, + { url = "https://files.pythonhosted.org/packages/19/94/c952b625904b63fdac5b747f2eeaca64ab5d36cdb8faff57effa57162d87/tornado-6.6.1-cp315-cp315t-win_amd64.whl", hash = "sha256:3c35091add5863feb9cf651851bb1b23592f1f9551b5dfed72837c83ea4e5b85", size = 535713, upload-time = "2026-11-09T21:09:20.061Z" }, + { url = "https://files.pythonhosted.org/packages/f8/62/8d0c0c42f3346f3f2455738d3bc689bbd8efba38abf7b90ab2b8294eae83/tornado-6.6.1-cp315-cp315t-win_arm64.whl", hash = "sha256:065bc741478b168df9baf754956a3010c04d1330bb45a84833d807c29e11b257", size = 535719, upload-time = "2026-11-09T21:09:21.317Z" }, ] [[package]] From f803d63b6fa1d74672084c4fd3859c51a9198c28 Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Mon, 16 Nov 2026 00:03:54 +0100 Subject: [PATCH 36/45] fix(s2-write): skip only the nodata the input declares when coarsening The writer masked a coarsened integer array's planned Zarr fill value, which is always 0, out of the block mean. Arrays that declare no nodata lost their zeros from the mean: the cloud and snow probabilities, where 0 is a valid value, and the atmosphere arrays in products that declare none. main averages those whole, so 14 coarsened arrays of an L2A product, and their STAC statistics, differed from main. The source readers now report the nodata an input array declares, in main's order: the CF `_FillValue` (a Zarr V2 array's `fill_value`, xarray's encoding, or the attribute), then the EOPF `fill_value` attribute. The writer carries that value down each pyramid chain and skips it alone. An array that declares none is averaged whole. Tests: both readers over each declaration, and generated probability and atmosphere levels equal to the plain block mean on seeded values that hold zeros. Assisted-by: ClaudeCode:claude-fable-5.2 Co-Authored-By: Claude Fable 5.2 --- src/eopf_geozarr/data_api/s2_write.py | 85 ++++++++++++++++++++------- tests/test_data_api/test_s2_write.py | 77 +++++++++++++++++++++++- 2 files changed, 138 insertions(+), 24 deletions(-) diff --git a/src/eopf_geozarr/data_api/s2_write.py b/src/eopf_geozarr/data_api/s2_write.py index bee341f8..24e19cf4 100644 --- a/src/eopf_geozarr/data_api/s2_write.py +++ b/src/eopf_geozarr/data_api/s2_write.py @@ -34,12 +34,13 @@ import zarr from pydantic_zarr.v3 import is_group_spec +from eopf_geozarr.conversion.encoding_utils import find_fill_value from eopf_geozarr.data_api.s2_plan import level_meters, plan_geozarr from eopf_geozarr.pyz.datatree import encoded_variable from eopf_geozarr.s2_optimization.s2_resampling import determine_variable_type if TYPE_CHECKING: - from pydantic_zarr.v3 import AnyArraySpec, AnyGroupSpec + from pydantic_zarr.v3 import AnyGroupSpec from zarr.abc.store import Store from eopf_geozarr.data_api.s2 import Sentinel2Root @@ -52,6 +53,16 @@ def values(self, path: str) -> np.ndarray | None: """The stored values of the array at `path`, or None if there is none.""" ... + def nodata(self, path: str) -> int | None: + """ + The integer nodata value the input declares for the array at `path`, in + stored units, or None when it declares none: the CF `_FillValue` (a Zarr + V2 array's `fill_value`, or the attribute) or the EOPF `fill_value` + attribute. A resampling mean skips this value and no other: an array + that declares no nodata is averaged whole, zeros included. + """ + ... + def is_group(self, path: str) -> bool: """Whether the input holds a group at `path`.""" ... @@ -61,6 +72,16 @@ def group_names(self, path: str) -> tuple[str, ...]: ... +def _integer_nodata(candidates: tuple[object, ...]) -> int | None: + """The first declared candidate, when it is a whole number (else None).""" + declared = next((value for value in candidates if value is not None), None) + if isinstance(declared, (bool, np.bool_)) or not isinstance( + declared, (int, float, np.integer, np.floating) + ): + return None + return int(declared) if float(declared).is_integer() else None + + class ZarrSourceReader: """`SourceReader` over the Zarr V2 store a product was read from.""" @@ -77,6 +98,16 @@ def values(self, path: str) -> np.ndarray | None: member = self._member(path) return np.asarray(member[...]) if isinstance(member, zarr.Array) else None + def nodata(self, path: str) -> int | None: + member = self._member(path) + if not isinstance(member, zarr.Array): + return None + # a Zarr V2 array's `fill_value` is what xarray reads as `_FillValue` + attrs = member.attrs + return _integer_nodata( + (member.metadata.fill_value, attrs.get("_FillValue"), attrs.get("fill_value")) + ) + def is_group(self, path: str) -> bool: return isinstance(self._member(path), zarr.Group) @@ -105,15 +136,24 @@ def _node(self, path: str) -> xr.DataTree | None: return None return member if isinstance(member, xr.DataTree) else None - def values(self, path: str) -> np.ndarray | None: + def _variable(self, path: str) -> tuple[str, xr.Variable] | None: node_path, _, name = path.rpartition("/") node = self._node(node_path) if node is None: return None variables = node.to_dataset(inherit=False).variables - if name not in variables: + return (name, variables[name]) if name in variables else None + + def values(self, path: str) -> np.ndarray | None: + found = self._variable(path) + return None if found is None else np.asarray(encoded_variable(*found).values) + + def nodata(self, path: str) -> int | None: + found = self._variable(path) + if found is None: return None - return np.asarray(encoded_variable(name, variables[name]).values) + # `find_fill_value` takes anything with `.encoding` and `.attrs` + return _integer_nodata((find_fill_value(found[1]),)) # type: ignore[arg-type] def is_group(self, path: str) -> bool: return self._node(path) is not None @@ -184,6 +224,8 @@ def _fill_pyramid(spec: AnyGroupSpec, source: SourceReader, output: zarr.Group, """ levels = sorted(spec.members, key=_level_meters) previous_data: dict[str, np.ndarray] = {} + # the nodata each variable's input declares, carried down the chain + nodata: dict[str, int | None] = {} previous_coords: dict[str, np.ndarray] = {} previous_meters: int | None = None for level_name in levels: @@ -196,7 +238,7 @@ def _fill_pyramid(spec: AnyGroupSpec, source: SourceReader, output: zarr.Group, native = source.is_group(level_path) data: dict[str, np.ndarray] = {} coords: dict[str, np.ndarray] = {} - for var, member in level_spec.members.items(): + for var in level_spec.members: if var == "spatial_ref": continue if var in ("x", "y"): @@ -210,7 +252,7 @@ def _fill_pyramid(spec: AnyGroupSpec, source: SourceReader, output: zarr.Group, ) else: data[var] = _level_variable( - member, + nodata, source, var, path, @@ -228,7 +270,7 @@ def _fill_pyramid(spec: AnyGroupSpec, source: SourceReader, output: zarr.Group, def _level_variable( - member: AnyArraySpec | AnyGroupSpec, + nodata: dict[str, int | None], source: SourceReader, var: str, base_path: str, @@ -239,25 +281,31 @@ def _level_variable( *, native: bool, ) -> np.ndarray: - """The data of one pyramid-level variable: copied, injected, or chained.""" + """ + The data of one pyramid-level variable: copied, injected, or chained. + `nodata` records, per variable, the nodata its input declares (from the + level it was last read from), which the resampling mean skips. + """ if native: values = source.values(f"{level_path}/{var}") if values is not None: + nodata[var] = source.nodata(f"{level_path}/{var}") return values # an injected band: resample from the finest input level that holds it injected = _finest_input_source(source, base_path, var, meters) if injected is None: msg = f"No input level finer than {meters} m holds the injected band {var!r}" raise ValueError(msg) - src_values, src_meters = injected - return _coarsen(src_values, meters // src_meters, var, _integer_fill(member)) + src_values, src_meters, src_path = injected + nodata[var] = source.nodata(src_path) + return _coarsen(src_values, meters // src_meters, var, nodata[var]) if previous_meters is None: msg = f"The finest planned level {level_path} is missing from the input source" raise ValueError(msg) if var not in previous_data: msg = f"Variable {var!r} of generated level {level_path} is missing from the previous level" raise ValueError(msg) - return _coarsen(previous_data[var], meters // previous_meters, var, _integer_fill(member)) + return _coarsen(previous_data[var], meters // previous_meters, var, nodata.get(var)) def _level_coordinate( @@ -289,7 +337,8 @@ def _coarsen(values: np.ndarray, factor: int, var: str, fill: int | None) -> np. Downsample one variable by `factor`, with the converter's arithmetic: classification masks take the window-centre pixel; everything else takes the block mean — NaN-skipping for floats, nodata-masked and rounded for - integers (an all-nodata window keeps the fill value). + integers (an all-nodata window keeps the fill value). `fill` is the + nodata the input declares; with None, integers are averaged whole. """ kind = determine_variable_type(var) rows = values.shape[0] // factor * factor @@ -333,8 +382,8 @@ def _window_mean(windows: np.ndarray, fill: int | None) -> np.ndarray: def _finest_input_source( source: SourceReader, base_path: str, var: str, meters: int -) -> tuple[np.ndarray, int] | None: - """The finest input level of this subtree holding `var`, with its metres.""" +) -> tuple[np.ndarray, int, str] | None: + """The finest input level of this subtree holding `var`, with its metres and path.""" candidates = sorted( (name for name in source.group_names(base_path) if _is_level_name(name)), key=_level_meters, @@ -345,16 +394,10 @@ def _finest_input_source( return None values = source.values(f"{base_path}/{name}/{var}") if values is not None: - return values, src_meters + return values, src_meters, f"{base_path}/{name}/{var}" return None -def _integer_fill(member: AnyArraySpec | AnyGroupSpec) -> int | None: - """The planned array's fill value, when it is the integer-nodata kind.""" - fill = getattr(member, "fill_value", None) - return fill if isinstance(fill, int) else None - - def _level_meters(name: str) -> int: """The resolution in metres of a level group the plan names (`level_meters`).""" meters = level_meters(name) diff --git a/tests/test_data_api/test_s2_write.py b/tests/test_data_api/test_s2_write.py index c5684502..e28d9fb8 100644 --- a/tests/test_data_api/test_s2_write.py +++ b/tests/test_data_api/test_s2_write.py @@ -14,7 +14,7 @@ import hashlib import json import warnings -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Any import numpy as np import pytest @@ -23,7 +23,12 @@ from pydantic_zarr.v3 import GroupSpec as GroupSpecV3 from eopf_geozarr.data_api.s2_plan import load_sentinel2 -from eopf_geozarr.data_api.s2_write import _coarsen, write_geozarr +from eopf_geozarr.data_api.s2_write import ( + DataTreeSourceReader, + ZarrSourceReader, + _coarsen, + write_geozarr, +) from ..conftest import create_zarrv2_group_from_json, get_stem, s2_example_json_paths @@ -49,6 +54,7 @@ "conditions/mask/l2a_classification/r20m/scl", "conditions/mask/l1c_classification/r60m/b00", "measurements/reflectance/r10m/b08", + "quality/probability/r20m/cld", ) #: The L2A product used for the value-semantics checks. @@ -145,6 +151,14 @@ def _reference_block_mean(values: np.ndarray, factor: int, fill: int) -> np.ndar return np.where(np.isnan(mean), fill, np.round(mean)).astype(values.dtype) +def _reference_plain_mean(values: np.ndarray, factor: int) -> np.ndarray: + """The block mean of every value, rounded: no value is nodata.""" + rows = values.shape[0] // factor * factor + cols = values.shape[1] // factor * factor + windows = values[:rows, :cols].reshape(rows // factor, factor, cols // factor, factor) + return np.round(windows.astype("float64").mean(axis=(1, 3))).astype(values.dtype) + + @pytest.mark.parametrize("source_path", s2_example_json_paths, ids=get_stem) def test_write_geozarr_realizes_the_plan(source_path: pathlib.Path, tmp_path: pathlib.Path) -> None: """ @@ -171,7 +185,9 @@ def test_write_geozarr_data_semantics(tmp_path: pathlib.Path) -> None: mean of the finest input level holding them, generated levels chain from the previous level (mean for bands and probabilities, window-centre pixel for the classification), coordinates take window means, and grid-mapping - arrays hold zero. + arrays hold zero. The mean skips only the nodata the input declares: the + bands declare 0, the probabilities and atmosphere arrays declare none, so + their zeros (a valid probability) count. """ _, source, output = _written_store(_L2A_PATH, tmp_path) @@ -193,6 +209,18 @@ def read(group: zarr.Group, path: str) -> np.ndarray: generated = read(output, "measurements/reflectance/r120m/b01") np.testing.assert_array_equal(generated, _reference_block_mean(native, 2, 0)) + # a generated level of an array that declares no nodata is the plain block + # mean of the previous level, zeros included + for path, name, finer, coarser, factor in ( + ("quality/probability", "cld", "r20m", "r60m", 3), + ("quality/atmosphere", "aot", "r60m", "r120m", 2), + ): + previous = read(output, f"{path}/{finer}/{name}") + assert (previous == 0).any(), "fixture precondition: the seeded values hold zeros" + plain = _reference_plain_mean(previous, factor) + assert not np.array_equal(plain, _reference_block_mean(previous, factor, 0)) + np.testing.assert_array_equal(read(output, f"{path}/{coarser}/{name}"), plain) + # a generated classification level takes each window's centre pixel scl_native = read(output, "conditions/mask/l2a_classification/r60m/scl") scl_generated = read(output, "conditions/mask/l2a_classification/r120m/scl") @@ -299,3 +327,46 @@ def test_write_geozarr_from_a_datatree_matches_the_store_write( tree_output = tmp_path / f"from_tree_{mask_and_scale}.zarr" write_geozarr(load_sentinel2(tree), tree, str(tree_output)) assert _store_contents(tree_output) == reference, f"{mask_and_scale=}" + + +@pytest.mark.parametrize( + ("fill_value", "attributes", "expected"), + [ + (0, {}, 0), + (None, {"_FillValue": 255}, 255), + (None, {"fill_value": 0}, 0), + (7, {"_FillValue": 255, "fill_value": 0}, 7), + (None, {"_FillValue": 255, "fill_value": 0}, 255), + (None, {}, None), + (None, {"fill_value": "NaN"}, None), + ], + ids=[ + "zarr-fill-value", + "cf-attribute", + "eopf-attribute", + "zarr-fill-value-first", + "cf-before-eopf", + "undeclared", + "not-a-number", + ], +) +def test_source_readers_report_the_declared_nodata( + fill_value: int | None, attributes: dict[str, Any], expected: int | None +) -> None: + """ + Both source readers report the nodata an input array declares, in the + converter's order: the CF `_FillValue` (a Zarr V2 array's `fill_value`, + xarray's encoding, or the attribute), then the EOPF `fill_value` + attribute; an array that declares none has none. + """ + group = zarr.open_group({}, mode="w", zarr_format=2) + group.create_array( + "level/var", shape=(2, 2), dtype="uint8", fill_value=fill_value + ).attrs.update(attributes) + assert ZarrSourceReader(group).nodata("level/var") == expected + + variable = xr.DataArray(np.zeros((2, 2), dtype="uint8"), dims=["y", "x"], attrs=attributes) + if fill_value is not None: + variable.encoding["_FillValue"] = fill_value + tree = xr.DataTree.from_dict({"level": xr.Dataset({"var": variable})}) + assert DataTreeSourceReader(tree).nodata("level/var") == expected From 0af84b4fe292448b03a7bec111197d141849bd3b Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Mon, 16 Nov 2026 08:13:58 +0100 Subject: [PATCH 37/45] refactor(s2-optimization): keep main's Sentinel-2 writer and leave the plan unwired Restore the Sentinel-2 converter, the DataTree pyramid writer, the CLI, the CPM writer, their docs, tests and output snapshots to their state on main, and remove the plan-driven writer (`data_api/s2_write.py`) with its tests. This branch now only adds the pydantic models: the pydantic-zarr 0.11 and zarr-metadata 0.8 move, the GeoZarr scope, the Sentinel-2 input model and the output plan (`data_api/s2_plan.py`). `convert_s2_optimized` writes what it writes on main. The plan-driven writer moves to a follow-up change stacked on this one. Assisted-by: ClaudeCode:claude-fable-5.2 Co-Authored-By: Claude Fable 5.2 --- README.md | 7 +- docs/api-reference.md | 31 +- docs/converter.md | 40 +- docs/cpm-driver.md | 6 +- docs/examples.md | 12 +- docs/faq.md | 13 +- src/eopf_geozarr/cli.py | 33 +- src/eopf_geozarr/conversion/utils.py | 17 +- src/eopf_geozarr/cpm/writer.py | 9 +- src/eopf_geozarr/data_api/s2_write.py | 419 ------- .../s2_optimization/s2_converter.py | 331 +++--- .../s2_optimization/s2_multiscale.py | 719 +++++++++++- ...041_N0511_R122_T32TQM_20251008T122613.json | 685 ++++++----- ...309_N0511_R108_T32TLQ_20250113T122458.json | 121 +- ...131_N0511_R037_T29TPF_20250811T152216.json | 1015 ++++++++++------- tests/test_cpm_writer.py | 29 +- tests/test_data_api/test_s2_write.py | 372 ------ tests/test_s2_converter_simplified.py | 125 +- tests/test_s2_multiscale.py | 914 ++++++++++++++- tests/test_titiler_integration.py | 8 +- 20 files changed, 3079 insertions(+), 1827 deletions(-) delete mode 100644 src/eopf_geozarr/data_api/s2_write.py delete mode 100644 tests/test_data_api/test_s2_write.py diff --git a/README.md b/README.md index 53a989cc..cc52331e 100644 --- a/README.md +++ b/README.md @@ -89,10 +89,9 @@ for every command, including Sentinel-1 GRD RTC ingestion. - **Native projections**: no reprojection to Web Mercator. - **Multiscale pyramids** for fast visualization at every zoom level. - **Source packing kept**: reflectance stays as packed integers with CF - `scale_factor`/`add_offset`/`_FillValue`, as in the ESA products. On the - generic rechunker pipeline, `--scale-offset-codec` stores the packing with - the Zarr `scale_offset` + `cast_value` codecs instead, so Zarr readers get - decoded values. + `scale_factor`/`add_offset`/`_FillValue`, as in the ESA products. + `--scale-offset-codec` stores the packing with the Zarr `scale_offset` + + `cast_value` codecs instead, so Zarr readers get decoded values. - **Validation**: `eopf-geozarr validate` checks a store against the mini spec. GeoZarr is a set of modular [Zarr conventions](https://geozarr.org/conventions) diff --git a/docs/api-reference.md b/docs/api-reference.md index 3a0020da..0dc3fe5f 100644 --- a/docs/api-reference.md +++ b/docs/api-reference.md @@ -38,34 +38,31 @@ convert_s2_optimized( dt_input: xr.DataTree, *, output_path: str, - enable_sharding: bool = True, - spatial_chunk: int = 1024, - compression_level: int = 3, - validate_output: bool = True, + enable_sharding: bool, + spatial_chunk: int, + compression_level: int, + validate_output: bool, scale_offset_codec: bool = False, ) -> xr.DataTree ``` Converts a Sentinel-2 L1C or L2A DataTree to the optimized pyramid -(`r10m` … `r720m`). All arguments after `dt_input` are keyword-only. +(`r10m` … `r720m`). All arguments after `dt_input` are keyword-only, and all +without a default are required. | Argument | Description | |---|---| | `output_path` | Local path or `s3://` URL of the output store. | -| `enable_sharding` | Must be `True` (the default): the write policy fixes sharding on. | -| `spatial_chunk` | Must be `1024` (the default): the policy's inner chunk size. | -| `compression_level` | Must be `3` (the default): the policy's blosc zstd level. | +| `enable_sharding` | Enable Zarr v3 sharding. | +| `spatial_chunk` | Spatial chunk size (the CLI default is 256). | +| `compression_level` | Blosc zstd level, 1–9. | | `validate_output` | Validate the output after writing. | -| `scale_offset_codec` | Must be `False` (the default): the output keeps the ESA layout with CF scale attributes. See [Encoding](converter.md#encoding). | - -The layout arguments are accepted only at their defaults — the write policy is -fixed, and a deviating value raises `ValueError`. +| `scale_offset_codec` | `False` (default): ESA layout with CF scale attributes. `True`: pack reflectance with the Zarr `scale_offset` + `cast_value` codecs. See [Encoding](converter.md#encoding). | -The lower-level, spec-level API lives in `eopf_geozarr.data_api`: -`load_sentinel2(source)` validates a Zarr group or an xarray DataTree into the -`Sentinel2Root` input model, `plan_geozarr(root)` derives the output hierarchy -as a Zarr V3 `GroupSpec` tree, and `write_geozarr(root, source, store)` writes -the planned documents and fills in the chunk data. +`create_multiscale_from_datatree(dt_input, *, output_group, enable_sharding, +spatial_chunk, crs=None, scale_offset_codec=False, compression_level=3)` in +`eopf_geozarr.s2_optimization.s2_multiscale` is the lower-level function that +writes the pyramid into an open `zarr.Group`. ## Sentinel-3 OLCI: `convert_olci_optimized` diff --git a/docs/converter.md b/docs/converter.md index d365d931..1b014426 100644 --- a/docs/converter.md +++ b/docs/converter.md @@ -97,19 +97,19 @@ output.zarr/ - Coarser levels also get the finer bands (for example b08 at r20m, and all bands at r60m for L1C), so every level has a complete band set. - Each variable type gets its own resampling: mean for reflectance and - probabilities (nodata excluded), subsampling for classifications; quality - masks are carried at their native resolution, not resampled. - -The write layout is fixed: Zarr v3 sharding with 1024-pixel inner chunks, -blosc-zstd level 3, and the ESA packed-integer layout (see -[Encoding](#encoding)). There are no layout options. + probabilities (nodata excluded), subsampling for classifications, maximum + for quality masks. ```bash -eopf-geozarr convert-s2-optimized S2B_MSIL2A_….zarr output.zarr +eopf-geozarr convert-s2-optimized S2B_MSIL2A_….zarr output.zarr --enable-sharding ``` | Option | Default | Description | |---|---|---| +| `--spatial-chunk N` | 256 | Spatial chunk size. | +| `--enable-sharding` | off | Enable Zarr v3 sharding. | +| `--compression-level 1-9` | 3 | Blosc zstd compression level. | +| `--scale-offset-codec` | off | Store the packing with the Zarr scale-offset codecs instead of the ESA layout (see [Encoding](#encoding)). | | `--skip-validation` | off | Do not validate the output. | | `--dask-cluster` | off | Start a local Dask cluster. | | `--verbose` | off | Print more details. | @@ -124,25 +124,24 @@ dt_input = xr.open_datatree("S2B_MSIL2A_….zarr", engine="zarr", chunks={}) dt_output = convert_s2_optimized( dt_input, output_path="output.zarr", + enable_sharding=True, + spatial_chunk=256, + compression_level=3, validate_output=True, + scale_offset_codec=False, # default: ESA layout; True packs with Zarr codecs ) -# The layout keyword arguments (enable_sharding, spatial_chunk, -# compression_level, scale_offset_codec) are still accepted, but only at -# their default values — the write policy is fixed, and a deviating value -# raises ValueError. ``` ### Encoding Every level of the reflectance pyramid keeps the packing of the source product (for example `uint16`, `scale_factor` 0.0001, `add_offset` -0.1, nodata 0 for -S2 L2A). The Sentinel-2 pipeline always writes the ESA layout; the Zarr codec -mode remains available on the generic rechunker pipeline: +S2 L2A). One option selects how that packing is stored: -| Mode | Where | On disk | Metadata | +| Mode | Option | On disk | Metadata | |---|---|---|---| -| ESA layout | Sentinel-2 (always), generic rechunker (default) | Source integer dtype, no scale codecs | CF `scale_factor`, `add_offset` and `_FillValue` on the arrays | -| Zarr codec | generic rechunker with `--scale-offset-codec` / `scale_offset_codec=True` | Source integer dtype, packed by the Zarr `scale_offset` + `cast_value` codecs; the array's logical dtype is `float32` and its fill value is NaN | No CF scale attributes: Zarr readers return decoded values | +| Default: ESA layout | none | Source integer dtype, no scale codecs | CF `scale_factor`, `add_offset` and `_FillValue` on the arrays | +| Zarr codec | `--scale-offset-codec` / `scale_offset_codec=True` | Source integer dtype, packed by the Zarr `scale_offset` + `cast_value` codecs; the array's logical dtype is `float32` and its fill value is NaN | No CF scale attributes: Zarr readers return decoded values | What a reader needs: @@ -163,12 +162,9 @@ such as the classification and quality masks, keep their integer dtype and fill value in both modes. In the CPM writer (`eopf convert-geozarr --scale-offset-codec` or -`target_store_kwargs={"scale_offset_codec": True}`), the option applies to the -generic rechunker; on a Sentinel-2 product it deviates from the fixed write -policy and is refused with a `ValueError`. The former `keep_scale_offset` -option is still accepted for one release with a `DeprecationWarning`: -`keep_scale_offset=False` selects the codecs (and is therefore also refused -for Sentinel-2). +`target_store_kwargs={"scale_offset_codec": True}`), the former +`keep_scale_offset` option is still accepted for one release with a +`DeprecationWarning`: `keep_scale_offset=False` selects the codecs. ## Sentinel-3 OLCI conversion diff --git a/docs/cpm-driver.md b/docs/cpm-driver.md index e5c7269a..8a036c44 100644 --- a/docs/cpm-driver.md +++ b/docs/cpm-driver.md @@ -54,9 +54,9 @@ eopf convert-geozarr S2B_MSIL2A_….SAFE s3://bucket/path/out.zarr --stage-outpu | Option | Pipelines | Description | |---|---|---| -| `--spatial-chunk INTEGER` | all but Sentinel-3 OLCI | Spatial chunk size. Default: 4096 (generic), 1024 (generic rechunker, Sentinel-2). For Sentinel-2 the value is fixed by the write policy: anything other than 1024 is refused. Sentinel-3 OLCI accepts it but does not apply it yet. | -| `--enable-sharding` | generic, generic rechunker | Enable Zarr v3 sharding. Sentinel-2 output is always sharded (the flag is not applied); Sentinel-3 OLCI accepts it but does not apply it yet. | -| `--scale-offset-codec` | generic rechunker | Pack every packed variable with the Zarr `scale_offset` + `cast_value` codecs instead of the default ESA layout (CF `scale_factor`/`add_offset`/`_FillValue`). Refused for Sentinel-2, whose write policy fixes the ESA layout. See [Encoding](converter.md#encoding). | +| `--spatial-chunk INTEGER` | all but Sentinel-3 OLCI | Spatial chunk size. Default: 256 (Sentinel-2), 4096 (generic), 1024 (generic rechunker). Sentinel-3 OLCI accepts it but does not apply it yet. | +| `--enable-sharding` | all but Sentinel-3 OLCI | Enable Zarr v3 sharding. Sentinel-3 OLCI accepts it but does not apply it yet. | +| `--scale-offset-codec` | Sentinel-2, generic rechunker | Pack reflectance (or, on the generic rechunker, every packed variable) with the Zarr `scale_offset` + `cast_value` codecs instead of the default ESA layout (CF `scale_factor`/`add_offset`/`_FillValue`). See [Encoding](converter.md#encoding). | | `--output-grid TEXT` | Sentinel-3 OLCI | `native` (default) keeps the instrument swath geometry. A CRS string (for example `EPSG:4326`) warps the swath onto a regular grid. | | `--min-dimension INTEGER` | Sentinel-3 OLCI, generic | Minimum dimension of the coarsest overview level. Default: 256. | | `--groups TEXT` | generic | DataTree group to convert. Repeat the option for more groups. Required on the generic pipeline. | diff --git a/docs/examples.md b/docs/examples.md index 7b1ba21d..729bc52e 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -13,15 +13,15 @@ description: Examples for eopf-geozarr, the GeoZarr driver for EOPF CPM — conv Convert native products with CPM (see the [CPM driver guide](cpm-driver.md)): ```bash -# Sentinel-2 L2A SAFE to GeoZarr (the S2 layout is fixed: sharded, -# 1024-pixel chunks, blosc-zstd 3, ESA packed integers) -eopf convert-geozarr S2B_MSIL2A_….SAFE out.zarr +# Sentinel-2 L2A SAFE to GeoZarr, with sharding +eopf convert-geozarr S2B_MSIL2A_….SAFE out.zarr --enable-sharding # Sentinel-3 OLCI EFR on a regular WGS 84 grid eopf convert-geozarr S3A_OL_1_EFR____….SEN3 out.zarr --output-grid EPSG:4326 -# Sentinel-2 to S3: convert locally, then upload -eopf convert-geozarr S2B_MSIL2A_….SAFE s3://bucket/out.zarr --stage-output +# Sentinel-2 to S3, packed with the Zarr scale-offset codecs +eopf convert-geozarr S2B_MSIL2A_….SAFE s3://bucket/out.zarr \ + --stage-output --scale-offset-codec ``` ```python @@ -36,7 +36,7 @@ for safe in sorted(Path("inputs").glob("S2*_MSIL2A_*.SAFE")): convert( str(safe), f"outputs/{safe.stem}.zarr", - target_store_kwargs={"engine": "geozarr"}, + target_store_kwargs={"engine": "geozarr", "enable_sharding": True}, ) ``` diff --git a/docs/faq.md b/docs/faq.md index fbc00cdf..393d58eb 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -68,13 +68,12 @@ pip install "eopf-geozarr[cpm]" # or eopf-geozarr without the CPM driver ### Why are my reflectance values integers, or why do they have NaN? -eopf-geozarr keeps the packing of the source product. The arrays are packed -integers with CF `scale_factor`/`add_offset`/`_FillValue` attributes, as in -the ESA products: xarray applies them by default, but a plain Zarr reader -returns the integers. On the generic rechunker pipeline, -`--scale-offset-codec` stores the packing with the Zarr `scale_offset` + -`cast_value` codecs instead, and Zarr readers that support these codecs -return decoded values with NaN for nodata. See +eopf-geozarr keeps the packing of the source product. By default the arrays +are packed integers with CF `scale_factor`/`add_offset`/`_FillValue` +attributes, as in the ESA products: xarray applies them by default, but a +plain Zarr reader returns the integers. With `--scale-offset-codec`, the Zarr +`scale_offset` + `cast_value` codecs store the packing instead, and Zarr readers +that support these codecs return decoded reflectance with NaN for nodata. See [Encoding](converter.md#encoding). ### How do I set up AWS credentials? diff --git a/src/eopf_geozarr/cli.py b/src/eopf_geozarr/cli.py index 269dd742..a78b87f0 100755 --- a/src/eopf_geozarr/cli.py +++ b/src/eopf_geozarr/cli.py @@ -220,12 +220,14 @@ def convert_command(args: argparse.Namespace) -> None: log.info( "Detected Sentinel-2 input; using optimized flat multiscale layout " "(per-group options such as --groups/--crs-groups/--gcp-group/--min-dimension " - "do not apply, and the layout options --spatial-chunk/--enable-sharding are " - "fixed by the S2 write policy; pass --no-s2-optimized to force the generic path)" + "do not apply; pass --no-s2-optimized to force the generic path)" ) dt_geozarr = convert_s2_optimized( dt_input=dt, output_path=output_path, + enable_sharding=args.enable_sharding, + spatial_chunk=args.spatial_chunk, + compression_level=3, validate_output=True, ) # Opt-out flag first: skip the structural OLCI detection (a full @@ -1392,8 +1394,31 @@ def add_s2_optimization_commands(subparsers: argparse._SubParsersAction) -> None "input_path", type=str, help="Path to input Sentinel-2 dataset (Zarr format)" ) s2_parser.add_argument("output_path", type=str, help="Path for output optimized dataset") + s2_parser.add_argument( + "--spatial-chunk", + type=int, + default=256, + help="Spatial chunk size (default: 256)", + ) + s2_parser.add_argument("--enable-sharding", action="store_true", help="Enable Zarr v3 sharding") + s2_parser.add_argument( + "--compression-level", + type=int, + default=3, + choices=range(1, 10), + help="Compression level 1-9 (default: 3)", + ) s2_parser.add_argument("--skip-validation", action="store_true", help="Skip output validation") s2_parser.add_argument("--verbose", action="store_true", help="Enable verbose output") + s2_parser.add_argument( + "--scale-offset-codec", + action="store_true", + help=( + "Pack reflectance with the Zarr scale_offset + cast_value codecs. By default it " + "is written as in the ESA product: source integers with CF " + "scale_factor/add_offset/_FillValue and STAC raster:scale/raster:offset/nodata." + ), + ) s2_parser.add_argument( "--dask-cluster", action="store_true", @@ -1418,7 +1443,11 @@ def convert_s2_optimized_command(args: argparse.Namespace) -> None: convert_s2_optimized( dt_input=dt_input, output_path=args.output_path, + enable_sharding=args.enable_sharding, + spatial_chunk=args.spatial_chunk, + compression_level=args.compression_level, validate_output=not args.skip_validation, + scale_offset_codec=args.scale_offset_codec, ) log.info("S2 optimization completed", output_path=args.output_path) diff --git a/src/eopf_geozarr/conversion/utils.py b/src/eopf_geozarr/conversion/utils.py index cdf347f2..043ff56a 100644 --- a/src/eopf_geozarr/conversion/utils.py +++ b/src/eopf_geozarr/conversion/utils.py @@ -912,16 +912,13 @@ def build_convention_attrs( def add_multiscale_pyramids_to_stac_metadata( - datasets: Mapping[str, xr.Dataset | Sequence[str] | None], dt_attributes: dict[Hashable, Any] + datasets: Mapping[str, object], dt_attributes: dict[Hashable, Any] ) -> dict[Hashable, Any]: """Add a `stac_discovery` asset for every written array that no asset references yet. Covers the multiscale levels and the bands injected into native levels (e.g. b08 - in r20m/r60m), so every band can carry its STAC statistics. `datasets` maps each - written dataset group path to the dataset itself or to its data variable names - (the plan-driven writer passes names), with multiscale pyramid roots mapped to - None. A new asset is keyed `_` (e.g. `b02_r120m`); a key - already in use is not replaced. + in r20m/r60m), so every band can carry its STAC statistics. A new asset is keyed + `_` (e.g. `b02_r120m`); a key already in use is not replaced. """ stac_attrs = dt_attributes.get("stac_discovery", {}).get("assets") if not stac_attrs: @@ -934,12 +931,14 @@ def add_multiscale_pyramids_to_stac_metadata( } for group_path, ds in datasets.items(): - # multiscale roots (mapped to None) hold no variables of their own if ds is None: continue - var_names = tuple(str(name) for name in ds.data_vars) if isinstance(ds, xr.Dataset) else ds + # catch object != dataset for typing + if not isinstance(ds, xr.Dataset): + log.warning("Found non-dataset object in datasets!", dataset=ds) + continue resolution = group_path.rsplit("/", 1)[-1] # "r120m" - for var_name in var_names: + for var_name in ds.data_vars: href = f"{group_path}/{var_name}" if var_name == "spatial_ref" or href.strip("/") in existing_hrefs: continue diff --git a/src/eopf_geozarr/cpm/writer.py b/src/eopf_geozarr/cpm/writer.py index 5a5e472e..b83892e5 100644 --- a/src/eopf_geozarr/cpm/writer.py +++ b/src/eopf_geozarr/cpm/writer.py @@ -71,7 +71,7 @@ #: Default spatial chunk size per pipeline, matching the eopf-geozarr CLI. _DEFAULT_SPATIAL_CHUNK = { - "s2-optimized": 1024, + "s2-optimized": 256, "s3-olci-optimized": 1024, "generic": 4096, "generic-rechunker": 1024, @@ -256,15 +256,10 @@ def write( ) if selected_pipeline == "s2-optimized": - # The plan-driven S2 writer has a fixed write policy. The options - # whose explicit deviation is detectable (spatial_chunk, - # compression_level, scale_offset_codec) are forwarded so the - # policy check refuses them loudly; enable_sharding is not, - # because sharding is fixed on and this writer's own default - # (False) is indistinguishable from an explicit False. return convert_s2_optimized( dt_input=dtree, output_path=output_path, + enable_sharding=enable_sharding, spatial_chunk=resolved_spatial_chunk, compression_level=compression_level, validate_output=validate_output, diff --git a/src/eopf_geozarr/data_api/s2_write.py b/src/eopf_geozarr/data_api/s2_write.py deleted file mode 100644 index 24e19cf4..00000000 --- a/src/eopf_geozarr/data_api/s2_write.py +++ /dev/null @@ -1,419 +0,0 @@ -""" -Realize the Sentinel-2 GeoZarr plan: the data plane. - -`write_geozarr` writes the hierarchy that `eopf_geozarr.data_api.s2_plan` -describes, without xarray's DataTree writer. The planned metadata documents -are written first, via pydantic-zarr's `to_zarr`, so every stored document is -exactly the plan; the chunk data is then filled in with zarr-python alone. -The input is read through a small `SourceReader` protocol — a Zarr V2 store -directly, or an xarray DataTree whose variables are read as xarray's zarr -writer would store them (CF-encoded), so a tree built in memory or backed by -a Zarr V3 store feeds the writer without a scratch copy. -Native arrays are copied from the input, and the derived arrays are -block-resampled with the converter's arithmetic: injected bands come from the -finest input level that holds them, generated pyramid levels are chained from -the level before them, measurements and probabilities are reduced by the -nodata-masked block mean (rounded for integer data), classification masks -take the window-centre pixel, and coordinates take the window mean. - -The write order is metadata first, per array: a reader that opens the store -mid-write sees complete, valid documents (absent chunks read as the fill -value). Product-level publication — root attributes, consolidated metadata, -the STAC item — is not written here and stays the converter pipeline's final, -separate step, so consumers that discover the product through the root never -see a partially filled store. -""" - -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Protocol - -import numpy as np -import xarray as xr -import zarr -from pydantic_zarr.v3 import is_group_spec - -from eopf_geozarr.conversion.encoding_utils import find_fill_value -from eopf_geozarr.data_api.s2_plan import level_meters, plan_geozarr -from eopf_geozarr.pyz.datatree import encoded_variable -from eopf_geozarr.s2_optimization.s2_resampling import determine_variable_type - -if TYPE_CHECKING: - from pydantic_zarr.v3 import AnyGroupSpec - from zarr.abc.store import Store - - from eopf_geozarr.data_api.s2 import Sentinel2Root - - -class SourceReader(Protocol): - """Read access to the conversion input, by output-plan path.""" - - def values(self, path: str) -> np.ndarray | None: - """The stored values of the array at `path`, or None if there is none.""" - ... - - def nodata(self, path: str) -> int | None: - """ - The integer nodata value the input declares for the array at `path`, in - stored units, or None when it declares none: the CF `_FillValue` (a Zarr - V2 array's `fill_value`, or the attribute) or the EOPF `fill_value` - attribute. A resampling mean skips this value and no other: an array - that declares no nodata is averaged whole, zeros included. - """ - ... - - def is_group(self, path: str) -> bool: - """Whether the input holds a group at `path`.""" - ... - - def group_names(self, path: str) -> tuple[str, ...]: - """The names of the subgroups of the group at `path` (empty if none).""" - ... - - -def _integer_nodata(candidates: tuple[object, ...]) -> int | None: - """The first declared candidate, when it is a whole number (else None).""" - declared = next((value for value in candidates if value is not None), None) - if isinstance(declared, (bool, np.bool_)) or not isinstance( - declared, (int, float, np.integer, np.floating) - ): - return None - return int(declared) if float(declared).is_integer() else None - - -class ZarrSourceReader: - """`SourceReader` over the Zarr V2 store a product was read from.""" - - def __init__(self, group: zarr.Group) -> None: - self._group = group - - def _member(self, path: str) -> zarr.Group | zarr.Array | None: - try: - return self._group[path] - except KeyError: - return None - - def values(self, path: str) -> np.ndarray | None: - member = self._member(path) - return np.asarray(member[...]) if isinstance(member, zarr.Array) else None - - def nodata(self, path: str) -> int | None: - member = self._member(path) - if not isinstance(member, zarr.Array): - return None - # a Zarr V2 array's `fill_value` is what xarray reads as `_FillValue` - attrs = member.attrs - return _integer_nodata( - (member.metadata.fill_value, attrs.get("_FillValue"), attrs.get("fill_value")) - ) - - def is_group(self, path: str) -> bool: - return isinstance(self._member(path), zarr.Group) - - def group_names(self, path: str) -> tuple[str, ...]: - member = self._member(path) - return tuple(member.group_keys()) if isinstance(member, zarr.Group) else () - - -class DataTreeSourceReader: - """ - `SourceReader` over an xarray DataTree (a tree built in memory, or one - backed by a store in any zarr format). Values are read as xarray's zarr - writer would store them: CF-encoded, with `_FillValue` applied — the same - representation `group_spec_from_datatree` documents. - """ - - def __init__(self, tree: xr.DataTree) -> None: - self._tree = tree - - def _node(self, path: str) -> xr.DataTree | None: - if not path: - return self._tree - try: - member = self._tree[path] - except KeyError: - return None - return member if isinstance(member, xr.DataTree) else None - - def _variable(self, path: str) -> tuple[str, xr.Variable] | None: - node_path, _, name = path.rpartition("/") - node = self._node(node_path) - if node is None: - return None - variables = node.to_dataset(inherit=False).variables - return (name, variables[name]) if name in variables else None - - def values(self, path: str) -> np.ndarray | None: - found = self._variable(path) - return None if found is None else np.asarray(encoded_variable(*found).values) - - def nodata(self, path: str) -> int | None: - found = self._variable(path) - if found is None: - return None - # `find_fill_value` takes anything with `.encoding` and `.attrs` - return _integer_nodata((find_fill_value(found[1]),)) # type: ignore[arg-type] - - def is_group(self, path: str) -> bool: - return self._node(path) is not None - - def group_names(self, path: str) -> tuple[str, ...]: - node = self._node(path) - return tuple(node.children) if node is not None else () - - -#: Rows per stripe for the streamed block mean (a multiple of the coarsening -#: factor is taken per stripe, so windows never straddle a stripe boundary). -_MEAN_STRIPE_ROWS = 2048 - - -def write_geozarr( - root: Sentinel2Root, source: zarr.Group | xr.DataTree, store: Store | str -) -> AnyGroupSpec: - """ - Write the GeoZarr hierarchy planned from `root` to `store`, copying and - resampling chunk data from `source` — the Zarr V2 input store or the - xarray DataTree `root` was read from. Returns the plan that was written. - """ - reader: SourceReader = ( - DataTreeSourceReader(source) - if isinstance(source, xr.DataTree) - else ZarrSourceReader(source) - ) - plan = plan_geozarr(root, coordinate_values=reader.values) - # the metadata plane: every group and array document, exactly as planned - output = plan.to_zarr(store, path="") # type: ignore[arg-type] - _fill_group(plan, reader, output, "") - return plan - - -def _fill_group(spec: AnyGroupSpec, source: SourceReader, output: zarr.Group, path: str) -> None: - """Fill the data of every array under one planned group (recursively).""" - for name, member in spec.members.items(): - member_path = f"{path}/{name}".lstrip("/") - if is_group_spec(member): - attributes = member.attributes - if isinstance(attributes, Mapping) and "multiscales" in attributes: - _fill_pyramid(member, source, output, member_path) - else: - _fill_group(member, source, output, member_path) - else: - _fill_carried_array(source, output, member_path) - - -def _fill_carried_array(source: SourceReader, output: zarr.Group, path: str) -> None: - """Copy one carried array's data from the input (grid mappings hold 0).""" - out_array = _output_array(output, path) - if path.rsplit("/", 1)[-1] == "spatial_ref": - out_array[...] = 0 - return - values = source.values(path) - if values is None: - msg = f"The input source holds no array at {path!r}" - raise ValueError(msg) - out_array[...] = values - - -def _fill_pyramid(spec: AnyGroupSpec, source: SourceReader, output: zarr.Group, path: str) -> None: - """ - Fill one multiscale subtree, finest level first: native levels are copied - from the input (with their injected bands resampled from the finest - input level that holds them), and generated levels are chained from the - data of the level before them, as the converter chains them. - """ - levels = sorted(spec.members, key=_level_meters) - previous_data: dict[str, np.ndarray] = {} - # the nodata each variable's input declares, carried down the chain - nodata: dict[str, int | None] = {} - previous_coords: dict[str, np.ndarray] = {} - previous_meters: int | None = None - for level_name in levels: - level_spec = spec.members[level_name] - if not is_group_spec(level_spec): - msg = f"Planned pyramid member {path}/{level_name} is not a group" - raise TypeError(msg) - meters = _level_meters(level_name) - level_path = f"{path}/{level_name}" - native = source.is_group(level_path) - data: dict[str, np.ndarray] = {} - coords: dict[str, np.ndarray] = {} - for var in level_spec.members: - if var == "spatial_ref": - continue - if var in ("x", "y"): - coords[var] = _level_coordinate( - source, - f"{level_path}/{var}", - previous_coords.get(var), - meters, - previous_meters, - native=native, - ) - else: - data[var] = _level_variable( - nodata, - source, - var, - path, - level_path, - meters, - previous_meters, - previous_data, - native=native, - ) - for var, values in {**data, **coords}.items(): - _output_array(output, f"{level_path}/{var}")[...] = values - if "spatial_ref" in level_spec.members: - _output_array(output, f"{level_path}/spatial_ref")[...] = 0 - previous_data, previous_coords, previous_meters = data, coords, meters - - -def _level_variable( - nodata: dict[str, int | None], - source: SourceReader, - var: str, - base_path: str, - level_path: str, - meters: int, - previous_meters: int | None, - previous_data: dict[str, np.ndarray], - *, - native: bool, -) -> np.ndarray: - """ - The data of one pyramid-level variable: copied, injected, or chained. - `nodata` records, per variable, the nodata its input declares (from the - level it was last read from), which the resampling mean skips. - """ - if native: - values = source.values(f"{level_path}/{var}") - if values is not None: - nodata[var] = source.nodata(f"{level_path}/{var}") - return values - # an injected band: resample from the finest input level that holds it - injected = _finest_input_source(source, base_path, var, meters) - if injected is None: - msg = f"No input level finer than {meters} m holds the injected band {var!r}" - raise ValueError(msg) - src_values, src_meters, src_path = injected - nodata[var] = source.nodata(src_path) - return _coarsen(src_values, meters // src_meters, var, nodata[var]) - if previous_meters is None: - msg = f"The finest planned level {level_path} is missing from the input source" - raise ValueError(msg) - if var not in previous_data: - msg = f"Variable {var!r} of generated level {level_path} is missing from the previous level" - raise ValueError(msg) - return _coarsen(previous_data[var], meters // previous_meters, var, nodata.get(var)) - - -def _level_coordinate( - source: SourceReader, - coord_path: str, - previous: np.ndarray | None, - meters: int, - previous_meters: int | None, - *, - native: bool, -) -> np.ndarray: - """A level's x/y values: the input's at native levels, window means after.""" - if native: - values = source.values(coord_path) - if values is None: - msg = f"The input source holds no coordinate array at {coord_path!r}" - raise ValueError(msg) - return values - if previous is None or previous_meters is None: - msg = f"No previous level to derive the coordinate at {coord_path!r} from" - raise ValueError(msg) - factor = meters // previous_meters - size = previous.shape[0] // factor - return previous[: size * factor].reshape(size, factor).mean(axis=1) - - -def _coarsen(values: np.ndarray, factor: int, var: str, fill: int | None) -> np.ndarray: - """ - Downsample one variable by `factor`, with the converter's arithmetic: - classification masks take the window-centre pixel; everything else takes - the block mean — NaN-skipping for floats, nodata-masked and rounded for - integers (an all-nodata window keeps the fill value). `fill` is the - nodata the input declares; with None, integers are averaged whole. - """ - kind = determine_variable_type(var) - rows = values.shape[0] // factor * factor - cols = values.shape[1] // factor * factor - trimmed = values[:rows, :cols] - if kind == "classification": - offset = factor // 2 - return trimmed[offset::factor, offset::factor] - if kind not in ("reflectance", "probability"): - msg = f"Unknown/Unapplicable variable type {kind} for {var!r}" - raise ValueError(msg) - out = np.empty((rows // factor, cols // factor), dtype=values.dtype) - stripe = factor * max(1, _MEAN_STRIPE_ROWS // factor) - for row in range(0, rows, stripe): - block = trimmed[row : row + stripe] - windows = block.reshape(block.shape[0] // factor, factor, cols // factor, factor) - out[row // factor : (row + block.shape[0]) // factor] = _window_mean(windows, fill) - return out - - -def _window_mean(windows: np.ndarray, fill: int | None) -> np.ndarray: - """The converter's block-mean reduction over one (i, factor, j, factor) view.""" - if np.issubdtype(windows.dtype, np.floating): - # float values: nodata is NaN, the NaN-skipping mean excludes it, and - # an all-NaN window stays NaN (as xarray's skipna mean leaves it) - total = np.nansum(windows.astype("float64"), axis=(1, 3)) - count = np.sum(~np.isnan(windows), axis=(1, 3)) - mean = total / np.maximum(count, 1) - return np.where(count > 0, mean, np.nan).astype(windows.dtype) - as_float = windows.astype("float64") - if fill is None: - return np.round(as_float.mean(axis=(1, 3))).astype(windows.dtype) - # raw integers: mask nodata, average, round (a plain cast truncates), and - # keep the fill where a window holds nothing but nodata - mask = windows != fill - total = np.where(mask, as_float, 0.0).sum(axis=(1, 3)) - count = mask.sum(axis=(1, 3)) - mean = np.round(total / np.maximum(count, 1)) - return np.where(count > 0, mean, fill).astype(windows.dtype) - - -def _finest_input_source( - source: SourceReader, base_path: str, var: str, meters: int -) -> tuple[np.ndarray, int, str] | None: - """The finest input level of this subtree holding `var`, with its metres and path.""" - candidates = sorted( - (name for name in source.group_names(base_path) if _is_level_name(name)), - key=_level_meters, - ) - for name in candidates: - src_meters = _level_meters(name) - if src_meters >= meters: - return None - values = source.values(f"{base_path}/{name}/{var}") - if values is not None: - return values, src_meters, f"{base_path}/{name}/{var}" - return None - - -def _level_meters(name: str) -> int: - """The resolution in metres of a level group the plan names (`level_meters`).""" - meters = level_meters(name) - if meters is None: - msg = f"{name!r} is not a resolution level name" - raise ValueError(msg) - return meters - - -def _is_level_name(name: str) -> bool: - return level_meters(name) is not None - - -def _output_array(output: zarr.Group, path: str) -> zarr.Array: - member = output[path] - if not isinstance(member, zarr.Array): - msg = f"The planned store holds no array at {path!r}" - raise TypeError(msg) - return member diff --git a/src/eopf_geozarr/s2_optimization/s2_converter.py b/src/eopf_geozarr/s2_optimization/s2_converter.py index 1fc4e7c2..64583802 100644 --- a/src/eopf_geozarr/s2_optimization/s2_converter.py +++ b/src/eopf_geozarr/s2_optimization/s2_converter.py @@ -5,27 +5,28 @@ from __future__ import annotations import time -from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypedDict import structlog +import xarray as xr import zarr from pydantic import TypeAdapter -from pydantic_zarr.v3 import is_array_spec, is_group_spec from pyproj import CRS from eopf_geozarr.conversion import utils from eopf_geozarr.conversion.geozarr import get_zarr_group from eopf_geozarr.data_api.s1 import Sentinel1Root from eopf_geozarr.data_api.s2 import Sentinel2Root -from eopf_geozarr.data_api.s2_plan import load_sentinel2 -from eopf_geozarr.data_api.s2_write import write_geozarr -if TYPE_CHECKING: - from collections.abc import Sequence +from .s2_multiscale import ( + _AUX_MULTISCALES, + REFLECTANCE_MULTISCALE, + S2Type, + create_multiscale_from_datatree, +) - import xarray as xr - from pydantic_zarr.v3 import AnyGroupSpec +if TYPE_CHECKING: + from collections.abc import Mapping log = structlog.get_logger() @@ -138,53 +139,84 @@ def _validate_s2_input(dt_input: xr.DataTree) -> None: raise ValueError("Input dataset is not a Sentinel-2 product") -#: The write policy the spec-level plan fixes; `convert_s2_optimized` refuses -#: option values that deviate from it. -_PLAN_POLICY = ( - "sharding enabled, 1024-pixel inner chunks, blosc-zstd level 3, " - "and the ESA packed-integer layout (no scale_offset codec)" -) +def _multiscale_paths(dt_input: xr.DataTree, datasets: Mapping[str, object]) -> list[str]: + """Pyramid parent groups of the multiscales built for this product level. + Lists `/measurements/reflectance` and the auxiliary pyramids, each only if it + was actually written (i.e. has levels in `datasets`): not every processing + baseline carries every auxiliary group. + """ + s2_type = S2Type.from_datatree(dt_input) + return [ + spec.base_path + for spec in (REFLECTANCE_MULTISCALE, *_AUX_MULTISCALES) + if spec.applies_to(s2_type) + and any(path.startswith(spec.base_path + "/") for path in datasets) + ] -def convert_s2_optimized( + +def add_s2_stac_assets( dt_input: xr.DataTree, - *, - output_path: str, - enable_sharding: bool = True, - spatial_chunk: int = 1024, - compression_level: int = 3, - validate_output: bool = True, - scale_offset_codec: bool = False, -) -> xr.DataTree: + datasets: Mapping[str, object], + crs: CRS | None = None, +) -> None: + """Add the S2 pyramid levels and the reflectance pyramid as STAC assets. + + Updates `dt_input.attrs["stac_discovery"]` in place, so call it before + `updated_root_consolidation` writes the root metadata from those attributes. + This is a temporary fix that should move to eopf-stac. """ - Convert a Sentinel-2 product to the optimized GeoZarr layout. + if not dt_input.attrs: + return - The conversion is plan-driven: the input store is validated into the - `Sentinel2Root` model, `plan_geozarr` derives the output hierarchy from - the model's own metadata, and `write_geozarr` writes the planned - documents first and then fills in the chunk data. The write policy is - the plan's fixed policy, so the layout options must hold their default - values; a deviating value is refused. + # this can be used to add multiscale paths to the stac attributes + updated_stac_attrs = utils.add_multiscale_pyramids_to_stac_metadata(datasets, dt_input.attrs) - Args: - dt_input: Input Sentinel-2 DataTree. A tree opened from a Zarr V2 - store is read through its backing store; any other tree (built in - memory by the CPM SAFE reader, or backed by a Zarr V3 store) is - read through the tree itself, with its variables taken as - xarray's zarr writer would store them. - output_path: Output path - enable_sharding: Must be True (the plan's policy). - spatial_chunk: Must be 1024 (the plan's policy). - compression_level: Must be 3 (the plan's policy). - validate_output: Whether to validate the output - scale_offset_codec: Must be False: the output is written as in the - ESA product (packed integers with CF `scale_factor` / - `add_offset` / `_FillValue`). + # Reference the pyramid root group, not the individual levels. That + # group carries the `multiscales` attribute, and the + # `profile=multiscales` media-type parameter tells a consumer to look + # for it there and resolve the levels from the convention itself. + stac = updated_stac_attrs.get("stac_discovery") + if stac is None: + return - Returns: - Optimized DataTree + reflectance_asset: dict[str, Any] = { + "href": "/measurements/reflectance", + "type": "application/vnd.zarr; version=3; profile=multiscales", + "title": "Surface Reflectance", + "roles": ["data", "reflectance"], + "gsd": 10, + } + + if crs is not None and crs.to_epsg() is not None: + reflectance_asset.update(utils.proj_attrs_for_crs(crs)) + + base = datasets.get("/measurements/reflectance/r10m") + if isinstance(base, xr.Dataset): + reflectance_asset["proj:shape"] = [base.sizes["y"], base.sizes["x"]] + + stac.setdefault("assets", {})["reflectance"] = reflectance_asset + + +def convert_s2( + dt_input: xr.DataTree, + output_path: str, + validate_output: bool, + enable_sharding: bool, + spatial_chunk: int, +) -> xr.DataTree: """ + Convert S2 dataset to optimized structure. + Args: + dt_input: Input Sentinel-2 DataTree + output_path: Output path for optimized dataset + validate_output: Whether to validate the output + verbose: Enable verbose logging + + Returns: + Optimized DataTree + """ start_time = time.time() log.info( @@ -193,62 +225,30 @@ def convert_s2_optimized( output_path=output_path, ) - deviations = [ - name - for name, held in ( - ("enable_sharding=False", not enable_sharding), - (f"spatial_chunk={spatial_chunk}", spatial_chunk != 1024), - (f"compression_level={compression_level}", compression_level != 3), - ("scale_offset_codec=True", scale_offset_codec), - ) - if held - ] - if deviations: - msg = ( - f"The plan-driven S2 writer has a fixed write policy ({_PLAN_POLICY}); " - f"unsupported option(s): {', '.join(deviations)}" - ) - raise ValueError(msg) - _validate_s2_input(dt_input) - # Initialize CRS from dataset - crs = initialize_crs_from_dataset(dt_input) + # Step 1: Process data while preserving original structure + log.info("Step 1: Processing data with original structure preserved") - try: - backing: zarr.Group | None = get_zarr_group(dt_input) - except TypeError: - # A tree built in memory (the CPM SAFE reader) has no backing store. - backing = None - # A Zarr V2 store is the input model's native domain and is read directly; - # everything else (an in-memory tree, a V3-backed tree) is read through - # the tree's GroupSpec-shaped view — no scratch copy. - source: zarr.Group | xr.DataTree = ( - backing if backing is not None and backing.metadata.zarr_format == 2 else dt_input + # Step 2: Create multiscale pyramids for each group in the original structure + log.info("Step 2: Creating multiscale pyramids (preserving original hierarchy)") + datasets = create_multiscale_from_datatree( + dt_input, + output_group=zarr.open_group(output_path), + spatial_chunk=spatial_chunk, + enable_sharding=enable_sharding, ) - log.info("Step 1: Validating the input against the Sentinel-2 model") - root = load_sentinel2(source) - - log.info("Step 2: Writing the planned GeoZarr hierarchy") - plan = write_geozarr(root, source, output_path) + log.info("Created multiscale pyramids", num_groups=len(datasets)) # Step 3: Root-level consolidation log.info("Step 3: Final root-level metadata consolidation") - datasets = _planned_dataset_index(plan) - add_s2_stac_assets( - dt_input, datasets, crs=crs, reflectance_shape=_planned_reflectance_shape(plan) - ) + add_s2_stac_assets(dt_input, datasets) utils.updated_root_consolidation( dt_input=dt_input, output_path=output_path, datasets=datasets, - # the paths the plan maps to None are the multiscale pyramid roots - # (reflectance and the written aux pyramids alike), so the consolidated - # set follows the plan instead of a second policy table - additional_consolidate_paths=[ - path for path, variable_names in datasets.items() if variable_names is None - ], + additional_consolidate_paths=_multiscale_paths(dt_input, datasets), ) # Step 4: Validation @@ -269,92 +269,93 @@ def convert_s2_optimized( return result_dt -def _planned_dataset_index(plan: AnyGroupSpec) -> dict[str, tuple[str, ...] | None]: +def convert_s2_optimized( + dt_input: xr.DataTree, + *, + output_path: str, + enable_sharding: bool, + spatial_chunk: int, + compression_level: int, + validate_output: bool, + scale_offset_codec: bool = False, +) -> xr.DataTree: """ - The planned dataset paths, each mapped to its data variable names (an - array that is not a coordinate or the grid mapping), with multiscale - roots mapped to None — the bookkeeping the root consolidation reads, - matching what the DataTree writer's `processed_groups` carried. + Convenience function for S2 optimization. + + Args: + dt_input: Input Sentinel-2 DataTree + output_path: Output path + enable_sharding: Enable Zarr v3 sharding + spatial_chunk: Spatial chunk size + compression_level: Compression level 1-9 + validate_output: Whether to validate the output + scale_offset_codec: Pack reflectance with the Zarr `scale_offset` + + `cast_value` codecs. By default it is written as in the ESA + product: packed integers with CF `scale_factor` / `add_offset` / + `_FillValue` and STAC `raster:scale` / `raster:offset` / `nodata`. + + Returns: + Optimized DataTree """ - index: dict[str, tuple[str, ...] | None] = {} - - def walk(spec: AnyGroupSpec, path: str) -> None: - attributes = spec.attributes - if path and isinstance(attributes, Mapping) and "multiscales" in attributes: - index[path] = None - names = tuple( - name - for name, member in spec.members.items() - if is_array_spec(member) - and name != "spatial_ref" - and (member.dimension_names or ()) != (name,) - ) - if names: - index[path] = names - for name, member in spec.members.items(): - if is_group_spec(member): - walk(member, f"{path}/{name}") - - walk(plan, "") - return index - - -def _planned_reflectance_shape(plan: AnyGroupSpec) -> tuple[int, ...] | None: - """The (rows, cols) of the finest planned reflectance level, if present.""" - level = plan.get_path("measurements/reflectance/r10m") - if not is_group_spec(level): - return None - for member in level.members.values(): - if is_array_spec(member) and len(member.shape) == 2: - return tuple(member.shape) - return None + start_time = time.time() -def add_s2_stac_assets( - dt_input: xr.DataTree, - datasets: Mapping[str, Sequence[str] | None], - crs: CRS | None = None, - reflectance_shape: tuple[int, ...] | None = None, -) -> None: - """Add the S2 pyramid levels and the reflectance pyramid as STAC assets. + log.info( + "Starting S2 optimized conversion", + num_groups=len(dt_input.groups), + output_path=output_path, + ) + _validate_s2_input(dt_input) - `datasets` is the planned dataset index: every dataset group path mapped - to its data variable names, with multiscale roots mapped to None. - `reflectance_shape` is the finest reflectance level's (rows, cols) for the - asset's proj:shape. Updates `dt_input.attrs["stac_discovery"]` in place, - so call it before `updated_root_consolidation` writes the root metadata - from those attributes. This is a temporary fix that should move to - eopf-stac. - """ - if not dt_input.attrs: - return + # Initialize CRS from dataset + crs = initialize_crs_from_dataset(dt_input) - # this can be used to add multiscale paths to the stac attributes - updated_stac_attrs = utils.add_multiscale_pyramids_to_stac_metadata(datasets, dt_input.attrs) + # Step 1: Process data while preserving original structure + log.info("Step 1: Processing data with original structure preserved") - # Reference the pyramid root group, not the individual levels. That - # group carries the `multiscales` attribute, and the - # `profile=multiscales` media-type parameter tells a consumer to look - # for it there and resolve the levels from the convention itself. - stac = updated_stac_attrs.get("stac_discovery") - if stac is None: - return + # Step 2: Create multiscale pyramids for each group in the original structure + log.info("Step 2: Creating multiscale pyramids (preserving original hierarchy)") - reflectance_asset: dict[str, Any] = { - "href": "/measurements/reflectance", - "type": "application/vnd.zarr; version=3; profile=multiscales", - "title": "Surface Reflectance", - "roles": ["data", "reflectance"], - "gsd": 10, - } + output_group = zarr.open_group(output_path) - if crs is not None and crs.to_epsg() is not None: - reflectance_asset.update(utils.proj_attrs_for_crs(crs)) + datasets = create_multiscale_from_datatree( + dt_input, + output_group=output_group, + spatial_chunk=spatial_chunk, + enable_sharding=enable_sharding, + crs=crs, + scale_offset_codec=scale_offset_codec, + compression_level=compression_level, + ) - if reflectance_shape is not None: - reflectance_asset["proj:shape"] = list(reflectance_shape) + log.info("Created multiscale pyramids", num_groups=len(datasets)) - stac.setdefault("assets", {})["reflectance"] = reflectance_asset + # Step 3: Root-level consolidation + log.info("Step 3: Final root-level metadata consolidation") + add_s2_stac_assets(dt_input, datasets, crs=crs) + utils.updated_root_consolidation( + dt_input=dt_input, + output_path=output_path, + datasets=datasets, + additional_consolidate_paths=_multiscale_paths(dt_input, datasets), + ) + + # Step 4: Validation + if validate_output: + log.info("Step 4: Validating optimized dataset") + validation_results = validate_optimized_dataset(output_path) + if not validation_results["is_valid"]: + log.warning("Validation issues found", issues=validation_results["issues"]) + + # Create result DataTree + result_dt = utils.create_result_datatree(output_path) + + total_time = time.time() - start_time + log.info("Optimization complete", duration_seconds=round(total_time, 2)) + + utils.optimization_summary(dt_input, result_dt, output_path) + + return result_dt def is_sentinel2_dataset(group: zarr.Group) -> bool: diff --git a/src/eopf_geozarr/s2_optimization/s2_multiscale.py b/src/eopf_geozarr/s2_optimization/s2_multiscale.py index 4d871bfa..e4cbab47 100644 --- a/src/eopf_geozarr/s2_optimization/s2_multiscale.py +++ b/src/eopf_geozarr/s2_optimization/s2_multiscale.py @@ -1,25 +1,36 @@ """ -The Sentinel-2 multiscale policy tables. - -This module holds the declarative side of the S2 multiscale layout: the aux -pyramid groups and levels (`_AUX_MULTISCALES`, mirrored by the plan's -`AUX_MULTISCALE_LEVELS`) and the SCL flag vocabulary. The pyramids themselves -are planned by `eopf_geozarr.data_api.s2_plan` (whose -`REFLECTANCE_SCALE_LEVELS` is the reflectance policy) and written by -`eopf_geozarr.data_api.s2_write`; the former DataTree-based write path was -removed once the plan-driven writer reproduced its stores byte for byte. +Streaming multiscale pyramid creation for optimized S2 structure. +Uses lazy evaluation to minimize memory usage during dataset preparation. """ from __future__ import annotations from dataclasses import dataclass from enum import StrEnum -from typing import TYPE_CHECKING, Any +from itertools import pairwise +from typing import TYPE_CHECKING, Any, Literal, cast +import numpy as np +import rasterio.transform +import rioxarray # noqa: F401 # enables the .rio accessor +import structlog +import xarray as xr +import zarr +from affine import Affine +from zarr_cm import LayoutObject + +from eopf_geozarr.conversion import encoding_utils, utils from eopf_geozarr.cpm.routing import product_type_of +from eopf_geozarr.s2_optimization import s2_resampling +from eopf_geozarr.s2_optimization.s2_band_mapping import BAND_INFO + +from .s2_resampling import determine_variable_type if TYPE_CHECKING: - import xarray as xr + from pyproj import CRS + from zarr.core.common import JSON + from zarr_cm import MultiscalesAttrs, SpatialAttrs, Transform + SCL_VALUES = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] SCL_LABELS = [ @@ -44,6 +55,17 @@ SCL_NODATA = SCL_VALUES[SCL_LABELS.index("NO_DATA")] +def _declare_scl_nodata(dataset: xr.Dataset) -> xr.Dataset: + """Set the SCL NO_DATA class as `_FillValue` when the source declares no nodata value. + + Not all products declare one on SCL (e.g. Zarr v2 products and the r60m SCL of + Zarr v3 products), but some clients require a CF `_FillValue`. + """ + if "scl" in dataset.data_vars and encoding_utils.find_fill_value(dataset["scl"]) is None: + dataset["scl"].encoding["_FillValue"] = SCL_NODATA + return dataset + + class S2Type(StrEnum): L1C = "L1C" L2A = "L2A" @@ -66,9 +88,12 @@ def from_datatree(cls, dt: xr.DataTree) -> S2Type | None: return cls.from_filename(product_type_of(dt)) or cls.from_filename(dt.name) +log = structlog.get_logger() + + @dataclass(frozen=True) class MultiscaleSpec: - """A group that gets a multiscale pyramid.""" + """A group that gets a multiscale pyramid, as input to `generic_multiscales`.""" base_path: str """Group holding the pyramid levels, e.g. `/measurements/reflectance`.""" @@ -91,7 +116,12 @@ def applies_to(self, s2_type: S2Type | None) -> bool: return self.product_levels is None or s2_type in self.product_levels -# Auxiliary (non-reflectance) groups. Groups missing from the input are skipped. +REFLECTANCE_MULTISCALE = MultiscaleSpec( + base_path="/measurements/reflectance", + scale_levels=(10, 20, 60, 120, 360, 720), +) + +# Auxiliary (non-reflectance) groups. Groups missing from the input are skipped with a warning. _AUX_MULTISCALES: tuple[MultiscaleSpec, ...] = ( MultiscaleSpec( base_path="/conditions/mask/l2a_classification", @@ -114,3 +144,666 @@ def applies_to(self, s2_type: S2Type | None) -> bool: scale_levels=(60, 120, 360, 720), ), ) + +GEOMETRY_PATH = "/conditions/geometry" +"""Group of the sun and viewing angle grids (node-registered, in the tile CRS).""" + +MultiscalesFlavor = Literal["experimental_multiscales_convention"] + + +def _spatial_level_attrs(dataset: xr.Dataset) -> dict[str, list[float] | list[int]]: + """`spatial:shape` and `spatial:transform` for a multiscales layout entry. + + `write_dataset_geo_metadata` leaves out an all-zero transform, but the minispec requires + `spatial:transform` on every layout entry, so fall back to the coordinate grid. + """ + transform = dataset.attrs.get("spatial:transform") + if transform is None: + transform = ( + list(utils._preferred_spatial_transform(dataset)) + if utils._has_spatial_transform(dataset) + else [] + ) + return {"spatial:shape": dataset.attrs["spatial:shape"], "spatial:transform": transform} + + +def _coarsen_variable(var_name: str, var_data: xr.DataArray, factor: int) -> xr.DataArray: + """Coarsen a single variable using type-aware resampling. + + Dispatches to the appropriate coarsen reduction (mean, max, subsample) + based on `determine_variable_type`. Preserves encoding and dtype. + """ + var_type = determine_variable_type(var_name) + + coarsened = var_data.coarsen({"x": factor, "y": factor}, boundary="trim") + if var_type in ("reflectance", "probability"): + if np.issubdtype(var_data.dtype, np.floating): + # Decoded values: nodata is NaN, so skipping NaN excludes it from the mean. + result = coarsened.mean(skipna=True) # type: ignore[attr-defined] + else: + # Raw integers: mask nodata, average, and round before the integer cast + # (a plain cast truncates). + fill_value = encoding_utils.find_fill_value(var_data) + if fill_value is None: + result = coarsened.mean().round() # type: ignore[attr-defined] + else: + result = ( + var_data.where(var_data != fill_value) + .coarsen({"x": factor, "y": factor}, boundary="trim") + .mean(skipna=True) # type: ignore[attr-defined] + .round() + .fillna(fill_value) + ) + elif var_type == "classification": + result = coarsened.reduce(subsample_2) + else: + raise ValueError(f"Unknown/Unapplicable variable type {var_type}") + + # `xr.DataArray.astype` clears `.encoding`, so we capture it first and + # restore it on the cast result. Without this, downstream code that + # inspects encoding (e.g. to push CF scale-offset into a codec pipeline) + # would see an empty encoding on every coarsened level. + # The attributes can carry the CF packing (ESA layout), so keep them too: + # `where` and the arithmetic above do not always do so. + encoding = var_data.encoding + cast_result: xr.DataArray = result.astype(var_data.dtype) + cast_result.encoding = encoding + cast_result.attrs = dict(var_data.attrs) + return cast_result + + +def inject_missing_bands( + dataset: xr.Dataset, + dt_input: xr.DataTree, + target_resolution: int, + spatial_chunk: int, + *, + bands: set[str] | None = None, + scale_offset_codec: bool = False, +) -> xr.Dataset: + """Inject bands whose native resolution is finer than `target_resolution`. + + For each spectral band defined in `BAND_INFO` whose native resolution is + finer than `target_resolution`, this function checks whether the band is + already present in `dataset`. If not, it looks for the band in the + appropriate source group (e.g. `/measurements/reflectance/r10m`), + downsamples it by the coarsening operation aligned to ESA's S2-PDGS-MPC-ATBD-L2A + (block-mean), and merges it into `dataset`. + + Args: + dataset: The target-resolution dataset (e.g. the r20m or r60m + reflectance group). + dt_input: The full input DataTree (used to locate finer-resolution + source bands). + target_resolution: Target resolution in metres (e.g. 20 or 60). + spatial_chunk: Spatial chunk size + bands: If provided, only inject these band names. If `None` + (default), inject every eligible band from `BAND_INFO`. + scale_offset_codec: Encoding mode (see `normalize_packed`). It selects + the form of the injected packed bands: decoded float32 for the + Zarr codecs, packed integers for the ESA layout. + + Returns: + `dataset` with any missing finer-resolution bands added. + """ + for band_name, info in BAND_INFO.items(): + if bands is not None and band_name not in bands: + continue + native_res = info.native_resolution # type: ignore[attr-defined] + if native_res >= target_resolution: + continue + if band_name in dataset.data_vars: + continue + + source_path = f"/measurements/reflectance/r{native_res}m" + if source_path not in dt_input.groups: + continue + + source_ds = dt_input[source_path].to_dataset() + + if band_name not in source_ds.data_vars: + continue + + band_src = source_ds[band_name] + packing = encoding_utils.packing_of(band_src) + if packing is not None: + # Use the form of the encoding mode, so the injected band has the same + # dtype as the other bands and the mean skips nodata in both input forms. + band_src = encoding_utils.normalize_packed( + band_src, packing, scale_offset_codec=scale_offset_codec + ) + factor = target_resolution // native_res + band_ds = _coarsen_variable(band_name, band_src, factor) + + # Replace coordinates with the target dataset's coordinates so that + # xarray.Dataset.assign does not try to align on mismatched values. + band_ds = xr.DataArray( + band_ds.values, + dims=band_ds.dims, + coords={d: dataset.coords[d] for d in band_ds.dims if d in dataset.coords}, + attrs=band_src.attrs, + name=band_name, + ) + + # Preserve source encoding so downstream encoding logic can inspect it + band_ds.encoding = band_src.encoding.copy() + + dataset = dataset.assign({band_name: band_ds}) + log.info( + "Injected downsampled band from finer resolution", + band=band_name, + source=f"r{native_res}m", + target=f"r{target_resolution}m", + shape=band_ds.shape, + ) + + return utils._rechunk_ds(dataset, spatial_chunk) + + +def select_unique_variable_type(ds: xr.Dataset) -> str: + variable_types = { + s2_resampling.determine_variable_type(str(data_var)) for data_var in ds.data_vars + } + if len(variable_types) > 1: + err_msg = f"The given dataset contains multiple data variable types: {variable_types}. It is not possible to map them to a single variable type." + raise ValueError(err_msg) + + return next(iter(variable_types)) + + +def generic_multiscales( + spec: MultiscaleSpec, + src_processed_groups: dict[str, Any], + output_group: zarr.Group, + spatial_chunk: int, + enable_sharding: bool = True, + crs: CRS | None = None, + scale_offset_codec: bool = False, + compression_level: int = 3, +) -> dict[str, Any]: + base_path, scale_levels = spec.base_path, spec.scale_levels + finest_dataset_key = spec.finest_key + additional_attributes = spec.additional_attributes + # Create downsampled resolution groups + if finest_dataset_key not in src_processed_groups: + raise KeyError( + f"The given `finest_dataset_key` {finest_dataset_key} is not present in `src_processed_groups` {list(src_processed_groups.keys())} which is required for the correct calculation of multiscales." + ) + + # iterate over pre-defined pyramid-dict (or smth) and generate layout data -> use LayoutObject/... + current_level_name: str = finest_dataset_key + fine_base: xr.Dataset = src_processed_groups[finest_dataset_key] + + # determine variable type and subsequent resampling method for MS layout + variable_type = select_unique_variable_type(fine_base) + resampling_method = ( + "average" + if variable_type in ("reflectance", "probability") + else "nearest" + if variable_type == "classification" + else None + ) + + # only accept ('reflectance', 'probability', or 'classification') which arr covered by determine_variable_type(..) loudly fail for other input types, as they are not safely implemented yet + if resampling_method is None: + raise ValueError( + f"resampling method for MS generation is derived from variable_type {variable_type} and didnt match any from ('reflectance', 'probability', or 'classification')" + ) + + spatial_levels: dict[str, dict[str, list[float] | list[int]]] = { + finest_dataset_key: _spatial_level_attrs(fine_base) + } + + # predefined layout asset + layout_: list[dict[str, Any]] = [ + { + "asset": finest_dataset_key, + **spatial_levels[finest_dataset_key], + } + ] + + dst_processed_groups: dict[str, Any] = {f"{base_path}/{finest_dataset_key}": fine_base} + + # iterate over source, dest pairs: (60, 120), (120, 360), ... + for source_level, dest_level in pairwise(scale_levels): + src_level_name = f"r{source_level}m" + src_level_path = f"{base_path}/{src_level_name}" + + dest_level_name = f"r{dest_level}m" + dest_level_path = f"{base_path}/{dest_level_name}" + + # each step must be an exact integer factor (20->60 = 3, 60->120 = 2, ...) + if dest_level % source_level: + raise ValueError(f"{dest_level} m is not an integer multiple of {source_level} m") + downsample_factor = dest_level // source_level + + if dest_level_name in src_processed_groups: + # reuse the native group (e.g. reflectance r20m/r60m), no coarsening needed. + # Fails loudly afterwards if its geo metadata is missing. + ds_out = src_processed_groups[dest_level_name] + + # Store results + dst_processed_groups[dest_level_path] = ds_out + else: + source_ds = ( + src_processed_groups[src_level_name] + if src_level_name in src_processed_groups + else dst_processed_groups[src_level_path] + ) + + log.info( + "Creating level with resolution", + base_path=base_path, + level=dest_level_name, + resolution=dest_level, + ) + + # Create downsampled dataset by coarsening. The coarsened dask chunks follow + # the source level (rechunked to its shards on write), so rechunk to + # `spatial_chunk` like the native levels before deriving the encoding. + downsampled_dataset = utils._rechunk_ds( + create_downsampled_resolution_group(source_ds, factor=downsample_factor), + spatial_chunk, + ) + + log.info("Writing level to path", level=dest_level_name, output_path=dest_level_path) + + # Create encoding + encoding = utils.create_uniform_encoding( + downsampled_dataset, + enable_sharding=enable_sharding, + scale_offset_codec=scale_offset_codec, + compression_level=compression_level, + ) + + # Write dataset + ds_out = utils.stream_write_dataset( + downsampled_dataset, + path=dest_level_path, + group=output_group, + encoding=encoding, + add_geo_metadata=True, + crs=crs, + ) + + # Store results + dst_processed_groups[dest_level_path] = ds_out + + # determine multiscale metadata for all datasets + spatial_levels[dest_level_path] = _spatial_level_attrs(ds_out) + + # Nominal factor (ratio of pixel spacings), not the ratio of shapes: boundary="trim" + # gives e.g. 305 -> 152 px at r720m. Intentional, see #313. + transform: Transform = { + "scale": [downsample_factor, downsample_factor], + "translation": [0.0, 0.0], + } + lo = { + "asset": dest_level_name, + "derived_from": current_level_name, + "transform": transform, + **spatial_levels[dest_level_path], + } + + layout_.append(lo) + + current_level_name = dest_level_name + + # Step 3: Add multiscales metadata to parent groups + log.info("Adding multiscales metadata to parent groups") + + # Get the parent group (it was created when writing the resolution groups). + # `output_group[base_path]` is typed `Array | Group`; `base_path` always + # addresses a group (the reflectance parent), so verify that at runtime. + parent_group = output_group[base_path] + if not isinstance(parent_group, zarr.Group): + raise TypeError( + f"expected a zarr.Group at {base_path!r}, got {type(parent_group).__name__}" + ) + + # LayoutObject is a TypedDict (no validation); zarr_cm validates in build_convention_attrs + layout: list[LayoutObject] = [LayoutObject(**lo) for lo in layout_] + ms: MultiscalesAttrs = {"layout": layout, "resampling_method": resampling_method} + + # add geozarr attrs to base of /multiscales + fine_base_spatial = grid_spatial_attrs( + transform=Affine(*spatial_levels[finest_dataset_key]["spatial:transform"]), + shape=(fine_base.sizes["y"], fine_base.sizes["x"]), + ) + + conv = utils.build_convention_attrs(multiscales=ms, spatial=fine_base_spatial, crs=crs) + parent_group.attrs.update(cast("dict[str, JSON]", conv)) + + # Add `additional_attributes` to every level in one place. The finest level and + # levels reused from the source were written before this function ran, so the + # arrays on disk are updated as well as the in-memory datasets. + if additional_attributes is not None: + for level_path, level_ds in dst_processed_groups.items(): + for data_var in level_ds.data_vars: + level_ds[data_var].attrs.update(additional_attributes) + level_array = output_group[f"{level_path.lstrip('/')}/{data_var}"] + level_array.attrs.update(cast("dict[str, JSON]", additional_attributes)) + + # add it as none here to be recognized later and can be created as a zarr root with necessary metadata + dst_processed_groups[base_path] = None + + return dst_processed_groups + + +def grid_spatial_attrs(transform: Affine, shape: tuple[int, int]) -> SpatialAttrs: + """Spatial-convention data for a regular grid with an affine *transform*. + + *shape* is ``(height, width)``. Emits ``spatial:dimensions`` ``["y","x"]``, + pixel registration, the bounding box, and the 6-element row-major affine + transform. + """ + height, width = shape + left, bottom, right, top = rasterio.transform.array_bounds(height, width, transform) + return { + "spatial:dimensions": ["y", "x"], + "spatial:registration": "pixel", + "spatial:bbox": [float(left), float(bottom), float(right), float(top)], + "spatial:transform": [ + float(transform.a), + float(transform.b), + float(transform.c), + float(transform.d), + float(transform.e), + float(transform.f), + ], + } + + +def create_multiscale_from_datatree( + dt_input: xr.DataTree, + *, + output_group: zarr.Group, + enable_sharding: bool, + spatial_chunk: int, + crs: CRS | None = None, + scale_offset_codec: bool = False, + compression_level: int = 3, +) -> dict[str, dict]: + """ + Create multiscale versions preserving original structure. + Keeps all original groups, adds r120m, r360m, r720m downsampled versions. + + Args: + dt_input: Input DataTree with original structure + output_path: Base output path + enable_sharding: Enable Zarr v3 sharding + spatial_chunk: Spatial chunk size + crs: Coordinate Reference System for datasets + scale_offset_codec: Pack packed variables with the Zarr scale-offset + codecs. By default they are written with CF attributes, as in the + ESA product. + + Returns: + Dictionary of processed groups + """ + processed_groups: dict[str, Any] = {} + # The scale levels in the output data. 10, 20, 60 already exist in the source data. + + s2_type = S2Type.from_datatree(dt_input) + if s2_type is None: + log.warning( + "Could not determine S2 product level (L1C/L2A); no bands are injected", + product_type=product_type_of(dt_input), + name=dt_input.name, + ) + + # Step 1: Copy all original groups as-is + for group_path in dt_input.groups: + if group_path == ".": + continue + + # Skip the quicklook groups (`/quality/l1c_quicklook`, `/quality/l2a_quicklook`). + # They duplicate RGB data that downstream consumers can derive from the + # reflectance bands, so dropping them shrinks the output store and + # speeds up conversion. See EOPF-Explorer/data-model#81. + if group_path.startswith(("/quality/l1c_quicklook", "/quality/l2a_quicklook")): + log.info("Skipping quicklook group", group_path=group_path) + continue + + group_node = dt_input[group_path] + + # Skip parent groups that have children (only process leaf groups) + if hasattr(group_node, "children") and len(group_node.children) > 0: + continue + + base_dataset = group_node.to_dataset() + + # Skip empty groups + if not base_dataset.data_vars: + log.info("Skipping empty group", group_path=group_path) + continue + + log.info("Copying original group", group_path=group_path) + + dataset = _declare_scl_nodata(utils._rechunk_ds(base_dataset, spatial_chunk)) + + # Determine if this is a measurement-related resolution group + group_name = group_path.split("/")[-1] + is_measurement_group = ( + group_name.startswith("r") + and group_name.endswith("m") + and "/measurements/" in group_path + ) + + if is_measurement_group: + # Inject bands whose native resolution is finer than this group's + # (e.g. b08 native at 10m into r20m/r60m) so they propagate through + # the full overview chain (r120m … r720m). + if group_path.startswith("/measurements/reflectance/"): + try: + group_resolution = int(group_name[1:-1]) + except ValueError: + group_resolution = 0 + + # just add the b08 band + if s2_type == "L2A": + if group_resolution > 10: + dataset = inject_missing_bands( + dataset, + dt_input, + group_resolution, + spatial_chunk, + scale_offset_codec=scale_offset_codec, + bands={"b08"}, + ) + + # add all lower level bands here! + elif s2_type == "L1C": + if group_resolution == 20: + dataset = inject_missing_bands( + dataset, + dt_input, + group_resolution, + spatial_chunk, + scale_offset_codec=scale_offset_codec, + bands={ + "b02", + "b03", + "b04", + "b08", + }, + ) + elif group_resolution == 60: + dataset = inject_missing_bands( + dataset, + dt_input, + group_resolution, + spatial_chunk, + scale_offset_codec=scale_offset_codec, + bands={ + "b02", + "b03", + "b04", + "b08", + "b05", + "b06", + "b07", + "b8a", + "b11", + "b12", + }, + ) + + # Measurement groups: apply custom encoding + encoding = utils.create_uniform_encoding( + dataset, + enable_sharding=enable_sharding, + scale_offset_codec=scale_offset_codec, + compression_level=compression_level, + ) + + # convert float64 arrays to float32. `xr.DataArray.astype` clears + # encoding, so we capture and restore it — downstream pyramid + # levels are coarsened from this dataset and rely on the encoding + # to drive CF packing / codec filter generation. + for data_var in dataset.data_vars: + if dataset[data_var].dtype in (np.dtype("f8")): + var_encoding = dataset[data_var].encoding + dataset[data_var] = dataset[data_var].astype("float32") + dataset[data_var].encoding = var_encoding + + else: + # Non-measurement groups: preserve original encoding + encoding = utils.create_uniform_encoding( + dataset, + enable_sharding=enable_sharding, + scale_offset_codec=scale_offset_codec, + compression_level=compression_level, + ) + + # Drop scalar (0-D) coordinates such as a source `band` label: the + # minispec's DataArray rules forbid scalar arrays in a GeoZarr dataset. + scalar_coords = [name for name, coord in dataset.coords.items() if coord.ndim == 0] + if scalar_coords: + dataset = dataset.drop_vars(scalar_coords) + for name in scalar_coords: + encoding.pop(str(name), None) + + # The sun and viewing angle grids in `/conditions/geometry` are in the tile CRS. + # Their values are at the grid nodes: `(x[0], y[0])` is the upper-left corner + # of the tile, not the centre of a cell. + is_geometry_group = group_path == GEOMETRY_PATH + add_geo_metadata = is_geometry_group or any( + m in group_path for m in ("/measurements/", "/quality/", "/conditions/mask") + ) + ds_out = utils.stream_write_dataset( + dataset, + path=group_path, + group=output_group, + encoding=encoding, + add_geo_metadata=add_geo_metadata, + crs=crs, + registration="node" if is_geometry_group else "pixel", + ) + + processed_groups[group_path] = ds_out + + # iterate over auxiliary multisacles to generate non-measurement MS + for aux in _AUX_MULTISCALES: + if not aux.applies_to(s2_type): + continue + base_path, finest_key = aux.base_path, aux.finest_key + src_path = f"{base_path}/{finest_key}" + # Not every processing baseline carries every auxiliary group: skip, don't fail. + if src_path not in processed_groups: + log.warning( + "Skipping S2 auxiliary multiscales: source group missing from input", + base_path=base_path, + src_path=src_path, + product_level=s2_type, + ) + continue + + log.info("Adding multiscales for S2 auxiliary group", base_path=base_path) + # Pass every native level, so `generic_multiscales` reuses them instead of + # coarsening them again from the finest level. + native_levels = { + f"r{level}m": processed_groups[f"{base_path}/r{level}m"] + for level in aux.scale_levels + if f"{base_path}/r{level}m" in processed_groups + } + processed_groups.update( + generic_multiscales( + aux, + src_processed_groups=native_levels, + output_group=output_group, + spatial_chunk=spatial_chunk, + enable_sharding=enable_sharding, + crs=crs, + scale_offset_codec=scale_offset_codec, + compression_level=compression_level, + ) + ) + + # generate multiscales for "/measurements/reflectance" from its native r10m/r20m/r60m levels + reflectance_path = REFLECTANCE_MULTISCALE.base_path + log.info("Adding multiscales for S2 reflectance", base_path=reflectance_path) + measurement_processed_groups: dict[str, Any] = { + key: processed_groups[f"{reflectance_path}/{key}"] for key in ("r10m", "r20m", "r60m") + } + ms_measurement_processed_groups = generic_multiscales( + REFLECTANCE_MULTISCALE, + src_processed_groups=measurement_processed_groups, + output_group=output_group, + spatial_chunk=spatial_chunk, + enable_sharding=enable_sharding, + crs=crs, + scale_offset_codec=scale_offset_codec, + compression_level=compression_level, + ) + + # update processed groups with multiscale included groups, old instances of dataset are replaced, + # which is no issue as they were not touched + processed_groups.update(ms_measurement_processed_groups) + + return processed_groups + + +def create_downsampled_resolution_group(source_dataset: xr.Dataset, factor: int) -> xr.Dataset: + """Create a downsampled version of a dataset by given factor.""" + if not source_dataset or len(source_dataset.data_vars) == 0: + return xr.Dataset() + + # Get reference dimensions + ref_var = next(iter(source_dataset.data_vars.values())) + if ref_var.ndim < 2: + return xr.Dataset() + + current_height, current_width = ref_var.shape[-2:] + target_height = current_height // factor + target_width = current_width // factor + + if target_height < 1 or target_width < 1: + return xr.Dataset() + + # Downsample all variables using existing lazy operations + lazy_vars = {} + for var_name, var_data in source_dataset.data_vars.items(): + if var_data.ndim < 2: + continue + lazy_vars[var_name] = _coarsen_variable(str(var_name), var_data, factor) + + if not lazy_vars: + return xr.Dataset() + + # Create dataset with lazy variables and coordinates + return xr.Dataset(lazy_vars, attrs=source_dataset.attrs) + + +def subsample_2(a: xr.DataArray, axis: tuple[int, ...] | None = None) -> xr.DataArray: + """Pick the centre pixel of each coarsening window (nearest-neighbour). + + `coarsen` places the output coordinates at the window centres, so the + centre pixel keeps classification aligned with the averaged bands. For an + even window there is no single centre pixel and the lower-right one of the + middle four is taken. + """ + if axis is None: + axis = tuple(range(a.ndim)) + indexer = [a.shape[i] // 2 if i in axis else slice(None) for i in range(a.ndim)] + return a[tuple(indexer)] diff --git a/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json b/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json index fc94a22c..c98de997 100644 --- a/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json +++ b/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json @@ -5,7 +5,49 @@ "attributes": {}, "members": { "geometry": { - "attributes": {}, + "attributes": { + "grid_mapping": "spatial_ref", + "proj:code": "EPSG:32632", + "spatial:bbox": [ + 302386.95652173914, + 4892626.956521739, + 407413.04347826086, + 4997653.043478261 + ], + "spatial:dimensions": [ + "y", + "x" + ], + "spatial:registration": "node", + "spatial:shape": [ + 23, + 23 + ], + "spatial:transform": [ + 4773.913043478271, + 0.0, + 302386.95652173914, + 0.0, + -4773.913043478504, + 4997653.043478261 + ], + "zarr_conventions": [ + { + "description": "Spatial coordinate information", + "name": "spatial", + "schema_url": "https://raw.githubusercontent.com/zarr-conventions/spatial/refs/tags/v0.1/schema.json", + "spec_url": "https://github.com/zarr-conventions/spatial/blob/v0.1/README.md", + "uuid": "689b58e2-cf7b-45e0-9fff-9cfc0883d6b4" + }, + { + "description": "Coordinate reference system information for geospatial data", + "name": "proj", + "schema_url": "https://raw.githubusercontent.com/zarr-conventions/proj/refs/tags/v0.1/schema.json", + "spec_url": "https://github.com/zarr-conventions/proj/blob/v0.1/README.md", + "uuid": "f17cb550-5864-4468-aeb7-f3180cfb622f" + } + ] + }, "members": { "angle": { "attributes": {}, @@ -271,9 +313,65 @@ "storage_transformers": [], "zarr_format": 3 }, + "spatial_ref": { + "attributes": { + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "false_easting": 500000.0, + "false_northing": 0.0, + "geographic_crs_name": "WGS 84", + "grid_mapping_name": "transverse_mercator", + "horizontal_datum_name": "World Geodetic System 1984", + "inverse_flattening": 298.257223563, + "latitude_of_projection_origin": 0.0, + "longitude_of_central_meridian": 9.0, + "longitude_of_prime_meridian": 0.0, + "prime_meridian_name": "Greenwich", + "projected_crs_name": "WGS 84 / UTM zone 32N", + "reference_ellipsoid_name": "WGS 84", + "scale_factor_at_central_meridian": 0.9996, + "semi_major_axis": 6378137.0, + "semi_minor_axis": 6356752.314245179, + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + }, + "chunk_grid": { + "configuration": { + "chunk_shape": [] + }, + "name": "regular" + }, + "chunk_key_encoding": { + "configuration": { + "separator": "/" + }, + "name": "default" + }, + "codecs": [ + { + "configuration": { + "endian": "little" + }, + "name": "bytes" + }, + { + "configuration": { + "checksum": false, + "level": 0 + }, + "name": "zstd" + } + ], + "data_type": "int64", + "dimension_names": null, + "fill_value": 0, + "node_type": "array", + "shape": [], + "storage_transformers": [], + "zarr_format": 3 + }, "sun_angles": { "attributes": { - "_FillValue": "AAAAAAAA+H8=" + "_FillValue": "AAAAAAAA+H8=", + "grid_mapping": "spatial_ref" }, "chunk_grid": { "configuration": { @@ -351,7 +449,8 @@ }, "viewing_incidence_angles": { "attributes": { - "_FillValue": "AAAAAAAA+H8=" + "_FillValue": "AAAAAAAA+H8=", + "grid_mapping": "spatial_ref" }, "chunk_grid": { "configuration": { @@ -526,10 +625,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590240.0, - 809760.0, - 4700040.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -543,10 +642,10 @@ "spatial:transform": [ 10.0, 0.0, - 699960.0, + 300000.0, 0.0, -10.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -994,6 +1093,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -1085,10 +1185,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590240.0, - 809760.0, - 4700040.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -1102,10 +1202,10 @@ "spatial:transform": [ 20.0, 0.0, - 699960.0, + 300000.0, 0.0, -20.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -1743,6 +1843,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -1834,10 +1935,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590240.0, - 809760.0, - 4700040.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -1851,10 +1952,10 @@ "spatial:transform": [ 60.0, 0.0, - 699960.0, + 300000.0, 0.0, -60.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -2207,6 +2308,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -2310,10 +2412,10 @@ "spatial:transform": [ 60.0, 0.0, - 699960.0, + 300000.0, 0.0, -60.0, - 4700040.0 + 5000040.0 ] }, { @@ -2326,10 +2428,10 @@ "spatial:transform": [ 120.0, 0.0, - 699960.0, + 300000.0, 0.0, -120.0, - 4700040.0 + 5000040.0 ], "transform": { "scale": [ @@ -2352,10 +2454,10 @@ "spatial:transform": [ 360.0, 0.0, - 699960.0, + 300000.0, 0.0, -360.0, - 4700040.0 + 5000040.0 ], "transform": { "scale": [ @@ -2378,10 +2480,10 @@ "spatial:transform": [ 720.0, 0.0, - 699960.0, + 300000.0, 0.0, -720.0, - 4700040.0 + 5000040.0 ], "transform": { "scale": [ @@ -2399,10 +2501,10 @@ }, "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590240.0, - 809760.0, - 4700040.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -2412,10 +2514,10 @@ "spatial:transform": [ 60.0, 0.0, - 699960.0, + 300000.0, 0.0, -60.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -2447,10 +2549,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590240.0, - 809760.0, - 4700040.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -2464,10 +2566,10 @@ "spatial:transform": [ 120.0, 0.0, - 699960.0, + 300000.0, 0.0, -120.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -2633,6 +2735,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -2724,10 +2827,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590240.0, - 809760.0, - 4700040.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -2741,10 +2844,10 @@ "spatial:transform": [ 360.0, 0.0, - 699960.0, + 300000.0, 0.0, -360.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -2910,6 +3013,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -3001,10 +3105,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590240.0, - 809760.0, - 4700040.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -3018,10 +3122,10 @@ "spatial:transform": [ 60.0, 0.0, - 699960.0, + 300000.0, 0.0, -60.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -3194,6 +3298,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -3285,10 +3390,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590600.0, - 809400.0, - 4700040.0 + 300000.0, + 4890600.0, + 409440.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -3302,10 +3407,10 @@ "spatial:transform": [ 720.0, 0.0, - 699960.0, + 300000.0, 0.0, -720.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -3471,6 +3576,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -3574,10 +3680,10 @@ "spatial:transform": [ 20.0, 0.0, - 699960.0, + 300000.0, 0.0, -20.0, - 4700040.0 + 5000040.0 ] }, { @@ -3590,10 +3696,10 @@ "spatial:transform": [ 60.0, 0.0, - 699960.0, + 300000.0, 0.0, -60.0, - 4700040.0 + 5000040.0 ], "transform": { "scale": [ @@ -3616,10 +3722,10 @@ "spatial:transform": [ 120.0, 0.0, - 699960.0, + 300000.0, 0.0, -120.0, - 4700040.0 + 5000040.0 ], "transform": { "scale": [ @@ -3642,10 +3748,10 @@ "spatial:transform": [ 360.0, 0.0, - 699960.0, + 300000.0, 0.0, -360.0, - 4700040.0 + 5000040.0 ], "transform": { "scale": [ @@ -3668,10 +3774,10 @@ "spatial:transform": [ 720.0, 0.0, - 699960.0, + 300000.0, 0.0, -720.0, - 4700040.0 + 5000040.0 ], "transform": { "scale": [ @@ -3689,10 +3795,10 @@ }, "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590240.0, - 809760.0, - 4700040.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -3702,10 +3808,10 @@ "spatial:transform": [ 20.0, 0.0, - 699960.0, + 300000.0, 0.0, -20.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -3737,10 +3843,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590240.0, - 809760.0, - 4700040.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -3754,10 +3860,10 @@ "spatial:transform": [ 120.0, 0.0, - 699960.0, + 300000.0, 0.0, -120.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -3940,6 +4046,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -4031,10 +4138,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590240.0, - 809760.0, - 4700040.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -4048,10 +4155,10 @@ "spatial:transform": [ 20.0, 0.0, - 699960.0, + 300000.0, 0.0, -20.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -4241,6 +4348,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -4332,10 +4440,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590240.0, - 809760.0, - 4700040.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -4349,10 +4457,10 @@ "spatial:transform": [ 360.0, 0.0, - 699960.0, + 300000.0, 0.0, -360.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -4535,6 +4643,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -4626,10 +4735,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590240.0, - 809760.0, - 4700040.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -4643,10 +4752,10 @@ "spatial:transform": [ 60.0, 0.0, - 699960.0, + 300000.0, 0.0, -60.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -4836,6 +4945,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -4927,10 +5037,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590600.0, - 809400.0, - 4700040.0 + 300000.0, + 4890600.0, + 409440.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -4944,10 +5054,10 @@ "spatial:transform": [ 720.0, 0.0, - 699960.0, + 300000.0, 0.0, -720.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -5130,6 +5240,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -7232,10 +7343,10 @@ "spatial:transform": [ 10.0, 0.0, - 699960.0, + 300000.0, 0.0, -10.0, - 4700040.0 + 5000040.0 ] }, { @@ -7248,10 +7359,10 @@ "spatial:transform": [ 20.0, 0.0, - 699960.0, + 300000.0, 0.0, -20.0, - 4700040.0 + 5000040.0 ], "transform": { "scale": [ @@ -7274,10 +7385,10 @@ "spatial:transform": [ 60.0, 0.0, - 699960.0, + 300000.0, 0.0, -60.0, - 4700040.0 + 5000040.0 ], "transform": { "scale": [ @@ -7300,10 +7411,10 @@ "spatial:transform": [ 120.0, 0.0, - 699960.0, + 300000.0, 0.0, -120.0, - 4700040.0 + 5000040.0 ], "transform": { "scale": [ @@ -7326,10 +7437,10 @@ "spatial:transform": [ 360.0, 0.0, - 699960.0, + 300000.0, 0.0, -360.0, - 4700040.0 + 5000040.0 ], "transform": { "scale": [ @@ -7352,10 +7463,10 @@ "spatial:transform": [ 720.0, 0.0, - 699960.0, + 300000.0, 0.0, -720.0, - 4700040.0 + 5000040.0 ], "transform": { "scale": [ @@ -7373,10 +7484,10 @@ }, "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590240.0, - 809760.0, - 4700040.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -7386,10 +7497,10 @@ "spatial:transform": [ 10.0, 0.0, - 699960.0, + 300000.0, 0.0, -10.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -7421,10 +7532,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590240.0, - 809760.0, - 4700040.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -7438,10 +7549,10 @@ "spatial:transform": [ 10.0, 0.0, - 699960.0, + 300000.0, 0.0, -10.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -7921,6 +8032,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -8012,10 +8124,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590240.0, - 809760.0, - 4700040.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -8029,10 +8141,10 @@ "spatial:transform": [ 120.0, 0.0, - 699960.0, + 300000.0, 0.0, -120.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -9329,6 +9441,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -9420,10 +9533,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590240.0, - 809760.0, - 4700040.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -9437,10 +9550,10 @@ "spatial:transform": [ 20.0, 0.0, - 699960.0, + 300000.0, 0.0, -20.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -10641,6 +10754,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -10732,10 +10846,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590240.0, - 809760.0, - 4700040.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -10749,10 +10863,10 @@ "spatial:transform": [ 360.0, 0.0, - 699960.0, + 300000.0, 0.0, -360.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -12049,6 +12163,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -12140,10 +12255,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590240.0, - 809760.0, - 4700040.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -12157,10 +12272,10 @@ "spatial:transform": [ 60.0, 0.0, - 699960.0, + 300000.0, 0.0, -60.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -13464,6 +13579,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -13555,10 +13671,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590600.0, - 809400.0, - 4700040.0 + 300000.0, + 4890600.0, + 409440.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -13572,10 +13688,10 @@ "spatial:transform": [ 720.0, 0.0, - 699960.0, + 300000.0, 0.0, -720.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -14872,6 +14988,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -14982,10 +15099,10 @@ "spatial:transform": [ 10.0, 0.0, - 699960.0, + 300000.0, 0.0, -10.0, - 4700040.0 + 5000040.0 ] }, { @@ -14998,10 +15115,10 @@ "spatial:transform": [ 20.0, 0.0, - 699960.0, + 300000.0, 0.0, -20.0, - 4700040.0 + 5000040.0 ], "transform": { "scale": [ @@ -15024,10 +15141,10 @@ "spatial:transform": [ 60.0, 0.0, - 699960.0, + 300000.0, 0.0, -60.0, - 4700040.0 + 5000040.0 ], "transform": { "scale": [ @@ -15050,10 +15167,10 @@ "spatial:transform": [ 120.0, 0.0, - 699960.0, + 300000.0, 0.0, -120.0, - 4700040.0 + 5000040.0 ], "transform": { "scale": [ @@ -15076,10 +15193,10 @@ "spatial:transform": [ 360.0, 0.0, - 699960.0, + 300000.0, 0.0, -360.0, - 4700040.0 + 5000040.0 ], "transform": { "scale": [ @@ -15102,10 +15219,10 @@ "spatial:transform": [ 720.0, 0.0, - 699960.0, + 300000.0, 0.0, -720.0, - 4700040.0 + 5000040.0 ], "transform": { "scale": [ @@ -15123,10 +15240,10 @@ }, "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590240.0, - 809760.0, - 4700040.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -15136,10 +15253,10 @@ "spatial:transform": [ 10.0, 0.0, - 699960.0, + 300000.0, 0.0, -10.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -15171,10 +15288,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590240.0, - 809760.0, - 4700040.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -15188,10 +15305,10 @@ "spatial:transform": [ 10.0, 0.0, - 699960.0, + 300000.0, 0.0, -10.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -15355,6 +15472,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -15542,10 +15660,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590240.0, - 809760.0, - 4700040.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -15559,10 +15677,10 @@ "spatial:transform": [ 120.0, 0.0, - 699960.0, + 300000.0, 0.0, -120.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -15719,6 +15837,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -15906,10 +16025,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590240.0, - 809760.0, - 4700040.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -15923,10 +16042,10 @@ "spatial:transform": [ 20.0, 0.0, - 699960.0, + 300000.0, 0.0, -20.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -16090,6 +16209,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -16277,10 +16397,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590240.0, - 809760.0, - 4700040.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -16294,10 +16414,10 @@ "spatial:transform": [ 360.0, 0.0, - 699960.0, + 300000.0, 0.0, -360.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -16454,6 +16574,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -16641,10 +16762,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590240.0, - 809760.0, - 4700040.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -16658,10 +16779,10 @@ "spatial:transform": [ 60.0, 0.0, - 699960.0, + 300000.0, 0.0, -60.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -16825,6 +16946,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -17012,10 +17134,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590600.0, - 809400.0, - 4700040.0 + 300000.0, + 4890600.0, + 409440.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -17029,10 +17151,10 @@ "spatial:transform": [ 720.0, 0.0, - 699960.0, + 300000.0, 0.0, -720.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -17189,6 +17311,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -17383,10 +17506,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590240.0, - 809760.0, - 4700040.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -17400,10 +17523,10 @@ "spatial:transform": [ 10.0, 0.0, - 699960.0, + 300000.0, 0.0, -10.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -17931,6 +18054,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -18022,10 +18146,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590240.0, - 809760.0, - 4700040.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -18039,10 +18163,10 @@ "spatial:transform": [ 20.0, 0.0, - 699960.0, + 300000.0, 0.0, -20.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -18800,6 +18924,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -18891,10 +19016,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590240.0, - 809760.0, - 4700040.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -18908,10 +19033,10 @@ "spatial:transform": [ 60.0, 0.0, - 699960.0, + 300000.0, 0.0, -60.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -19324,6 +19449,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -19427,10 +19553,10 @@ "spatial:transform": [ 20.0, 0.0, - 699960.0, + 300000.0, 0.0, -20.0, - 4700040.0 + 5000040.0 ] }, { @@ -19443,10 +19569,10 @@ "spatial:transform": [ 60.0, 0.0, - 699960.0, + 300000.0, 0.0, -60.0, - 4700040.0 + 5000040.0 ], "transform": { "scale": [ @@ -19469,10 +19595,10 @@ "spatial:transform": [ 120.0, 0.0, - 699960.0, + 300000.0, 0.0, -120.0, - 4700040.0 + 5000040.0 ], "transform": { "scale": [ @@ -19495,10 +19621,10 @@ "spatial:transform": [ 360.0, 0.0, - 699960.0, + 300000.0, 0.0, -360.0, - 4700040.0 + 5000040.0 ], "transform": { "scale": [ @@ -19521,10 +19647,10 @@ "spatial:transform": [ 720.0, 0.0, - 699960.0, + 300000.0, 0.0, -720.0, - 4700040.0 + 5000040.0 ], "transform": { "scale": [ @@ -19542,10 +19668,10 @@ }, "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590240.0, - 809760.0, - 4700040.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -19555,10 +19681,10 @@ "spatial:transform": [ 20.0, 0.0, - 699960.0, + 300000.0, 0.0, -20.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -19590,10 +19716,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590240.0, - 809760.0, - 4700040.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -19607,10 +19733,10 @@ "spatial:transform": [ 120.0, 0.0, - 699960.0, + 300000.0, 0.0, -120.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -19859,6 +19985,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -19950,10 +20077,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590240.0, - 809760.0, - 4700040.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -19967,10 +20094,10 @@ "spatial:transform": [ 20.0, 0.0, - 699960.0, + 300000.0, 0.0, -20.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -20226,6 +20353,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -20317,10 +20445,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590240.0, - 809760.0, - 4700040.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -20334,10 +20462,10 @@ "spatial:transform": [ 360.0, 0.0, - 699960.0, + 300000.0, 0.0, -360.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -20586,6 +20714,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -20677,10 +20806,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590240.0, - 809760.0, - 4700040.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -20694,10 +20823,10 @@ "spatial:transform": [ 60.0, 0.0, - 699960.0, + 300000.0, 0.0, -60.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -20946,6 +21075,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -21037,10 +21167,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 699960.0, - 4590600.0, - 809400.0, - 4700040.0 + 300000.0, + 4890600.0, + 409440.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -21054,10 +21184,10 @@ "spatial:transform": [ 720.0, 0.0, - 699960.0, + 300000.0, 0.0, -720.0, - 4700040.0 + 5000040.0 ], "zarr_conventions": [ { @@ -21306,6 +21436,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], diff --git a/tests/_test_data/optimized_geozarr_examples/S2B_MSIL1C_20250113T103309_N0511_R108_T32TLQ_20250113T122458.json b/tests/_test_data/optimized_geozarr_examples/S2B_MSIL1C_20250113T103309_N0511_R108_T32TLQ_20250113T122458.json index 288ef61f..fdc6dcda 100644 --- a/tests/_test_data/optimized_geozarr_examples/S2B_MSIL1C_20250113T103309_N0511_R108_T32TLQ_20250113T122458.json +++ b/tests/_test_data/optimized_geozarr_examples/S2B_MSIL1C_20250113T103309_N0511_R108_T32TLQ_20250113T122458.json @@ -5,7 +5,49 @@ "attributes": {}, "members": { "geometry": { - "attributes": {}, + "attributes": { + "grid_mapping": "spatial_ref", + "proj:code": "EPSG:32632", + "spatial:bbox": [ + 302386.95652173914, + 4892626.956521739, + 407413.04347826086, + 4997653.043478261 + ], + "spatial:dimensions": [ + "y", + "x" + ], + "spatial:registration": "node", + "spatial:shape": [ + 23, + 23 + ], + "spatial:transform": [ + 4773.913043478271, + 0.0, + 302386.95652173914, + 0.0, + -4773.913043478504, + 4997653.043478261 + ], + "zarr_conventions": [ + { + "description": "Spatial coordinate information", + "name": "spatial", + "schema_url": "https://raw.githubusercontent.com/zarr-conventions/spatial/refs/tags/v0.1/schema.json", + "spec_url": "https://github.com/zarr-conventions/spatial/blob/v0.1/README.md", + "uuid": "689b58e2-cf7b-45e0-9fff-9cfc0883d6b4" + }, + { + "description": "Coordinate reference system information for geospatial data", + "name": "proj", + "schema_url": "https://raw.githubusercontent.com/zarr-conventions/proj/refs/tags/v0.1/schema.json", + "spec_url": "https://github.com/zarr-conventions/proj/blob/v0.1/README.md", + "uuid": "f17cb550-5864-4468-aeb7-f3180cfb622f" + } + ] + }, "members": { "angle": { "attributes": {}, @@ -271,9 +313,65 @@ "storage_transformers": [], "zarr_format": 3 }, + "spatial_ref": { + "attributes": { + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "false_easting": 500000.0, + "false_northing": 0.0, + "geographic_crs_name": "WGS 84", + "grid_mapping_name": "transverse_mercator", + "horizontal_datum_name": "World Geodetic System 1984", + "inverse_flattening": 298.257223563, + "latitude_of_projection_origin": 0.0, + "longitude_of_central_meridian": 9.0, + "longitude_of_prime_meridian": 0.0, + "prime_meridian_name": "Greenwich", + "projected_crs_name": "WGS 84 / UTM zone 32N", + "reference_ellipsoid_name": "WGS 84", + "scale_factor_at_central_meridian": 0.9996, + "semi_major_axis": 6378137.0, + "semi_minor_axis": 6356752.314245179, + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + }, + "chunk_grid": { + "configuration": { + "chunk_shape": [] + }, + "name": "regular" + }, + "chunk_key_encoding": { + "configuration": { + "separator": "/" + }, + "name": "default" + }, + "codecs": [ + { + "configuration": { + "endian": "little" + }, + "name": "bytes" + }, + { + "configuration": { + "checksum": false, + "level": 0 + }, + "name": "zstd" + } + ], + "data_type": "int64", + "dimension_names": null, + "fill_value": 0, + "node_type": "array", + "shape": [], + "storage_transformers": [], + "zarr_format": 3 + }, "sun_angles": { "attributes": { - "_FillValue": "AAAAAAAA+H8=" + "_FillValue": "AAAAAAAA+H8=", + "grid_mapping": "spatial_ref" }, "chunk_grid": { "configuration": { @@ -351,7 +449,8 @@ }, "viewing_incidence_angles": { "attributes": { - "_FillValue": "AAAAAAAA+H8=" + "_FillValue": "AAAAAAAA+H8=", + "grid_mapping": "spatial_ref" }, "chunk_grid": { "configuration": { @@ -994,6 +1093,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -1743,6 +1843,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -2207,6 +2308,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -2633,6 +2735,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -2910,6 +3013,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -3194,6 +3298,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -3471,6 +3576,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -6262,6 +6368,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -7773,6 +7880,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -8982,6 +9090,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -10493,6 +10602,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -12011,6 +12121,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -13522,6 +13633,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -14175,6 +14287,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -15044,6 +15157,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -15568,6 +15682,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], diff --git a/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json b/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json index 0276b79d..bd4d8443 100644 --- a/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json +++ b/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json @@ -5,7 +5,49 @@ "attributes": {}, "members": { "geometry": { - "attributes": {}, + "attributes": { + "grid_mapping": "spatial_ref", + "proj:code": "EPSG:32632", + "spatial:bbox": [ + 302386.95652173914, + 4892626.956521739, + 407413.04347826086, + 4997653.043478261 + ], + "spatial:dimensions": [ + "y", + "x" + ], + "spatial:registration": "node", + "spatial:shape": [ + 23, + 23 + ], + "spatial:transform": [ + 4773.913043478271, + 0.0, + 302386.95652173914, + 0.0, + -4773.913043478504, + 4997653.043478261 + ], + "zarr_conventions": [ + { + "description": "Spatial coordinate information", + "name": "spatial", + "schema_url": "https://raw.githubusercontent.com/zarr-conventions/spatial/refs/tags/v0.1/schema.json", + "spec_url": "https://github.com/zarr-conventions/spatial/blob/v0.1/README.md", + "uuid": "689b58e2-cf7b-45e0-9fff-9cfc0883d6b4" + }, + { + "description": "Coordinate reference system information for geospatial data", + "name": "proj", + "schema_url": "https://raw.githubusercontent.com/zarr-conventions/proj/refs/tags/v0.1/schema.json", + "spec_url": "https://github.com/zarr-conventions/proj/blob/v0.1/README.md", + "uuid": "f17cb550-5864-4468-aeb7-f3180cfb622f" + } + ] + }, "members": { "angle": { "attributes": {}, @@ -271,9 +313,65 @@ "storage_transformers": [], "zarr_format": 3 }, + "spatial_ref": { + "attributes": { + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "false_easting": 500000.0, + "false_northing": 0.0, + "geographic_crs_name": "WGS 84", + "grid_mapping_name": "transverse_mercator", + "horizontal_datum_name": "World Geodetic System 1984", + "inverse_flattening": 298.257223563, + "latitude_of_projection_origin": 0.0, + "longitude_of_central_meridian": 9.0, + "longitude_of_prime_meridian": 0.0, + "prime_meridian_name": "Greenwich", + "projected_crs_name": "WGS 84 / UTM zone 32N", + "reference_ellipsoid_name": "WGS 84", + "scale_factor_at_central_meridian": 0.9996, + "semi_major_axis": 6378137.0, + "semi_minor_axis": 6356752.314245179, + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + }, + "chunk_grid": { + "configuration": { + "chunk_shape": [] + }, + "name": "regular" + }, + "chunk_key_encoding": { + "configuration": { + "separator": "/" + }, + "name": "default" + }, + "codecs": [ + { + "configuration": { + "endian": "little" + }, + "name": "bytes" + }, + { + "configuration": { + "checksum": false, + "level": 0 + }, + "name": "zstd" + } + ], + "data_type": "int64", + "dimension_names": null, + "fill_value": 0, + "node_type": "array", + "shape": [], + "storage_transformers": [], + "zarr_format": 3 + }, "sun_angles": { "attributes": { - "_FillValue": "AAAAAAAA+H8=" + "_FillValue": "AAAAAAAA+H8=", + "grid_mapping": "spatial_ref" }, "chunk_grid": { "configuration": { @@ -351,7 +449,8 @@ }, "viewing_incidence_angles": { "attributes": { - "_FillValue": "AAAAAAAA+H8=" + "_FillValue": "AAAAAAAA+H8=", + "grid_mapping": "spatial_ref" }, "chunk_grid": { "configuration": { @@ -524,12 +623,12 @@ "r10m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490220.0, - 709800.0, - 4600020.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -543,10 +642,10 @@ "spatial:transform": [ 10.0, 0.0, - 600000.0, + 300000.0, 0.0, -10.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -948,7 +1047,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -956,15 +1055,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, + "longitude_of_central_meridian": 9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", + "projected_crs_name": "WGS 84 / UTM zone 32N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" }, "chunk_grid": { "configuration": { @@ -994,6 +1093,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -1083,12 +1183,12 @@ "r20m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490220.0, - 709800.0, - 4600020.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -1102,10 +1202,10 @@ "spatial:transform": [ 20.0, 0.0, - 600000.0, + 300000.0, 0.0, -20.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -1697,7 +1797,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -1705,15 +1805,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, + "longitude_of_central_meridian": 9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", + "projected_crs_name": "WGS 84 / UTM zone 32N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" }, "chunk_grid": { "configuration": { @@ -1743,6 +1843,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -1832,12 +1933,12 @@ "r60m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490220.0, - 709800.0, - 4600020.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -1851,10 +1952,10 @@ "spatial:transform": [ 60.0, 0.0, - 600000.0, + 300000.0, 0.0, -60.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -2161,7 +2262,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -2169,15 +2270,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, + "longitude_of_central_meridian": 9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", + "projected_crs_name": "WGS 84 / UTM zone 32N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" }, "chunk_grid": { "configuration": { @@ -2207,6 +2308,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -2310,10 +2412,10 @@ "spatial:transform": [ 60.0, 0.0, - 600000.0, + 300000.0, 0.0, -60.0, - 4600020.0 + 5000040.0 ] }, { @@ -2326,10 +2428,10 @@ "spatial:transform": [ 120.0, 0.0, - 600000.0, + 300000.0, 0.0, -120.0, - 4600020.0 + 5000040.0 ], "transform": { "scale": [ @@ -2352,10 +2454,10 @@ "spatial:transform": [ 360.0, 0.0, - 600000.0, + 300000.0, 0.0, -360.0, - 4600020.0 + 5000040.0 ], "transform": { "scale": [ @@ -2378,10 +2480,10 @@ "spatial:transform": [ 720.0, 0.0, - 600000.0, + 300000.0, 0.0, -720.0, - 4600020.0 + 5000040.0 ], "transform": { "scale": [ @@ -2397,12 +2499,12 @@ ], "resampling_method": "nearest" }, - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490220.0, - 709800.0, - 4600020.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -2412,10 +2514,10 @@ "spatial:transform": [ 60.0, 0.0, - 600000.0, + 300000.0, 0.0, -60.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -2445,12 +2547,12 @@ "r120m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490220.0, - 709800.0, - 4600020.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -2464,10 +2566,10 @@ "spatial:transform": [ 120.0, 0.0, - 600000.0, + 300000.0, 0.0, -120.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -2594,7 +2696,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -2602,15 +2704,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, + "longitude_of_central_meridian": 9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", + "projected_crs_name": "WGS 84 / UTM zone 32N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" }, "chunk_grid": { "configuration": { @@ -2633,6 +2735,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -2722,12 +2825,12 @@ "r360m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490220.0, - 709800.0, - 4600020.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -2741,10 +2844,10 @@ "spatial:transform": [ 360.0, 0.0, - 600000.0, + 300000.0, 0.0, -360.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -2871,7 +2974,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -2879,15 +2982,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, + "longitude_of_central_meridian": 9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", + "projected_crs_name": "WGS 84 / UTM zone 32N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" }, "chunk_grid": { "configuration": { @@ -2910,6 +3013,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -2999,12 +3103,12 @@ "r60m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490220.0, - 709800.0, - 4600020.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -3018,10 +3122,10 @@ "spatial:transform": [ 60.0, 0.0, - 600000.0, + 300000.0, 0.0, -60.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -3148,7 +3252,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -3156,15 +3260,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, + "longitude_of_central_meridian": 9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", + "projected_crs_name": "WGS 84 / UTM zone 32N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" }, "chunk_grid": { "configuration": { @@ -3194,6 +3298,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -3283,12 +3388,12 @@ "r720m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490580.0, - 709440.0, - 4600020.0 + 300000.0, + 4890600.0, + 409440.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -3302,10 +3407,10 @@ "spatial:transform": [ 720.0, 0.0, - 600000.0, + 300000.0, 0.0, -720.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -3432,7 +3537,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -3440,15 +3545,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, + "longitude_of_central_meridian": 9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", + "projected_crs_name": "WGS 84 / UTM zone 32N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" }, "chunk_grid": { "configuration": { @@ -3471,6 +3576,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -3574,10 +3680,10 @@ "spatial:transform": [ 20.0, 0.0, - 600000.0, + 300000.0, 0.0, -20.0, - 4600020.0 + 5000040.0 ] }, { @@ -3590,10 +3696,10 @@ "spatial:transform": [ 60.0, 0.0, - 600000.0, + 300000.0, 0.0, -60.0, - 4600020.0 + 5000040.0 ], "transform": { "scale": [ @@ -3616,10 +3722,10 @@ "spatial:transform": [ 120.0, 0.0, - 600000.0, + 300000.0, 0.0, -120.0, - 4600020.0 + 5000040.0 ], "transform": { "scale": [ @@ -3642,10 +3748,10 @@ "spatial:transform": [ 360.0, 0.0, - 600000.0, + 300000.0, 0.0, -360.0, - 4600020.0 + 5000040.0 ], "transform": { "scale": [ @@ -3668,10 +3774,10 @@ "spatial:transform": [ 720.0, 0.0, - 600000.0, + 300000.0, 0.0, -720.0, - 4600020.0 + 5000040.0 ], "transform": { "scale": [ @@ -3687,12 +3793,12 @@ ], "resampling_method": "nearest" }, - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490220.0, - 709800.0, - 4600020.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -3702,10 +3808,10 @@ "spatial:transform": [ 20.0, 0.0, - 600000.0, + 300000.0, 0.0, -20.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -3735,12 +3841,12 @@ "r120m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490220.0, - 709800.0, - 4600020.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -3754,10 +3860,10 @@ "spatial:transform": [ 120.0, 0.0, - 600000.0, + 300000.0, 0.0, -120.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -3901,7 +4007,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -3909,15 +4015,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, + "longitude_of_central_meridian": 9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", + "projected_crs_name": "WGS 84 / UTM zone 32N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" }, "chunk_grid": { "configuration": { @@ -3940,6 +4046,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -4029,12 +4136,12 @@ "r20m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490220.0, - 709800.0, - 4600020.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -4048,10 +4155,10 @@ "spatial:transform": [ 20.0, 0.0, - 600000.0, + 300000.0, 0.0, -20.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -4195,7 +4302,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -4203,15 +4310,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, + "longitude_of_central_meridian": 9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", + "projected_crs_name": "WGS 84 / UTM zone 32N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" }, "chunk_grid": { "configuration": { @@ -4241,6 +4348,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -4330,12 +4438,12 @@ "r360m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490220.0, - 709800.0, - 4600020.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -4349,10 +4457,10 @@ "spatial:transform": [ 360.0, 0.0, - 600000.0, + 300000.0, 0.0, -360.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -4496,7 +4604,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -4504,15 +4612,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, + "longitude_of_central_meridian": 9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", + "projected_crs_name": "WGS 84 / UTM zone 32N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" }, "chunk_grid": { "configuration": { @@ -4535,6 +4643,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -4624,12 +4733,12 @@ "r60m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490220.0, - 709800.0, - 4600020.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -4643,10 +4752,10 @@ "spatial:transform": [ 60.0, 0.0, - 600000.0, + 300000.0, 0.0, -60.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -4790,7 +4899,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -4798,15 +4907,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, + "longitude_of_central_meridian": 9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", + "projected_crs_name": "WGS 84 / UTM zone 32N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" }, "chunk_grid": { "configuration": { @@ -4836,6 +4945,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -4925,12 +5035,12 @@ "r720m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490580.0, - 709440.0, - 4600020.0 + 300000.0, + 4890600.0, + 409440.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -4944,10 +5054,10 @@ "spatial:transform": [ 720.0, 0.0, - 600000.0, + 300000.0, 0.0, -720.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -5091,7 +5201,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -5099,15 +5209,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, + "longitude_of_central_meridian": 9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", + "projected_crs_name": "WGS 84 / UTM zone 32N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" }, "chunk_grid": { "configuration": { @@ -5130,6 +5240,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -7232,10 +7343,10 @@ "spatial:transform": [ 10.0, 0.0, - 600000.0, + 300000.0, 0.0, -10.0, - 4600020.0 + 5000040.0 ] }, { @@ -7248,10 +7359,10 @@ "spatial:transform": [ 20.0, 0.0, - 600000.0, + 300000.0, 0.0, -20.0, - 4600020.0 + 5000040.0 ], "transform": { "scale": [ @@ -7274,10 +7385,10 @@ "spatial:transform": [ 60.0, 0.0, - 600000.0, + 300000.0, 0.0, -60.0, - 4600020.0 + 5000040.0 ], "transform": { "scale": [ @@ -7300,10 +7411,10 @@ "spatial:transform": [ 120.0, 0.0, - 600000.0, + 300000.0, 0.0, -120.0, - 4600020.0 + 5000040.0 ], "transform": { "scale": [ @@ -7326,10 +7437,10 @@ "spatial:transform": [ 360.0, 0.0, - 600000.0, + 300000.0, 0.0, -360.0, - 4600020.0 + 5000040.0 ], "transform": { "scale": [ @@ -7352,10 +7463,10 @@ "spatial:transform": [ 720.0, 0.0, - 600000.0, + 300000.0, 0.0, -720.0, - 4600020.0 + 5000040.0 ], "transform": { "scale": [ @@ -7371,12 +7482,12 @@ ], "resampling_method": "average" }, - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490220.0, - 709800.0, - 4600020.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -7386,10 +7497,10 @@ "spatial:transform": [ 10.0, 0.0, - 600000.0, + 300000.0, 0.0, -10.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -7419,12 +7530,12 @@ "r10m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490220.0, - 709800.0, - 4600020.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -7438,10 +7549,10 @@ "spatial:transform": [ 10.0, 0.0, - 600000.0, + 300000.0, 0.0, -10.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -7875,7 +7986,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -7883,15 +7994,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, + "longitude_of_central_meridian": 9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", + "projected_crs_name": "WGS 84 / UTM zone 32N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" }, "chunk_grid": { "configuration": { @@ -7921,6 +8032,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -8010,12 +8122,12 @@ "r120m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490220.0, - 709800.0, - 4600020.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -8029,10 +8141,10 @@ "spatial:transform": [ 120.0, 0.0, - 600000.0, + 300000.0, 0.0, -120.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -9290,7 +9402,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -9298,15 +9410,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, + "longitude_of_central_meridian": 9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", + "projected_crs_name": "WGS 84 / UTM zone 32N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" }, "chunk_grid": { "configuration": { @@ -9329,6 +9441,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -9418,12 +9531,12 @@ "r20m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490220.0, - 709800.0, - 4600020.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -9437,10 +9550,10 @@ "spatial:transform": [ 20.0, 0.0, - 600000.0, + 300000.0, 0.0, -20.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -10595,7 +10708,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -10603,15 +10716,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, + "longitude_of_central_meridian": 9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", + "projected_crs_name": "WGS 84 / UTM zone 32N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" }, "chunk_grid": { "configuration": { @@ -10641,6 +10754,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -10730,12 +10844,12 @@ "r360m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490220.0, - 709800.0, - 4600020.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -10749,10 +10863,10 @@ "spatial:transform": [ 360.0, 0.0, - 600000.0, + 300000.0, 0.0, -360.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -12010,7 +12124,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -12018,15 +12132,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, + "longitude_of_central_meridian": 9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", + "projected_crs_name": "WGS 84 / UTM zone 32N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" }, "chunk_grid": { "configuration": { @@ -12049,6 +12163,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -12138,12 +12253,12 @@ "r60m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490220.0, - 709800.0, - 4600020.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -12157,10 +12272,10 @@ "spatial:transform": [ 60.0, 0.0, - 600000.0, + 300000.0, 0.0, -60.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -13418,7 +13533,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -13426,15 +13541,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, + "longitude_of_central_meridian": 9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", + "projected_crs_name": "WGS 84 / UTM zone 32N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" }, "chunk_grid": { "configuration": { @@ -13464,6 +13579,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -13553,12 +13669,12 @@ "r720m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490580.0, - 709440.0, - 4600020.0 + 300000.0, + 4890600.0, + 409440.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -13572,10 +13688,10 @@ "spatial:transform": [ 720.0, 0.0, - 600000.0, + 300000.0, 0.0, -720.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -14833,7 +14949,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -14841,15 +14957,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, + "longitude_of_central_meridian": 9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", + "projected_crs_name": "WGS 84 / UTM zone 32N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" }, "chunk_grid": { "configuration": { @@ -14872,6 +14988,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -14982,10 +15099,10 @@ "spatial:transform": [ 10.0, 0.0, - 600000.0, + 300000.0, 0.0, -10.0, - 4600020.0 + 5000040.0 ] }, { @@ -14998,10 +15115,10 @@ "spatial:transform": [ 20.0, 0.0, - 600000.0, + 300000.0, 0.0, -20.0, - 4600020.0 + 5000040.0 ], "transform": { "scale": [ @@ -15024,10 +15141,10 @@ "spatial:transform": [ 60.0, 0.0, - 600000.0, + 300000.0, 0.0, -60.0, - 4600020.0 + 5000040.0 ], "transform": { "scale": [ @@ -15050,10 +15167,10 @@ "spatial:transform": [ 120.0, 0.0, - 600000.0, + 300000.0, 0.0, -120.0, - 4600020.0 + 5000040.0 ], "transform": { "scale": [ @@ -15076,10 +15193,10 @@ "spatial:transform": [ 360.0, 0.0, - 600000.0, + 300000.0, 0.0, -360.0, - 4600020.0 + 5000040.0 ], "transform": { "scale": [ @@ -15102,10 +15219,10 @@ "spatial:transform": [ 720.0, 0.0, - 600000.0, + 300000.0, 0.0, -720.0, - 4600020.0 + 5000040.0 ], "transform": { "scale": [ @@ -15121,12 +15238,12 @@ ], "resampling_method": "average" }, - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490220.0, - 709800.0, - 4600020.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -15136,10 +15253,10 @@ "spatial:transform": [ 10.0, 0.0, - 600000.0, + 300000.0, 0.0, -10.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -15169,12 +15286,12 @@ "r10m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490220.0, - 709800.0, - 4600020.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -15188,10 +15305,10 @@ "spatial:transform": [ 10.0, 0.0, - 600000.0, + 300000.0, 0.0, -10.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -15309,7 +15426,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -15317,15 +15434,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, + "longitude_of_central_meridian": 9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", + "projected_crs_name": "WGS 84 / UTM zone 32N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" }, "chunk_grid": { "configuration": { @@ -15355,6 +15472,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -15540,12 +15658,12 @@ "r120m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490220.0, - 709800.0, - 4600020.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -15559,10 +15677,10 @@ "spatial:transform": [ 120.0, 0.0, - 600000.0, + 300000.0, 0.0, -120.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -15680,7 +15798,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -15688,15 +15806,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, + "longitude_of_central_meridian": 9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", + "projected_crs_name": "WGS 84 / UTM zone 32N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" }, "chunk_grid": { "configuration": { @@ -15719,6 +15837,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -15904,12 +16023,12 @@ "r20m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490220.0, - 709800.0, - 4600020.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -15923,10 +16042,10 @@ "spatial:transform": [ 20.0, 0.0, - 600000.0, + 300000.0, 0.0, -20.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -16044,7 +16163,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -16052,15 +16171,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, + "longitude_of_central_meridian": 9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", + "projected_crs_name": "WGS 84 / UTM zone 32N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" }, "chunk_grid": { "configuration": { @@ -16090,6 +16209,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -16275,12 +16395,12 @@ "r360m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490220.0, - 709800.0, - 4600020.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -16294,10 +16414,10 @@ "spatial:transform": [ 360.0, 0.0, - 600000.0, + 300000.0, 0.0, -360.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -16415,7 +16535,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -16423,15 +16543,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, + "longitude_of_central_meridian": 9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", + "projected_crs_name": "WGS 84 / UTM zone 32N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" }, "chunk_grid": { "configuration": { @@ -16454,6 +16574,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -16639,12 +16760,12 @@ "r60m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490220.0, - 709800.0, - 4600020.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -16658,10 +16779,10 @@ "spatial:transform": [ 60.0, 0.0, - 600000.0, + 300000.0, 0.0, -60.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -16779,7 +16900,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -16787,15 +16908,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, + "longitude_of_central_meridian": 9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", + "projected_crs_name": "WGS 84 / UTM zone 32N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" }, "chunk_grid": { "configuration": { @@ -16825,6 +16946,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -17010,12 +17132,12 @@ "r720m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490580.0, - 709440.0, - 4600020.0 + 300000.0, + 4890600.0, + 409440.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -17029,10 +17151,10 @@ "spatial:transform": [ 720.0, 0.0, - 600000.0, + 300000.0, 0.0, -720.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -17150,7 +17272,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -17158,15 +17280,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, + "longitude_of_central_meridian": 9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", + "projected_crs_name": "WGS 84 / UTM zone 32N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" }, "chunk_grid": { "configuration": { @@ -17189,6 +17311,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -17381,12 +17504,12 @@ "r10m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490220.0, - 709800.0, - 4600020.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -17400,10 +17523,10 @@ "spatial:transform": [ 10.0, 0.0, - 600000.0, + 300000.0, 0.0, -10.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -17885,7 +18008,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -17893,15 +18016,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, + "longitude_of_central_meridian": 9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", + "projected_crs_name": "WGS 84 / UTM zone 32N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" }, "chunk_grid": { "configuration": { @@ -17931,6 +18054,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -18020,12 +18144,12 @@ "r20m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490220.0, - 709800.0, - 4600020.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -18039,10 +18163,10 @@ "spatial:transform": [ 20.0, 0.0, - 600000.0, + 300000.0, 0.0, -20.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -18754,7 +18878,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -18762,15 +18886,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, + "longitude_of_central_meridian": 9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", + "projected_crs_name": "WGS 84 / UTM zone 32N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" }, "chunk_grid": { "configuration": { @@ -18800,6 +18924,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -18889,12 +19014,12 @@ "r60m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490220.0, - 709800.0, - 4600020.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -18908,10 +19033,10 @@ "spatial:transform": [ 60.0, 0.0, - 600000.0, + 300000.0, 0.0, -60.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -19278,7 +19403,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -19286,15 +19411,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, + "longitude_of_central_meridian": 9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", + "projected_crs_name": "WGS 84 / UTM zone 32N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" }, "chunk_grid": { "configuration": { @@ -19324,6 +19449,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -19427,10 +19553,10 @@ "spatial:transform": [ 20.0, 0.0, - 600000.0, + 300000.0, 0.0, -20.0, - 4600020.0 + 5000040.0 ] }, { @@ -19443,10 +19569,10 @@ "spatial:transform": [ 60.0, 0.0, - 600000.0, + 300000.0, 0.0, -60.0, - 4600020.0 + 5000040.0 ], "transform": { "scale": [ @@ -19469,10 +19595,10 @@ "spatial:transform": [ 120.0, 0.0, - 600000.0, + 300000.0, 0.0, -120.0, - 4600020.0 + 5000040.0 ], "transform": { "scale": [ @@ -19495,10 +19621,10 @@ "spatial:transform": [ 360.0, 0.0, - 600000.0, + 300000.0, 0.0, -360.0, - 4600020.0 + 5000040.0 ], "transform": { "scale": [ @@ -19521,10 +19647,10 @@ "spatial:transform": [ 720.0, 0.0, - 600000.0, + 300000.0, 0.0, -720.0, - 4600020.0 + 5000040.0 ], "transform": { "scale": [ @@ -19540,12 +19666,12 @@ ], "resampling_method": "average" }, - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490220.0, - 709800.0, - 4600020.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -19555,10 +19681,10 @@ "spatial:transform": [ 20.0, 0.0, - 600000.0, + 300000.0, 0.0, -20.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -19588,12 +19714,12 @@ "r120m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490220.0, - 709800.0, - 4600020.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -19607,10 +19733,10 @@ "spatial:transform": [ 120.0, 0.0, - 600000.0, + 300000.0, 0.0, -120.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -19820,7 +19946,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -19828,15 +19954,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, + "longitude_of_central_meridian": 9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", + "projected_crs_name": "WGS 84 / UTM zone 32N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" }, "chunk_grid": { "configuration": { @@ -19859,6 +19985,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -19948,12 +20075,12 @@ "r20m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490220.0, - 709800.0, - 4600020.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -19967,10 +20094,10 @@ "spatial:transform": [ 20.0, 0.0, - 600000.0, + 300000.0, 0.0, -20.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -20180,7 +20307,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -20188,15 +20315,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, + "longitude_of_central_meridian": 9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", + "projected_crs_name": "WGS 84 / UTM zone 32N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" }, "chunk_grid": { "configuration": { @@ -20226,6 +20353,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -20315,12 +20443,12 @@ "r360m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490220.0, - 709800.0, - 4600020.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -20334,10 +20462,10 @@ "spatial:transform": [ 360.0, 0.0, - 600000.0, + 300000.0, 0.0, -360.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -20547,7 +20675,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -20555,15 +20683,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, + "longitude_of_central_meridian": 9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", + "projected_crs_name": "WGS 84 / UTM zone 32N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" }, "chunk_grid": { "configuration": { @@ -20586,6 +20714,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -20675,12 +20804,12 @@ "r60m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490220.0, - 709800.0, - 4600020.0 + 300000.0, + 4890240.0, + 409800.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -20694,10 +20823,10 @@ "spatial:transform": [ 60.0, 0.0, - 600000.0, + 300000.0, 0.0, -60.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -20907,7 +21036,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -20915,15 +21044,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, + "longitude_of_central_meridian": 9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", + "projected_crs_name": "WGS 84 / UTM zone 32N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" }, "chunk_grid": { "configuration": { @@ -20946,6 +21075,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -21035,12 +21165,12 @@ "r720m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32629", + "proj:code": "EPSG:32632", "spatial:bbox": [ - 600000.0, - 4490580.0, - 709440.0, - 4600020.0 + 300000.0, + 4890600.0, + 409440.0, + 5000040.0 ], "spatial:dimensions": [ "y", @@ -21054,10 +21184,10 @@ "spatial:transform": [ 720.0, 0.0, - 600000.0, + 300000.0, 0.0, -720.0, - 4600020.0 + 5000040.0 ], "zarr_conventions": [ { @@ -21267,7 +21397,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -21275,15 +21405,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": -9.0, + "longitude_of_central_meridian": 9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 29N", + "projected_crs_name": "WGS 84 / UTM zone 32N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" }, "chunk_grid": { "configuration": { @@ -21306,6 +21436,7 @@ } ], "data_type": "int64", + "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], diff --git a/tests/test_cpm_writer.py b/tests/test_cpm_writer.py index 50c26d9c..2d63eaf5 100644 --- a/tests/test_cpm_writer.py +++ b/tests/test_cpm_writer.py @@ -103,21 +103,26 @@ def test_write_s2_default_writes_esa_layout(tmp_path: pathlib.Path) -> None: assert asset["gsd"] == 10 -def test_write_s2_scale_offset_codec_is_refused(tmp_path: pathlib.Path) -> None: - """`scale_offset_codec=True` deviates from the plan-driven S2 writer's - fixed policy (the ESA packed-integer layout) and is refused.""" - with pytest.raises(ValueError, match="fixed write policy"): - _write_s2(tmp_path, scale_offset_codec=True) +def test_write_s2_scale_offset_codec(tmp_path: pathlib.Path) -> None: + """`scale_offset_codec=True` stores the packing in Zarr codecs, without CF or STAC scale fields.""" + root = _write_s2(tmp_path, scale_offset_codec=True) + b04 = root["measurements/reflectance/r10m/b04"] + assert isinstance(b04, zarr.Array) + assert b04.dtype == np.float32 + assert {"ScaleOffset", "CastValue"} <= set(_codec_names(b04)) + assert "scale_factor" not in b04.attrs + asset = _reflectance_asset(root) + assert "raster:scale" not in asset def test_write_s2_keep_scale_offset_is_deprecated(tmp_path: pathlib.Path) -> None: - """`keep_scale_offset=False` still maps to `scale_offset_codec=True` with a - deprecation warning, which the S2 write policy then refuses.""" - with ( - pytest.warns(DeprecationWarning, match="scale_offset_codec"), - pytest.raises(ValueError, match="fixed write policy"), - ): - _write_s2(tmp_path, keep_scale_offset=False) + """`keep_scale_offset` still works for one release; `False` selects the codecs.""" + with pytest.warns(DeprecationWarning, match="scale_offset_codec"): + root = _write_s2(tmp_path, keep_scale_offset=False) + b04 = root["measurements/reflectance/r10m/b04"] + assert isinstance(b04, zarr.Array) + assert b04.dtype == np.float32 + assert {"ScaleOffset", "CastValue"} <= set(_codec_names(b04)) def test_write_olci_end_to_end(tmp_path: pathlib.Path) -> None: diff --git a/tests/test_data_api/test_s2_write.py b/tests/test_data_api/test_s2_write.py deleted file mode 100644 index e28d9fb8..00000000 --- a/tests/test_data_api/test_s2_write.py +++ /dev/null @@ -1,372 +0,0 @@ -""" -Tests for the plan-driven writer (`eopf_geozarr.data_api.s2_write`). - -`write_geozarr` replaced the DataTree-based writer after reproducing its -stores byte for byte, file by file, on these fixtures (the parity test lived -here until that writer was removed). These tests pin what the writer -guarantees on its own: the stored documents are exactly the plan, and the -chunk data follows the copy / inject / coarsen semantics, checked against -independently formulated references. -""" - -from __future__ import annotations - -import hashlib -import json -import warnings -from typing import TYPE_CHECKING, Any - -import numpy as np -import pytest -import xarray as xr -import zarr -from pydantic_zarr.v3 import GroupSpec as GroupSpecV3 - -from eopf_geozarr.data_api.s2_plan import load_sentinel2 -from eopf_geozarr.data_api.s2_write import ( - DataTreeSourceReader, - ZarrSourceReader, - _coarsen, - write_geozarr, -) - -from ..conftest import create_zarrv2_group_from_json, get_stem, s2_example_json_paths - -if TYPE_CHECKING: - import pathlib - - from pydantic_zarr.v3 import AnyGroupSpec - -# Fallback footprint for coordinate arrays in groups that carry no proj -# attributes (geometry, meteorology), where the writer only copies the values. -_TILE_X_MIN = 300000.0 -_TILE_Y_MAX = 5000040.0 -_TILE_EXTENT = 109800.0 - -#: Arrays at most this many elements get deterministic test data, so the -#: resampling arithmetic is exercised on values, not only on nodata fill. -_PATTERN_MAX_ELEMENTS = 1830 * 1830 - -#: Larger arrays seeded anyway: the scene classification and one finest band, -#: so the window-centre subsampling and the band injection are exercised on -#: real values. -_PATTERNED_PATHS = ( - "conditions/mask/l2a_classification/r20m/scl", - "conditions/mask/l1c_classification/r60m/b00", - "measurements/reflectance/r10m/b08", - "quality/probability/r20m/cld", -) - -#: The L2A product used for the value-semantics checks. -_L2A_PATH = next(path for path in s2_example_json_paths if "MSIL2A" in path.stem) - - -def _walk_groups(group: zarr.Group, prefix: str = "") -> list[tuple[str, zarr.Group]]: - found: list[tuple[str, zarr.Group]] = [(prefix, group)] - for name, subgroup in group.groups(): - found.extend(_walk_groups(subgroup, f"{prefix}{name}/")) - return found - - -def _group_transform(group: zarr.Group) -> tuple[float, ...] | None: - """The proj:transform any of the group's arrays carries, if any.""" - for _, array in group.arrays(): - transform = array.attrs.get("proj:transform") - if not isinstance(transform, (list, tuple)) or len(transform) < 6: - continue - values = [value for value in transform[:6] if isinstance(value, (int, float))] - if len(values) == 6: - return tuple(float(value) for value in values) - return None - - -def _pattern(shape: tuple[int, ...], dtype: np.dtype) -> np.ndarray: - """Deterministic 2-D test values, with occasional zeros (the nodata fill).""" - modulus = min(999, int(np.iinfo(dtype).max)) - rows = np.arange(shape[0], dtype="uint16")[:, None] - cols = np.arange(shape[1], dtype="uint16")[None, :] - return ((rows * np.uint16(7) + cols) % np.uint16(modulus)).astype(dtype) - - -def _seed_input_store(group: zarr.Group) -> None: - """Give the metadata-only fixture store coordinates and array values. - - Coordinates are the pixel centres of each group's own `proj:transform` - (real products store them as float64, so the fixtures' int64 declarations - are recreated in that form), and selected arrays get deterministic values. - """ - patterned = set(_PATTERNED_PATHS) - for group_path, subgroup in _walk_groups(group): - transform = _group_transform(subgroup) - for name, array in subgroup.arrays(): - path = f"{group_path}{name}" - if name in ("x", "y") and array.ndim == 1: - centers = np.arange(array.shape[0]) + 0.5 - if transform is not None: - res_x, _, x0, _, res_y, y0 = transform - values = x0 + centers * res_x if name == "x" else y0 + centers * res_y - else: - res = _TILE_EXTENT / array.shape[0] - values = ( - _TILE_X_MIN + centers * res if name == "x" else _TILE_Y_MAX - centers * res - ) - replacement = zarr.create_array( - group.store, - name=path, - shape=array.shape, - dtype="float64", - chunks=array.chunks, - zarr_format=2, - fill_value=float("nan"), - attributes=dict(array.attrs), - overwrite=True, - ) - replacement[:] = values - elif array.ndim == 2 and np.issubdtype(array.dtype, np.integer): - if array.size <= _PATTERN_MAX_ELEMENTS or path in patterned: - array[...] = _pattern(array.shape, array.dtype) - - -def _written_store( - source_path: pathlib.Path, tmp_path: pathlib.Path -) -> tuple[AnyGroupSpec, zarr.Group, zarr.Group]: - """Seed the fixture store, write it with `write_geozarr`, open both.""" - input_path = create_zarrv2_group_from_json(source_path, tmp_path) - _seed_input_store(zarr.open_group(input_path, mode="r+", zarr_format=2)) - source = zarr.open_group(input_path, mode="r", zarr_format=2) - output_path = tmp_path / "planned.zarr" - plan = write_geozarr(load_sentinel2(source), source, str(output_path)) - return plan, source, zarr.open_group(output_path, mode="r", use_consolidated=False) - - -def _reference_block_mean(values: np.ndarray, factor: int, fill: int) -> np.ndarray: - """The converter's masked block mean, formulated independently (nanmean).""" - rows = values.shape[0] // factor * factor - cols = values.shape[1] // factor * factor - windows = values[:rows, :cols].reshape(rows // factor, factor, cols // factor, factor) - masked = np.where(windows == fill, np.nan, windows.astype("float64")) - with warnings.catch_warnings(): - warnings.simplefilter("ignore", RuntimeWarning) - mean = np.nanmean(masked, axis=(1, 3)) - return np.where(np.isnan(mean), fill, np.round(mean)).astype(values.dtype) - - -def _reference_plain_mean(values: np.ndarray, factor: int) -> np.ndarray: - """The block mean of every value, rounded: no value is nodata.""" - rows = values.shape[0] // factor * factor - cols = values.shape[1] // factor * factor - windows = values[:rows, :cols].reshape(rows // factor, factor, cols // factor, factor) - return np.round(windows.astype("float64").mean(axis=(1, 3))).astype(values.dtype) - - -@pytest.mark.parametrize("source_path", s2_example_json_paths, ids=get_stem) -def test_write_geozarr_realizes_the_plan(source_path: pathlib.Path, tmp_path: pathlib.Path) -> None: - """ - The written store holds exactly the planned hierarchy: reading it back - gives documents equal to the plan, for every group and array. - """ - plan, _, output = _written_store(source_path, tmp_path) - observed = GroupSpecV3.from_zarr(output).model_dump(mode="json") - assert observed == plan.model_dump(mode="json") - # the geometry grid is georeferenced at its nodes from the x/y values the writer - # read from the source (EOPF-Explorer/data-model#346): the seeded pixel centres - geometry = observed["members"]["conditions"]["members"]["geometry"]["attributes"] - res = _TILE_EXTENT / 23 - assert geometry["spatial:registration"] == "node" - assert geometry["spatial:transform"] == pytest.approx( - [res, 0.0, _TILE_X_MIN + 0.5 * res, 0.0, -res, _TILE_Y_MAX - 0.5 * res] - ) - - -def test_write_geozarr_data_semantics(tmp_path: pathlib.Path) -> None: - """ - The written chunk data follows the writer's semantics, checked on seeded - values: native arrays are copied, injected bands are the masked block - mean of the finest input level holding them, generated levels chain from - the previous level (mean for bands and probabilities, window-centre pixel - for the classification), coordinates take window means, and grid-mapping - arrays hold zero. The mean skips only the nodata the input declares: the - bands declare 0, the probabilities and atmosphere arrays declare none, so - their zeros (a valid probability) count. - """ - _, source, output = _written_store(_L2A_PATH, tmp_path) - - def read(group: zarr.Group, path: str) -> np.ndarray: - member = group[path] - assert isinstance(member, zarr.Array) - return np.asarray(member[...]) - - # a native array is copied (b01 r60m is small enough to carry the pattern) - native = read(output, "measurements/reflectance/r60m/b01") - np.testing.assert_array_equal(native, read(source, "measurements/reflectance/r60m/b01")) - - # an injected band is the masked block mean of its finest input level - injected = read(output, "measurements/reflectance/r60m/b08") - reference = _reference_block_mean(read(source, "measurements/reflectance/r10m/b08"), 6, 0) - np.testing.assert_array_equal(injected, reference) - - # a generated band level is the masked block mean of the previous level - generated = read(output, "measurements/reflectance/r120m/b01") - np.testing.assert_array_equal(generated, _reference_block_mean(native, 2, 0)) - - # a generated level of an array that declares no nodata is the plain block - # mean of the previous level, zeros included - for path, name, finer, coarser, factor in ( - ("quality/probability", "cld", "r20m", "r60m", 3), - ("quality/atmosphere", "aot", "r60m", "r120m", 2), - ): - previous = read(output, f"{path}/{finer}/{name}") - assert (previous == 0).any(), "fixture precondition: the seeded values hold zeros" - plain = _reference_plain_mean(previous, factor) - assert not np.array_equal(plain, _reference_block_mean(previous, factor, 0)) - np.testing.assert_array_equal(read(output, f"{path}/{coarser}/{name}"), plain) - - # a generated classification level takes each window's centre pixel - scl_native = read(output, "conditions/mask/l2a_classification/r60m/scl") - scl_generated = read(output, "conditions/mask/l2a_classification/r120m/scl") - np.testing.assert_array_equal(scl_generated, scl_native[1::2, 1::2]) - - # a generated level's coordinates are the window means of the previous level's - x_native = read(output, "measurements/reflectance/r60m/x") - x_generated = read(output, "measurements/reflectance/r120m/x") - np.testing.assert_array_equal( - x_generated, x_native[: x_generated.shape[0] * 2].reshape(-1, 2).mean(axis=1) - ) - - # grid-mapping arrays hold zero - assert read(output, "measurements/reflectance/r120m/spatial_ref") == 0 - - -@pytest.mark.parametrize("factor", [2, 3]) -@pytest.mark.parametrize("var_name", ["scl", "b00"]) -def test_coarsen_classification_takes_the_window_centre(var_name: str, factor: int) -> None: - """Classification variables (SCL, L1C cloud bitmask) take the centre pixel - of each window; for an even factor, the lower-right of the middle pixels.""" - size = 2 * factor - data = np.arange(size * size, dtype="uint8").reshape(size, size) - result = _coarsen(data, factor, var_name, fill=0) - centre = factor // 2 - np.testing.assert_array_equal(result, data[centre::factor, centre::factor]) - - -def test_coarsen_float_keeps_all_nan_windows_nan() -> None: - """The float block mean skips NaN, and a window holding nothing but NaN - stays NaN (it is nodata, not zero).""" - data = np.array( - [ - [1.0, 2.0, np.nan, np.nan], - [3.0, np.nan, np.nan, np.nan], - ], - dtype="float32", - ) - result = _coarsen(data, 2, "b02", fill=None) - np.testing.assert_array_equal(result, np.array([[2.0, np.nan]], dtype="float32")) - - -def test_coarsen_refuses_quality_masks() -> None: - """Quality-mask downsampling is not implemented, so it is refused.""" - data = np.zeros((4, 4), dtype="uint8") - with pytest.raises(ValueError, match="quality_mask"): - _coarsen(data, 2, "quality_cirrus", fill=0) - - -def test_write_geozarr_refuses_a_source_missing_the_planned_arrays( - tmp_path: pathlib.Path, -) -> None: - """A source store that lacks a planned array's data is refused.""" - input_path = create_zarrv2_group_from_json(s2_example_json_paths[0], tmp_path) - input_group = zarr.open_group(input_path, mode="r", zarr_format=2) - root = load_sentinel2(input_group) - empty_source = zarr.create_group(tmp_path / "empty.zarr", zarr_format=2) - with pytest.raises(ValueError, match="input source"): - write_geozarr(root, empty_source, str(tmp_path / "out.zarr")) - - -def _store_contents(path: pathlib.Path) -> dict[str, object]: - """Every file of a store: metadata documents as parsed JSON (their key - order is not semantic), chunk files as content digests.""" - contents: dict[str, object] = {} - for file in sorted(path.rglob("*")): - if not file.is_file(): - continue - relative = str(file.relative_to(path)) - if file.name in ("zarr.json", ".zattrs", ".zgroup", ".zarray", ".zmetadata"): - contents[relative] = json.loads(file.read_text()) - else: - contents[relative] = hashlib.sha256(file.read_bytes()).hexdigest() - return contents - - -@pytest.mark.parametrize("source_path", s2_example_json_paths, ids=get_stem) -def test_write_geozarr_from_a_datatree_matches_the_store_write( - source_path: pathlib.Path, tmp_path: pathlib.Path -) -> None: - """ - A DataTree source produces the same store as the Zarr-store source, chunk - for chunk: the tree's GroupSpec-shaped view validates into the same input - model, and the tree reader feeds the writer the same values — whether the - tree holds the raw packed values (`mask_and_scale=False`) or the decoded - ones, which the reader re-encodes as xarray's own writer would. - """ - input_path = create_zarrv2_group_from_json(source_path, tmp_path) - _seed_input_store(zarr.open_group(input_path, mode="r+", zarr_format=2)) - source = zarr.open_group(input_path, mode="r", zarr_format=2) - store_output = tmp_path / "from_store.zarr" - write_geozarr(load_sentinel2(source), source, str(store_output)) - reference = _store_contents(store_output) - - for mask_and_scale in (False, True): - tree = xr.open_datatree( - str(input_path), - engine="zarr", - chunks={}, - consolidated=False, - mask_and_scale=mask_and_scale, - decode_coords="all", - ) - tree_output = tmp_path / f"from_tree_{mask_and_scale}.zarr" - write_geozarr(load_sentinel2(tree), tree, str(tree_output)) - assert _store_contents(tree_output) == reference, f"{mask_and_scale=}" - - -@pytest.mark.parametrize( - ("fill_value", "attributes", "expected"), - [ - (0, {}, 0), - (None, {"_FillValue": 255}, 255), - (None, {"fill_value": 0}, 0), - (7, {"_FillValue": 255, "fill_value": 0}, 7), - (None, {"_FillValue": 255, "fill_value": 0}, 255), - (None, {}, None), - (None, {"fill_value": "NaN"}, None), - ], - ids=[ - "zarr-fill-value", - "cf-attribute", - "eopf-attribute", - "zarr-fill-value-first", - "cf-before-eopf", - "undeclared", - "not-a-number", - ], -) -def test_source_readers_report_the_declared_nodata( - fill_value: int | None, attributes: dict[str, Any], expected: int | None -) -> None: - """ - Both source readers report the nodata an input array declares, in the - converter's order: the CF `_FillValue` (a Zarr V2 array's `fill_value`, - xarray's encoding, or the attribute), then the EOPF `fill_value` - attribute; an array that declares none has none. - """ - group = zarr.open_group({}, mode="w", zarr_format=2) - group.create_array( - "level/var", shape=(2, 2), dtype="uint8", fill_value=fill_value - ).attrs.update(attributes) - assert ZarrSourceReader(group).nodata("level/var") == expected - - variable = xr.DataArray(np.zeros((2, 2), dtype="uint8"), dims=["y", "x"], attrs=attributes) - if fill_value is not None: - variable.encoding["_FillValue"] = fill_value - tree = xr.DataTree.from_dict({"level": xr.Dataset({"var": variable})}) - assert DataTreeSourceReader(tree).nodata("level/var") == expected diff --git a/tests/test_s2_converter_simplified.py b/tests/test_s2_converter_simplified.py index e8d6b68a..704bf4af 100644 --- a/tests/test_s2_converter_simplified.py +++ b/tests/test_s2_converter_simplified.py @@ -8,6 +8,7 @@ import uuid from pathlib import Path from typing import cast +from unittest.mock import Mock, patch import numpy as np import pytest @@ -21,6 +22,7 @@ write_store_geo_metadata, ) from eopf_geozarr.s2_optimization.s2_converter import ( + _multiscale_paths, _validate_s2_input, add_s2_stac_assets, convert_s2_optimized, @@ -300,32 +302,26 @@ def test_updated_root_consolidation_aux_multiscales( ) -> None: """Each written auxiliary pyramid gets its own consolidated metadata listing its levels. - The converter derives the consolidated set from the paths the plan maps to - None, so a pyramid missing from `datasets` (e.g. an L2A product whose - processing baseline lacks a group) is never passed on for consolidation. + Pyramids missing from `datasets` (e.g. an L2A product whose processing baseline + lacks a group) are not passed on for consolidation. """ output_path = tmp_path / "test.zarr" levels = ("r60m", "r120m") - datasets: dict[str, xr.Dataset | None] = { - "/measurements/reflectance/r10m": xr.Dataset(), - "/measurements/reflectance": None, - } + datasets = {"/measurements/reflectance/r10m": xr.Dataset()} for base_path in aux_groups: - datasets[base_path] = None for level in levels: datasets[f"{base_path}/{level}"] = xr.Dataset({"b00": (["y", "x"], np.zeros((2, 2)))}) # Write every group into one store, as the pipeline does. for k, v in datasets.items(): - if v is not None: - v.to_zarr(output_path, group=k.lstrip("/"), mode="a", zarr_format=3, consolidated=False) + v.to_zarr(output_path, group=k.lstrip("/"), mode="a", zarr_format=3, consolidated=False) dt_input = xr.DataTree(name="S2A_MSIL2A_20250811T112131") updated_root_consolidation( dt_input=dt_input, output_path=str(output_path), datasets=datasets, - additional_consolidate_paths=[path for path, ds in datasets.items() if ds is None], + additional_consolidate_paths=_multiscale_paths(dt_input, datasets), ) for base_path in aux_groups: @@ -488,27 +484,86 @@ def test_write_store_geo_metadata_antimeridian_falls_back_to_full_range(tmp_path assert bbox == [-180.0, bbox[1], 180.0, bbox[3]], bbox -@pytest.mark.parametrize( - "deviation", - [ - {"enable_sharding": False}, - {"spatial_chunk": 512}, - {"compression_level": 2}, - {"scale_offset_codec": True}, - ], - ids=lambda d: next(iter(d)), -) -def test_convert_s2_optimized_refuses_non_policy_options(deviation: dict) -> None: - """The plan-driven writer has a fixed write policy; a deviating layout - option is refused before any work happens.""" - with pytest.raises(ValueError, match="fixed write policy"): +class TestConvenienceFunction: + """Test the convenience function.""" + + @patch("eopf_geozarr.conversion.utils.create_result_datatree") + @patch("eopf_geozarr.s2_optimization.s2_converter.zarr.open_group") + @patch("eopf_geozarr.s2_optimization.s2_converter.initialize_crs_from_dataset") + @patch("eopf_geozarr.s2_optimization.s2_converter.get_zarr_group") + @patch("eopf_geozarr.s2_optimization.s2_converter.is_sentinel2_dataset") + @patch("eopf_geozarr.s2_optimization.s2_converter.create_multiscale_from_datatree") + @patch("eopf_geozarr.s2_optimization.s2_converter.utils.updated_root_consolidation") + def test_convert_s2_optimized_convenience_function( + self, + mock_consolidation: Mock, + mock_multiscale: Mock, + mock_is_s2: Mock, + mock_get_zarr_group: Mock, + mock_init_crs: Mock, + mock_zarr_open_group: Mock, + mock_create_result_datatree: Mock, + ) -> None: + """Test the convenience function parameter passing.""" + # Setup mocks + # Only pyramids with written levels are consolidated, so return one level of each + mock_multiscale.return_value = { + "/measurements/reflectance/r10m": xr.Dataset(), + "/conditions/mask/l2a_classification/r20m": xr.Dataset(), + "/quality/probability/r20m": xr.Dataset(), + "/quality/atmosphere/r10m": xr.Dataset(), + "/conditions/mask/l1c_classification/r60m": xr.Dataset(), + } + mock_is_s2.return_value = True + mock_get_zarr_group.return_value = Mock() + mock_init_crs.return_value = None # Return None for CRS + + # Mock zarr.open_group to return a group with proper groups() and members() methods + mock_zarr_group = Mock() + mock_zarr_group.groups.return_value = iter([]) # Return empty iterator for groups + mock_zarr_group.members.return_value = {} # Return empty dict for members + mock_zarr_open_group.return_value = mock_zarr_group + + # Mock create_result_datatree to return a mock DataTree with groups attribute + mock_result_dt = Mock() + mock_result_dt.groups = [] # Empty list for groups + mock_create_result_datatree.return_value = mock_result_dt + + # Test parameter passing - Mock DataTree with groups attribute + dt_input = Mock() + dt_input.groups = ["/measurements/reflectance/r10m"] + # `S2Type.from_datatree` reads these; a bare Mock attribute is not a string + dt_input.attrs = {} + dt_input.name = "S2A_MSIL2A_test" + output_path = "/test/path" + convert_s2_optimized( - xr.DataTree(), - output_path="/unused", + dt_input, + output_path=output_path, + enable_sharding=False, + spatial_chunk=512, + compression_level=2, validate_output=False, - **deviation, ) + # Verify multiscale function was called with correct args + mock_multiscale.assert_called_once() + call_kwargs = mock_multiscale.call_args.kwargs + assert call_kwargs["enable_sharding"] is False + assert call_kwargs["spatial_chunk"] == 512 + + # Verify root consolidation runs on the converter output, with the L2A pyramids + mock_consolidation.assert_called_once() + consolidation_kwargs = mock_consolidation.call_args.kwargs + assert consolidation_kwargs["output_path"] == output_path + assert consolidation_kwargs["additional_consolidate_paths"] == [ + "/measurements/reflectance", + "/conditions/mask/l2a_classification", + "/quality/probability", + "/quality/atmosphere", + "/conditions/mask/l1c_classification", + ] + def test_add_s2_stac_assets_writes_reflectance_asset_to_root(tmp_path: Path) -> None: """The reflectance asset added by `add_s2_stac_assets` ends up in the consolidated root.""" @@ -525,14 +580,14 @@ def test_add_s2_stac_assets_writes_reflectance_asset_to_root(tmp_path: Path) -> zarr_format=3, consolidated=False, ) - datasets: dict[str, tuple[str, ...] | None] = {"/measurements/reflectance/r10m": ()} + datasets = {"/measurements/reflectance/r10m": r10m} # adding dummy data to dt_input to mimic input reference dtreee dt_input = xr.DataTree(xr.Dataset({"dummy": (["y"], np.zeros(10))})) dt_input.attrs = {"stac_discovery": {"properties": {"mission": "sentinel-2"}}} # test execution of func: the S2 assets are added before the root metadata is written - add_s2_stac_assets(dt_input, datasets, crs=CRS.from_epsg(32632), reflectance_shape=(10, 20)) + add_s2_stac_assets(dt_input, datasets, crs=CRS.from_epsg(32632)) updated_root_consolidation( output_path=output_path, datasets=datasets, @@ -556,11 +611,10 @@ def test_add_s2_stac_assets_writes_reflectance_asset_to_root(tmp_path: Path) -> def test_add_multiscale_pyramids_to_stac_metadata_adds_missing_levels() -> None: - """Pyramid levels absent from existing STAC assets get one asset per data - variable, whether the level is given as a dataset or as its variable names.""" + """Pyramid levels absent from existing STAC assets get one asset per data variable.""" existing_asset = {"href": "/measurements/reflectance/r10m/b02", "title": "B02"} attrs: dict = {"stac_discovery": {"assets": {"b02": dict(existing_asset)}}} - datasets: dict[str, xr.Dataset | tuple[str, ...] | None] = { + datasets = { # already referenced by an existing asset -> must not be duplicated "/measurements/reflectance/r10m": xr.Dataset({"b02": (["y", "x"], np.zeros((4, 4)))}), # new pyramid level -> assets added, spatial_ref skipped @@ -571,9 +625,7 @@ def test_add_multiscale_pyramids_to_stac_metadata_adds_missing_levels() -> None: "spatial_ref": ((), 0), } ), - # the plan-driven converter passes variable names instead of datasets - "/measurements/reflectance/r60m": ("b01", "spatial_ref"), - "/measurements/reflectance": None, + "/measurements/reflectance/r60m": None, } result = add_multiscale_pyramids_to_stac_metadata(datasets, attrs) @@ -583,7 +635,6 @@ def test_add_multiscale_pyramids_to_stac_metadata_adds_missing_levels() -> None: "b02": existing_asset, "b02_r20m": {"href": "/measurements/reflectance/r20m/b02", "title": "b02_r20m"}, "b05_r20m": {"href": "/measurements/reflectance/r20m/b05", "title": "b05_r20m"}, - "b01_r60m": {"href": "/measurements/reflectance/r60m/b01", "title": "b01_r60m"}, } diff --git a/tests/test_s2_multiscale.py b/tests/test_s2_multiscale.py index 125f8072..851c8009 100644 --- a/tests/test_s2_multiscale.py +++ b/tests/test_s2_multiscale.py @@ -1,19 +1,22 @@ """ -Tests for the S2 optimized converter pipeline: the uniform encoding it stores -and the structure `convert_s2_optimized` produces end to end. The pyramids -themselves are planned by `data_api.s2_plan` and written by -`data_api.s2_write`, which carry their own tests; the golden snapshots are -pinned by `tests/test_data_api/test_s2_plan.py`. +Tests for S2 multiscale pyramid creation with xy-aligned sharding. """ +import json +import os import pathlib +from collections.abc import Mapping, Sequence from itertools import pairwise -from typing import Any +from typing import Any, cast import numpy as np import pytest import xarray as xr import zarr +from affine import Affine +from pydantic_zarr.core import tuplify_json +from pydantic_zarr.v3 import GroupSpec +from pyproj import CRS from structlog.testing import capture_logs from zarr.core.metadata import ArrayV3Metadata @@ -22,9 +25,22 @@ calculate_aligned_chunk_size, create_uniform_encoding, rechunk_dataset_for_encoding, + write_dataset_geo_metadata, ) from eopf_geozarr.s2_optimization.s2_converter import convert_s2_optimized -from eopf_geozarr.s2_optimization.s2_multiscale import _AUX_MULTISCALES, S2Type +from eopf_geozarr.s2_optimization.s2_multiscale import ( + _AUX_MULTISCALES, + MultiscaleSpec, + S2Type, + _coarsen_variable, + _declare_scl_nodata, + create_downsampled_resolution_group, + create_multiscale_from_datatree, + generic_multiscales, + inject_missing_bands, +) + +from .conftest import create_zarrv2_group_from_json, get_stem, s2_example_json_paths def _codec_names(metadata: ArrayV3Metadata) -> list[str]: @@ -45,6 +61,86 @@ def sample_dataset(s2_group_example: pathlib.Path) -> xr.Dataset: )["measurements/reflectance/r10m"].to_dataset() +def test_create_downsampled_resolution_group_quality_mask() -> None: + """Quality-mask downsampling is disabled, so it should raise.""" + x = np.arange(8) + y = np.arange(6) + quality = xr.DataArray( + np.random.randint(0, 2, (6, 8), dtype=np.uint8), + dims=["y", "x"], + coords={"y": y, "x": x}, + name="quality_clouds", + ) + ds = xr.Dataset({"quality_clouds": quality}) + + with pytest.raises(ValueError, match="quality_mask"): + create_downsampled_resolution_group(ds, factor=2) + + +def test_generic_multiscales_prefers_coordinate_transform_for_inconsistent_rio( + tmp_path: pathlib.Path, +) -> None: + """Derived levels should not reuse the stale rio transform inherited from the finest level.""" + crs = CRS.from_epsg(32631) + size = 24 # 24 px at 10 m -> 12 px at 20 m -> 4 px at 60 m -> 2 px at 120 m + x = 600000.0 + np.arange(size, dtype="float64") * 10 + y = 4900020.0 - np.arange(size, dtype="float64") * 10 + r10m = _rechunk_ds( + xr.Dataset( + {"band": (["y", "x"], np.ones((size, size), dtype=np.uint16))}, + coords={"x": x, "y": y}, + ), + 1024, + ) + r10m = write_dataset_geo_metadata(r10m, crs=crs) + # A GeoTransform on `spatial_ref` is carried into every coarsened level, where + # the rio transform then no longer matches the coordinate grid. + r10m.rio.write_transform(Affine(10.0, 0.0, 599995.0, 0.0, -10.0, 4900025.0), inplace=True) + + output_path = tmp_path / "multiscales.zarr" + base_path = "/measurements/reflectance" + with capture_logs(): + generic_multiscales( + MultiscaleSpec(base_path=base_path, scale_levels=(10, 20, 60, 120)), + src_processed_groups={"r10m": r10m}, + output_group=zarr.create_group(output_path), + spatial_chunk=1024, + crs=crs, + ) + + parent_group = zarr.open_group(output_path, path=base_path) + multiscales = parent_group.attrs["multiscales"] + assert isinstance(multiscales, Mapping) + layout = multiscales["layout"] + assert isinstance(layout, Sequence) + assert [level["asset"] for level in layout if isinstance(level, Mapping)] == [ + "r10m", + "r20m", + "r60m", + "r120m", + ] + derived_level = next( + level for level in layout if isinstance(level, Mapping) and level["asset"] == "r120m" + ) + assert isinstance(derived_level, Mapping) + assert derived_level["derived_from"] == "r60m" + assert derived_level["spatial:shape"] == [2, 2] + transform = derived_level["spatial:transform"] + assert isinstance(transform, Sequence) + # Origin is the outer pixel edge, half of the 120 m pixel outside the first centre. + assert tuple(transform) == ( + 120.0, + 0.0, + 599995.0, + 0.0, + -120.0, + 4900025.0, + ) + + # The parent footprint covers the pixel edges of the finest level (#266). + assert parent_group.attrs["spatial:bbox"] == [599995.0, 4899785.0, 600235.0, 4900025.0] + + @pytest.mark.parametrize("mask_and_scale", [False, True], ids=["raw", "decoded"]) @pytest.mark.parametrize("scale_offset_codec", [True, False], ids=["codec", "cf"]) def test_create_measurements_encoding( @@ -153,7 +249,81 @@ def _band_names(group: zarr.Group) -> set[str]: # L1C r60m is filled with every finer band, so it and its overviews carry all 13. _L1C_ALL_BANDS = {f"b{i:02d}" for i in range(1, 13)} | {"b8a"} +# Footprint of an S2 tile (109.8 km square) in UTM, used to give the JSON fixtures +# real coordinates: they carry no chunk data, so every x/y value is the fill value. +_TILE_CRS = CRS.from_epsg(32632) +_TILE_X_MIN = 300000.0 +_TILE_Y_MAX = 5000040.0 +_TILE_EXTENT = 109800.0 + + +def _with_tile_coordinates(ds: xr.Dataset) -> xr.Dataset: + """Replace the x/y coordinates with pixel centres covering `_TILE_EXTENT`.""" + if "x" not in ds.dims or "y" not in ds.dims: + return ds + res_x = _TILE_EXTENT / ds.sizes["x"] + res_y = _TILE_EXTENT / ds.sizes["y"] + return ds.assign_coords( + x=_TILE_X_MIN + (np.arange(ds.sizes["x"]) + 0.5) * res_x, + y=_TILE_Y_MAX - (np.arange(ds.sizes["y"]) + 0.5) * res_y, + ) + + +@pytest.mark.filterwarnings("ignore:.*:RuntimeWarning") +@pytest.mark.filterwarnings("ignore:.*:FutureWarning") +@pytest.mark.filterwarnings("ignore:.*:UserWarning") +@pytest.mark.parametrize("source_path", s2_example_json_paths, ids=get_stem) +def test_create_multiscale_from_datatree_snapshot( + source_path: pathlib.Path, tmp_path: pathlib.Path +) -> None: + """Compare the output structure of a Zarr v2 S2 input against a stored snapshot. + + Any change to array metadata (dtype, fill value, chunks, codecs, attributes) + or to the set of arrays shows up here. When a change is intended, regenerate + the snapshots with `REGENERATE_SNAPSHOTS=1 pytest -k snapshot` and review + the JSON diff. + """ + input_group = zarr.open_group(create_zarrv2_group_from_json(source_path, tmp_path)) + dt_input = xr.open_datatree( + input_group.store, # pyright: ignore[reportArgumentType] + engine="zarr", + chunks={}, + mask_and_scale=False, + decode_coords="all", + ).map_over_datasets(_with_tile_coordinates) + output_path = str(tmp_path / "output.zarr") + with capture_logs(): + create_multiscale_from_datatree( + dt_input, + output_group=zarr.create_group(output_path), + enable_sharding=True, + spatial_chunk=1024, + crs=_TILE_CRS, + ) + observed_json = GroupSpec.from_zarr( + zarr.open_group(output_path, use_consolidated=False) + ).model_dump() + snapshot_path = pathlib.Path("tests/_test_data/optimized_geozarr_examples") / ( + source_path.stem + ".json" + ) + if os.environ.get("REGENERATE_SNAPSHOTS"): + snapshot_path.write_text(json.dumps(observed_json, indent=2, sort_keys=True) + "\n") + + observed = GroupSpec(**tuplify_json(observed_json)).to_flat() + expected = GroupSpec(**tuplify_json(json.loads(snapshot_path.read_text()))).to_flat() + assert set(observed) == set(expected) + + # Compare as JSON: a NaN fill value never equals itself as a float. + def canonical(node: object) -> str: + return json.dumps(node.model_dump(), sort_keys=True) # type: ignore[attr-defined] + + assert [key for key in observed if canonical(observed[key]) != canonical(expected[key])] == [] + + +@pytest.mark.filterwarnings("ignore:.*:RuntimeWarning") +@pytest.mark.filterwarnings("ignore:.*:FutureWarning") +@pytest.mark.filterwarnings("ignore:.*:UserWarning") def test_create_multiscale_from_datatree( s2_group_example: pathlib.Path, tmp_path: pathlib.Path, @@ -325,3 +495,733 @@ def test_create_multiscale_from_datatree( if not statistics_by_href.get(f"{level_group.path}/{band}") ] assert without_statistics == [] + + +# A 6x6 nodata block in r60m covers r120m[0:3, 0:3] and r360m[0, 0] entirely. +_NODATA_BLOCK = 6 +_SCALE_FACTOR = 0.0001 +_ADD_OFFSET = -0.1 + + +def _make_minimal_s2_datatree(*, raw: bool) -> xr.DataTree: + """Build a tiny reflectance DataTree for behavior tests. + + Three levels (r10m, r20m, r60m), one band each, packed like ESA S2 L2A + reflectance (uint16, `scale_factor` 0.0001, `add_offset` -0.1, nodata 0). + The r60m band has a nodata block of `_NODATA_BLOCK` pixels in its top-left + corner. + + `raw=False` gives decoded floats with the CF values in `.encoding`, as the + CLI opens products. `raw=True` gives the packed integers with the CF values + in `.attrs` and the nodata value only in the EOPF `fill_value` attribute, + as CPM Zarr v3 products opened with `mask_and_scale=False`. + """ + rng = np.random.default_rng(0) + + def _band(size: int, *, nodata_block: int = 0) -> xr.DataArray: + data = rng.uniform(0.0, 1.0, size=(size, size)).astype("float64") + data[:nodata_block, :nodata_block] = np.nan + coords = { + "x": np.arange(size, dtype="float64"), + "y": np.arange(size, dtype="float64"), + } + if raw: + packed = np.round((data - _ADD_OFFSET) / _SCALE_FACTOR) + packed = np.where(np.isnan(data), 0, packed).astype("uint16") + return xr.DataArray( + packed, + dims=["y", "x"], + coords=coords, + attrs={"scale_factor": _SCALE_FACTOR, "add_offset": _ADD_OFFSET, "fill_value": 0}, + ) + da = xr.DataArray(data, dims=["y", "x"], coords=coords) + da.encoding = { + "scale_factor": _SCALE_FACTOR, + "add_offset": _ADD_OFFSET, + "_FillValue": 0, + "dtype": np.dtype("uint16"), + } + return da + + r10m = xr.Dataset({"b02": _band(120)}) + r20m = xr.Dataset({"b05": _band(60)}) + r60m = xr.Dataset({"b01": _band(20, nodata_block=_NODATA_BLOCK)}) + # L1C cloud classification bitmask (OPAQUE | CIRRUS | SNOW_ICE), unpacked uint8 + # on the r60m grid, as in ESA products. Required by `create_multiscale_from_datatree`. + l1c_classification = xr.Dataset( + { + "b00": xr.DataArray( + rng.integers(0, 8, size=(20, 20), dtype="uint8"), + dims=["y", "x"], + coords=r60m.coords, + attrs={"flag_masks": [1, 2, 4], "flag_meanings": ["OPAQUE", "CIRRUS", "SNOW_ICE"]}, + ) + } + ) + + dt = xr.DataTree() + dt["measurements/reflectance/r10m"] = xr.DataTree(r10m) + dt["measurements/reflectance/r20m"] = xr.DataTree(r20m) + dt["measurements/reflectance/r60m"] = xr.DataTree(r60m) + dt["conditions/mask/l1c_classification/r60m"] = xr.DataTree(l1c_classification) + return dt + + +def _decoded(da: xr.DataArray) -> np.ndarray: + """Values of a synthetic band as the source product defines them (NaN for nodata).""" + values = da.values.astype("float64") + if np.issubdtype(da.dtype, np.integer): + return np.where(values == 0, np.nan, values * _SCALE_FACTOR + _ADD_OFFSET) + return values + + +# Spatial chunk small enough that no padding is needed for the 20x20 r60m band. +_BEHAVIOR_SPATIAL_CHUNK = 16 + +# Original groups in the synthetic datatree — those that are packed on input. +_ORIGINAL_GROUPS = { + "measurements/reflectance/r10m": "b02", + "measurements/reflectance/r20m": "b05", + "measurements/reflectance/r60m": "b01", +} + +# Downsampled groups added by `create_multiscale_from_datatree`, derived from the +# r60m level by successive coarsening. `_coarsen_variable` preserves the source +# variable's packing, so these levels are encoded like the original groups. +_DOWNSAMPLED_GROUPS = ( + "measurements/reflectance/r120m", + "measurements/reflectance/r360m", + "measurements/reflectance/r720m", +) + + +@pytest.mark.filterwarnings("ignore:.*:RuntimeWarning") +@pytest.mark.filterwarnings("ignore:.*:FutureWarning") +@pytest.mark.filterwarnings("ignore:.*:UserWarning") +@pytest.mark.parametrize("raw", [False, True], ids=["decoded", "raw"]) +@pytest.mark.parametrize("scale_offset_codec", [True, False], ids=["codec", "cf"]) +def test_create_multiscale_from_datatree_behavior( + scale_offset_codec: bool, + raw: bool, + tmp_path: pathlib.Path, +) -> None: + """Verify both encoding modes on every level of a tiny pyramid, for both input forms. + + * default: every level keeps the source packing in Zarr `scale_offset` + + `cast_value` codecs; the logical dtype is float32 (decoded) and there are + no CF scale attributes. + * `scale_offset_codec=False`: every level is uint16 on disk with the CF + `scale_factor`, `add_offset` and `_FillValue` attributes, as in the ESA + product. + + In both modes, decoded values match the source within one packing step and + nodata stays nodata through the pyramid. + """ + dt_input = _make_minimal_s2_datatree(raw=raw) + output_path = str(tmp_path / "output.zarr") + + with capture_logs(): + create_multiscale_from_datatree( + dt_input, + output_group=zarr.create_group(output_path), + enable_sharding=False, + spatial_chunk=_BEHAVIOR_SPATIAL_CHUNK, + # The spatial convention attrs that the pyramid layout needs are only written with a CRS. + crs=CRS.from_epsg(32632), + scale_offset_codec=scale_offset_codec, + ) + + def _check_array(path: str) -> None: + arr = zarr.open_array(output_path, path=path) + assert isinstance(arr.metadata, ArrayV3Metadata) + codec_names = _codec_names(arr.metadata) + cf_attrs = {"scale_factor", "add_offset"} & set(arr.attrs) + if not scale_offset_codec: + assert arr.dtype == np.uint16, f"{path}: expected uint16 on disk, got {arr.dtype}" + assert "ScaleOffset" not in codec_names + assert "CastValue" not in codec_names + assert arr.attrs["scale_factor"] == pytest.approx(_SCALE_FACTOR) + assert arr.attrs["add_offset"] == pytest.approx(_ADD_OFFSET) + assert arr.attrs["_FillValue"] == 0 + else: + assert arr.dtype == np.float32, ( + f"{path}: expected float32 logical dtype, got {arr.dtype}" + ) + assert "ScaleOffset" in codec_names, f"{path}: codecs={codec_names}" + assert "CastValue" in codec_names, f"{path}: codecs={codec_names}" + assert cf_attrs == set(), f"{path}: unexpected CF attrs {cf_attrs}" + + for group_path, var_name in _ORIGINAL_GROUPS.items(): + _check_array(f"{group_path}/{var_name}") + + parent_group = zarr.open_group(output_path, path="measurements/reflectance") + for group_path in _DOWNSAMPLED_GROUPS: + # All three downsampled levels should exist for the minimal datatree + # (10/20/60 → 120/360/720). + sub = group_path.removeprefix("measurements/reflectance/") + assert sub in dict(parent_group.groups()), f"missing downsampled group {group_path}" + ds = xr.open_dataset(output_path, engine="zarr", group=group_path, decode_coords="all") + assert ds.data_vars, f"{group_path} has no variables" + for name in ds.data_vars: + _check_array(f"{group_path}/{name}") + + # Decoded values match the source, quantised onto the packing grid. + for group_path, var_name in _ORIGINAL_GROUPS.items(): + expected = _decoded(dt_input[group_path].to_dataset()[var_name]) + observed = xr.open_dataset( + output_path, engine="zarr", group=group_path, decode_coords="all" + )[var_name].values + # Quantisation plus the float32 round trip stay within one packing step. + np.testing.assert_allclose(observed, expected, atol=_SCALE_FACTOR, rtol=0) + + # Nodata stays nodata through the pyramid: pixels fully covered by the + # source nodata block decode to NaN, the others do not. + for group_path, nodata_extent in ( + ("measurements/reflectance/r60m", _NODATA_BLOCK), + ("measurements/reflectance/r120m", _NODATA_BLOCK // 2), + ("measurements/reflectance/r360m", _NODATA_BLOCK // 6), + ): + decoded = xr.open_dataset( + output_path, engine="zarr", group=group_path, decode_coords="all" + )["b01"].values + block = decoded[:nodata_extent, :nodata_extent] + assert np.isnan(block).all(), f"{group_path}: nodata block not NaN" + assert np.isnan(decoded).sum() == block.size, f"{group_path}: unexpected NaN outside block" + + +@pytest.mark.filterwarnings("ignore:.*:RuntimeWarning") +@pytest.mark.filterwarnings("ignore:.*:FutureWarning") +@pytest.mark.filterwarnings("ignore:.*:UserWarning") +def test_create_multiscale_reuses_native_reflectance_levels(tmp_path: pathlib.Path) -> None: + """Native r20m/r60m reflectance groups are reused, not coarsened again from r10m. + + The "skip existing path" guard in `stream_write_dataset` would hide a + regression on disk, so the created levels are checked through the logs and + the native groups through their variables and values. + """ + dt_input = _make_minimal_s2_datatree(raw=False) + output_path = str(tmp_path / "output.zarr") + + with capture_logs() as logs: + create_multiscale_from_datatree( + dt_input, + output_group=zarr.create_group(output_path), + enable_sharding=False, + spatial_chunk=_BEHAVIOR_SPATIAL_CHUNK, + crs=CRS.from_epsg(32632), + ) + + created = {e["level"] for e in logs if e["event"] == "Creating level with resolution"} + assert created == {"r120m", "r360m", "r720m"} + + # The native levels hold their own band with their own values, not a coarsened r10m band. + for group_path, var_name in _ORIGINAL_GROUPS.items(): + ds = xr.open_dataset(output_path, engine="zarr", group=group_path, decode_coords="all") + assert set(ds.data_vars) == {var_name}, f"{group_path}: {set(ds.data_vars)}" + expected = _decoded(dt_input[group_path].to_dataset()[var_name]) + np.testing.assert_allclose(ds[var_name].values, expected, atol=_SCALE_FACTOR, rtol=0) + + +@pytest.mark.parametrize("enable_sharding", [False, True]) +def test_create_multiscale_applies_compression_level_to_all_levels( + tmp_path: pathlib.Path, enable_sharding: bool +) -> None: + """A non-default `compression_level` reaches the coarsened levels, not only the native ones.""" + from zarr.codecs import BloscCodec + + dt_input = _make_minimal_s2_datatree(raw=False) + output_path = str(tmp_path / "output.zarr") + create_multiscale_from_datatree( + dt_input, + output_group=zarr.create_group(output_path), + enable_sharding=enable_sharding, + spatial_chunk=_BEHAVIOR_SPATIAL_CHUNK, + crs=CRS.from_epsg(32632), + compression_level=7, + ) + + levels: dict[str, set[int]] = {} + for group_path in (*_ORIGINAL_GROUPS, *_DOWNSAMPLED_GROUPS): + level = zarr.open_group(f"{output_path}/{group_path}", mode="r") + for name, array in level.arrays(): + if name in ("x", "y", "spatial_ref"): + continue + assert isinstance(array.metadata, ArrayV3Metadata) + codecs = [ + inner + for codec in array.metadata.codecs + for inner in (codec, *getattr(codec, "codecs", ())) + ] + levels[f"{group_path}/{name}"] = { + codec.clevel for codec in codecs if isinstance(codec, BloscCodec) + } + assert levels, "no data arrays found" + assert all(clevels == {7} for clevels in levels.values()), levels + + +def test_create_multiscale_reuses_native_aux_levels(tmp_path: pathlib.Path) -> None: + """Native r60m levels of the auxiliary pyramids are reused, not coarsened again from r20m. + + Checked through the logs and the stored values, so the test does not rely on + the "skip existing path" guard in `stream_write_dataset`, which would hide a + coarsened level on disk. + """ + dt_input = _make_minimal_s2_datatree(raw=False) + dt_input.name = "S2A_MSIL2A_20250811T112131" + rng = np.random.default_rng(1) + aux_vars = {"conditions/mask/l2a_classification": "scl", "quality/probability": "cld"} + for base_path, var_name in aux_vars.items(): + for level, size in (("r20m", 60), ("r60m", 20)): + coords = {"x": np.arange(float(size)), "y": np.arange(float(size))} + data = rng.integers(0, 12, size=(size, size), dtype="uint8") + band = xr.DataArray(data, dims=["y", "x"], coords=coords) + dt_input[f"{base_path}/{level}"] = xr.DataTree(xr.Dataset({var_name: band})) + output_path = str(tmp_path / "output.zarr") + + with capture_logs() as logs: + create_multiscale_from_datatree( + dt_input, + output_group=zarr.create_group(output_path), + enable_sharding=False, + spatial_chunk=_BEHAVIOR_SPATIAL_CHUNK, + crs=CRS.from_epsg(32632), + ) + + for base_path, var_name in aux_vars.items(): + created = { + e["level"] + for e in logs + if e["event"] == "Creating level with resolution" and e["base_path"] == f"/{base_path}" + } + assert created == {"r120m", "r360m", "r720m"}, base_path + + # The native r60m level holds the source values, not r20m values sampled down. + group_path = f"{base_path}/r60m" + ds = xr.open_dataset( + output_path, engine="zarr", group=group_path, mask_and_scale=False, decode_coords="all" + ) + expected = dt_input[group_path].to_dataset()[var_name].values + np.testing.assert_array_equal(ds[var_name].values, expected) + + +def _convention_names(attrs: Mapping[str, Any]) -> set[str]: + """Names of the conventions declared in `zarr_conventions`.""" + return {c["name"] for c in cast("list[dict[str, Any]]", attrs["zarr_conventions"])} + + +def test_create_multiscale_declares_crs_on_conditions_groups(tmp_path: pathlib.Path) -> None: + """`conditions/geometry` and `conditions/mask/detector_footprint/r*` declare the tile CRS. + + The angle grids are node-registered: `(x[0], y[0])` is the upper-left corner of + the tile, so `spatial:transform` starts there and is not moved by a half cell. + Arrays without the x/y dimensions get no grid mapping. + See EOPF-Explorer/data-model#346. + """ + dt_input = _make_minimal_s2_datatree(raw=False) + rng = np.random.default_rng(2) + + # 23 x 23 nodes with a step of 5000 m, from the upper-left corner of the tile. + size, step, ulx, uly = 23, 5000.0, 600000.0, 7800000.0 + x = ulx + step * np.arange(size) + y = uly - step * np.arange(size) + dt_input["conditions/geometry"] = xr.DataTree( + xr.Dataset( + { + "mean_sun_angles": (["angle"], rng.uniform(0, 180, 2)), + "sun_angles": (["angle", "y", "x"], rng.uniform(0, 180, (2, size, size))), + "mean_viewing_incidence_angles": (["band", "angle"], rng.uniform(0, 180, (3, 2))), + "viewing_incidence_angles": ( + ["band", "detector", "angle", "y", "x"], + rng.uniform(0, 180, (3, 2, 2, size, size)), + ), + }, + coords={ + "x": x, + "y": y, + "angle": ["zenith", "azimuth"], + "band": ["b01", "b02", "b03"], + "detector": [1, 2], + }, + ) + ) + r60m_coords = dt_input["measurements/reflectance/r60m"].to_dataset().coords + footprint = xr.DataArray( + rng.integers(0, 3, size=(20, 20), dtype="uint8"), dims=["y", "x"], coords=r60m_coords + ) + dt_input["conditions/mask/detector_footprint/r60m"] = xr.DataTree( + xr.Dataset({"b01": footprint}) + ) + output_path = str(tmp_path / "output.zarr") + + with capture_logs(): + create_multiscale_from_datatree( + dt_input, + output_group=zarr.create_group(output_path), + enable_sharding=False, + spatial_chunk=_BEHAVIOR_SPATIAL_CHUNK, + crs=CRS.from_epsg(32636), + ) + + geometry = zarr.open_group(output_path, path="conditions/geometry", mode="r") + attrs = geometry.attrs.asdict() + assert _convention_names(attrs) == {"spatial", "proj"} + assert attrs["proj:code"] == "EPSG:32636" + assert attrs["spatial:dimensions"] == ["y", "x"] + assert attrs["spatial:registration"] == "node" + assert attrs["spatial:shape"] == [size, size] + assert attrs["spatial:transform"] == [step, 0.0, ulx, 0.0, -step, uly] + assert attrs["spatial:bbox"] == [ulx, uly - step * (size - 1), ulx + step * (size - 1), uly] + + assert geometry["sun_angles"].attrs["grid_mapping"] == "spatial_ref" + assert geometry["viewing_incidence_angles"].attrs["grid_mapping"] == "spatial_ref" + assert "grid_mapping" not in geometry["mean_sun_angles"].attrs + assert "grid_mapping" not in geometry["mean_viewing_incidence_angles"].attrs + + detector_footprint = zarr.open_group( + output_path, path="conditions/mask/detector_footprint/r60m", mode="r" + ).attrs.asdict() + assert _convention_names(detector_footprint) == {"spatial", "proj"} + assert detector_footprint["proj:code"] == "EPSG:32636" + assert detector_footprint["spatial:registration"] == "pixel" + assert detector_footprint["spatial:shape"] == [20, 20] + assert "spatial:transform" in detector_footprint + + +def test_create_multiscale_builds_atmosphere_pyramid(tmp_path: pathlib.Path) -> None: + """`quality/atmosphere` (aot, wvp) gets a pyramid like the reflectance bands. + + Its native r10m/r20m/r60m levels are reused, r120m/r360m/r720m are block means + of the level before them with nodata (0) skipped, and the parent group lists all + six levels in its `multiscales` layout. + """ + dt_input = _make_minimal_s2_datatree(raw=False) + dt_input.name = "S2A_MSIL2A_20250811T112131" + rng = np.random.default_rng(3) + for level, size in (("r10m", 120), ("r20m", 60), ("r60m", 20)): + coords = {"x": np.arange(float(size)), "y": np.arange(float(size))} + variables = {} + for name in ("aot", "wvp"): + data = rng.integers(1, 3000, size=(size, size)).astype("float64") * 0.001 + data[:2, :2] = np.nan + da = xr.DataArray(data, dims=["y", "x"], coords=coords) + da.encoding = {"scale_factor": 0.001, "_FillValue": 0, "dtype": np.dtype("uint16")} + variables[name] = da + dt_input[f"quality/atmosphere/{level}"] = xr.DataTree(xr.Dataset(variables)) + output_path = str(tmp_path / "output.zarr") + + with capture_logs() as logs: + create_multiscale_from_datatree( + dt_input, + output_group=zarr.create_group(output_path), + enable_sharding=False, + spatial_chunk=_BEHAVIOR_SPATIAL_CHUNK, + crs=CRS.from_epsg(32632), + ) + + created = { + e["level"] + for e in logs + if e["event"] == "Creating level with resolution" + and e["base_path"] == "/quality/atmosphere" + } + assert created == {"r120m", "r360m", "r720m"} + + parent = zarr.open_group(output_path, path="quality/atmosphere", mode="r") + multiscales: Any = parent.attrs["multiscales"] + assert [lo["asset"] for lo in multiscales["layout"]] == [ + "r10m", + "r20m", + "r60m", + "r120m", + "r360m", + "r720m", + ] + assert multiscales["resampling_method"] == "average" + + def open_level(name: str) -> xr.Dataset: + return xr.open_dataset( + output_path, engine="zarr", group=f"quality/atmosphere/{name}", decode_coords="all" + ) + + r60m, r120m = open_level("r60m"), open_level("r120m") + source_r60m = dt_input["quality/atmosphere/r60m"].to_dataset() + for name in ("aot", "wvp"): + expected = r60m[name].coarsen(x=2, y=2, boundary="trim").mean(skipna=True) # type: ignore[attr-defined] + np.testing.assert_allclose(r120m[name].values, expected.values, atol=0.001) + # the native r60m values are kept, not coarsened again from r20m + np.testing.assert_allclose(r60m[name].values, source_r60m[name].values, atol=0.001) + + +@pytest.mark.parametrize("enable_sharding", [False, True]) +def test_create_multiscale_chunks_coarsened_levels_like_native_levels( + tmp_path: pathlib.Path, enable_sharding: bool +) -> None: + """Every level, native or coarsened, is chunked by `spatial_chunk`. + + `quality/probability` has no native r60m level, so its r60m is coarsened from + r20m by a factor of 3 and would otherwise take its chunks from the r20m dask + chunks (the r20m shard, or a third of `spatial_chunk`). + """ + dt_input = _make_minimal_s2_datatree(raw=False) + dt_input.name = "S2A_MSIL2A_20250811T112131" + rng = np.random.default_rng(2) + coords = {"x": np.arange(60.0), "y": np.arange(60.0)} + cld = xr.DataArray(rng.integers(0, 101, size=(60, 60), dtype="uint8"), dims=["y", "x"]) + dt_input["quality/probability/r20m"] = xr.DataTree(xr.Dataset({"cld": cld}, coords=coords)) + output_path = str(tmp_path / "output.zarr") + create_multiscale_from_datatree( + dt_input, + output_group=zarr.create_group(output_path), + enable_sharding=enable_sharding, + spatial_chunk=_BEHAVIOR_SPATIAL_CHUNK, + crs=CRS.from_epsg(32632), + ) + + root = zarr.open_group(output_path, mode="r") + chunks = { + path: (array.shape, array.chunks) + for path, array in root.members(max_depth=None) + if isinstance(array, zarr.Array) and array.ndim == 2 + } + assert "quality/probability/r60m/cld" in chunks + assert "quality/probability/r120m/cld" in chunks + mismatched = { + path: (shape, chunk) + for path, (shape, chunk) in chunks.items() + if chunk != tuple(min(_BEHAVIOR_SPATIAL_CHUNK, size) for size in shape) + } + assert not mismatched, mismatched + + +# --------------------------------------------------------------------------- +# _coarsen_variable +# --------------------------------------------------------------------------- + + +@pytest.mark.parametrize("factor", [2, 3]) +@pytest.mark.parametrize("var_name", ["scl", "b00"]) +def test_coarsen_variable_classification(var_name: str, factor: int) -> None: + """Classification variables (SCL, L1C cloud bitmask) take the centre pixel of each block. + + The output coordinates are the block centres, so the centre pixel keeps the + classes aligned with the averaged bands. For an even factor there is no single + centre pixel and the lower-right one of the middle four is taken. + """ + size = 2 * factor + data = np.arange(size * size, dtype="uint8").reshape(size, size) + coords = {"y": np.arange(float(size)), "x": np.arange(float(size))} + var = xr.DataArray(data, dims=["y", "x"], coords=coords) + result = _coarsen_variable(var_name, var, factor=factor) + assert result.shape == (2, 2) + assert result.dtype == np.uint8 + centre = factor // 2 + np.testing.assert_array_equal(result.values, data[centre::factor, centre::factor]) + # The sampled pixel lies on the block centre for odd factors, half a pixel off for even ones. + block_centres = np.arange(2) * factor + (factor - 1) / 2 + np.testing.assert_array_equal(result["x"].values, block_centres) + np.testing.assert_array_equal(result["y"].values, block_centres) + sampled = coords["x"][centre::factor] + assert np.abs(sampled - block_centres).max() == (0 if factor % 2 else 0.5) + + +@pytest.mark.parametrize( + ("attrs", "expected_fill"), + [({}, 0), ({"fill_value": 255}, None)], + ids=["undeclared", "declared"], +) +def test_declare_scl_nodata(attrs: dict, expected_fill: int | None) -> None: + """SCL gets its NO_DATA class as `_FillValue` only when the source declares no nodata.""" + scl = xr.DataArray(np.zeros((2, 2), dtype="uint8"), dims=["y", "x"], attrs=attrs) + cld = xr.DataArray(np.zeros((2, 2), dtype="uint8"), dims=["y", "x"]) + result = _declare_scl_nodata(xr.Dataset({"scl": scl, "cld": cld})) + assert result["scl"].encoding.get("_FillValue") == expected_fill + # 0 is a valid probability, so other variables are left alone. + assert "_FillValue" not in result["cld"].encoding + + +def test_coarsen_variable_quality_mask() -> None: + """Quality mask downsampling is disabled, so it should raise.""" + data = np.array([[0, 1], [2, 3]], dtype="uint8") + var = xr.DataArray(data, dims=["y", "x"], coords={"y": np.arange(2.0), "x": np.arange(2.0)}) + with pytest.raises(ValueError, match="quality_mask"): + _coarsen_variable("quality_cirrus", var, factor=2) + + +# --------------------------------------------------------------------------- +# inject_missing_bands +# --------------------------------------------------------------------------- + + +def _make_reflectance_datatree() -> xr.DataTree: + """Build a minimal DataTree with /measurements/reflectance/r10m and r20m.""" + size_10m = 120 # must be divisible by 2 (→60) and 6 (→20) + x10 = np.arange(size_10m, dtype="float64") + y10 = np.arange(size_10m, dtype="float64") + + r10m_ds = xr.Dataset( + { + "b02": (["y", "x"], np.ones((size_10m, size_10m), dtype="uint16")), + "b03": (["y", "x"], np.ones((size_10m, size_10m), dtype="uint16")), + "b04": (["y", "x"], np.ones((size_10m, size_10m), dtype="uint16")), + "b08": (["y", "x"], np.full((size_10m, size_10m), 42, dtype="uint16")), + }, + coords={"x": x10, "y": y10}, + ) + + size_20m = size_10m // 2 + x20 = np.arange(size_20m, dtype="float64") + y20 = np.arange(size_20m, dtype="float64") + r20m_ds = xr.Dataset( + { + "b05": (["y", "x"], np.ones((size_20m, size_20m), dtype="uint16")), + }, + coords={"x": x20, "y": y20}, + ) + + dt = xr.DataTree() + dt["measurements/reflectance/r10m"] = xr.DataTree(r10m_ds) + dt["measurements/reflectance/r20m"] = xr.DataTree(r20m_ds) + return dt + + +@pytest.mark.parametrize("scale_offset_codec", [True, False]) +def test_inject_missing_bands_skips_unmasked_nodata(scale_offset_codec: bool) -> None: + """Decoded Zarr v3 input keeps its nodata unmasked; injection must still skip it. + + xarray only masks `_FillValue`, so a decoded CPM Zarr v3 band shows nodata + as `0 * scale_factor + add_offset` and declares it only in the EOPF + `fill_value` attribute. The codec mode injects decoded float32 values; the + ESA layout injects packed integers, with no cast to float. + """ + dt = _make_reflectance_datatree() + decoded = np.full((120, 120), 0.3) + decoded[0, 0] = -0.1 # nodata (DN 0) in the top-left 2x2 block + decoded[2:4, 2:4] = -0.1 # a fully nodata 2x2 block + b08 = xr.DataArray( + decoded, + dims=["y", "x"], + coords=dt["measurements/reflectance/r10m"].to_dataset().coords, + attrs={"fill_value": 0}, + ) + b08.encoding = {"scale_factor": 0.0001, "add_offset": -0.1, "dtype": np.dtype("uint16")} + r10m = dt["measurements/reflectance/r10m"].to_dataset().assign(b08=b08) + dt["measurements/reflectance/r10m"] = xr.DataTree(r10m) + r20m_ds = dt["measurements/reflectance/r20m"].to_dataset() + + result = inject_missing_bands( + r20m_ds, + dt, + target_resolution=20, + bands={"b08"}, + spatial_chunk=1024, + scale_offset_codec=scale_offset_codec, + ) + + values = result["b08"].values + if scale_offset_codec: + assert values.dtype == np.float32 + assert values[0, 0] == pytest.approx(0.3) # the nodata pixel is not averaged in + assert np.isnan(values[1, 1]) # a fully nodata block stays nodata + assert np.isnan(values).sum() == 1 + else: + assert values.dtype == np.uint16 + assert result["b08"].attrs["scale_factor"] == pytest.approx(0.0001) + assert result["b08"].attrs["add_offset"] == pytest.approx(-0.1) + assert result["b08"].encoding["_FillValue"] == 0 + assert values[0, 0] == 4000 # (0.3 + 0.1) / 0.0001: nodata is not averaged in + assert values[1, 1] == 0 # a fully nodata block stays nodata + assert (values == 0).sum() == 1 + + +def test_inject_missing_bands_respects_bands_filter() -> None: + """With bands={"b08"}, only b08 should be injected even when others are eligible.""" + dt = _make_reflectance_datatree() + r20m_ds = dt["measurements/reflectance/r20m"].to_dataset() + + result = inject_missing_bands( + r20m_ds, dt, target_resolution=20, bands={"b08"}, spatial_chunk=1024 + ) + + assert "b08" in result.data_vars + assert result["b08"].shape == (60, 60) + assert result["b08"].dtype == np.uint16 + # b02/b03/b04 are also eligible (10m native, missing from r20m) but excluded + for excluded in ("b02", "b03", "b04"): + assert excluded not in result.data_vars + + +def test_inject_missing_bands_skips_existing() -> None: + """Bands already present in the dataset should not be overwritten.""" + dt = _make_reflectance_datatree() + r20m_ds = dt["measurements/reflectance/r20m"].to_dataset() + + # Pre-populate b08 with a sentinel value so we can verify it is NOT replaced. + sentinel = np.full((60, 60), 999, dtype="uint16") + r20m_ds["b08"] = (["y", "x"], sentinel) + + result = inject_missing_bands( + r20m_ds, dt, target_resolution=20, bands={"b08"}, spatial_chunk=1024 + ) + + # b08 was already present — inject_missing_bands must leave it untouched. + np.testing.assert_array_equal(result["b08"].values, sentinel) + + +def test_inject_missing_bands_noop_when_no_source() -> None: + """If the source group is missing from the DataTree, return dataset unchanged.""" + dt = xr.DataTree() + ds = xr.Dataset({"b05": (["y", "x"], np.ones((60, 60)))}) + + result = inject_missing_bands(ds, dt, target_resolution=20, spatial_chunk=1024) + + assert "b08" not in result.data_vars + + +def test_inject_missing_bands_default_injects_all() -> None: + """With bands=None (default), all eligible finer bands should be injected.""" + size_10m = 120 + x10 = np.arange(size_10m, dtype="float64") + y10 = np.arange(size_10m, dtype="float64") + + r10m_ds = xr.Dataset( + { + "b02": (["y", "x"], np.ones((size_10m, size_10m), dtype="uint16")), + "b03": (["y", "x"], np.ones((size_10m, size_10m), dtype="uint16")), + "b04": (["y", "x"], np.ones((size_10m, size_10m), dtype="uint16")), + "b08": (["y", "x"], np.full((size_10m, size_10m), 42, dtype="uint16")), + }, + coords={"x": x10, "y": y10}, + ) + + size_20m = 60 + x20 = np.arange(size_20m, dtype="float64") + y20 = np.arange(size_20m, dtype="float64") + r20m_ds = xr.Dataset( + { + "b05": (["y", "x"], np.ones((size_20m, size_20m), dtype="uint16")), + "b06": (["y", "x"], np.ones((size_20m, size_20m), dtype="uint16")), + }, + coords={"x": x20, "y": y20}, + ) + + size_60m = 20 + x60 = np.arange(size_60m, dtype="float64") + y60 = np.arange(size_60m, dtype="float64") + r60m_ds = xr.Dataset( + { + "b01": (["y", "x"], np.ones((size_60m, size_60m), dtype="uint16")), + }, + coords={"x": x60, "y": y60}, + ) + + dt = xr.DataTree() + dt["measurements/reflectance/r10m"] = xr.DataTree(r10m_ds) + dt["measurements/reflectance/r20m"] = xr.DataTree(r20m_ds) + dt["measurements/reflectance/r60m"] = xr.DataTree(r60m_ds) + + result = inject_missing_bands(r60m_ds, dt, target_resolution=60, spatial_chunk=1024) + + # All 10m bands (b02, b03, b04, b08) and 20m bands (b05, b06) should be injected + for band in ("b02", "b03", "b04", "b08", "b05", "b06"): + assert band in result.data_vars, f"{band} missing from r60m" + assert result[band].shape == (size_60m, size_60m) diff --git a/tests/test_titiler_integration.py b/tests/test_titiler_integration.py index 443cd307..925e019e 100644 --- a/tests/test_titiler_integration.py +++ b/tests/test_titiler_integration.py @@ -27,8 +27,6 @@ from starlette.testclient import TestClient from titiler.xarray.factory import TilerFactory -from eopf_geozarr.s2_optimization.s2_converter import convert_s2_optimized - s2_source_path = pathlib.Path("/tmp/s2_source.zarr") pytestmark = [ @@ -46,6 +44,8 @@ def converted_s2_path() -> pathlib.Path: This fixture is module-scoped so the conversion only runs once for all tests. """ + from eopf_geozarr.s2_optimization.s2_converter import convert_s2 + tmpdir = tempfile.mkdtemp(prefix="titiler_test_") output_path = str(pathlib.Path(tmpdir) / "s2_optimized.zarr") @@ -55,10 +55,12 @@ def converted_s2_path() -> pathlib.Path: chunks="auto", ) - convert_s2_optimized( + convert_s2( dt_input, output_path=output_path, validate_output=False, + enable_sharding=False, + spatial_chunk=512, ) return pathlib.Path(output_path) From d23170f82ece51aa69b13b330367ad565aa26d84 Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Mon, 16 Nov 2026 08:14:29 +0100 Subject: [PATCH 38/45] test(data-api): check the Sentinel-2 plan against the converter's output Replace the plan's snapshot test with a comparison against what `convert_s2_optimized` writes. Each Sentinel-2 fixture (one L1C, two L2A) is shrunk tenfold, given data and converted; every group and array document stored below the root must equal the planned one. The root's own attributes are left out, because the converter writes them in its consolidation step. The comparison found one difference, fixed here: the plan typed every x/y array as float64, while the converter keeps the input's own coordinate arrays on native levels (int64 metres in ESA products). The plan now carries the input's x/y arrays on native levels, data type included, and keeps the float64 coordinate array for generated levels. A second parametrization covers a product whose coordinates are float64. The API reference describes the plan and what it is checked against. Assisted-by: ClaudeCode:claude-fable-5.2 Co-Authored-By: Claude Fable 5.2 --- docs/api-reference.md | 8 ++ src/eopf_geozarr/data_api/s2_plan.py | 38 +++++-- tests/test_data_api/test_s2_plan.py | 157 +++++++++++++++++++++++---- 3 files changed, 170 insertions(+), 33 deletions(-) diff --git a/docs/api-reference.md b/docs/api-reference.md index 0dc3fe5f..83111f16 100644 --- a/docs/api-reference.md +++ b/docs/api-reference.md @@ -64,6 +64,14 @@ spatial_chunk, crs=None, scale_offset_codec=False, compression_level=3)` in `eopf_geozarr.s2_optimization.s2_multiscale` is the lower-level function that writes the pyramid into an open `zarr.Group`. +`eopf_geozarr.data_api.s2_plan` describes this output without writing it: +`load_sentinel2(source)` validates a Zarr group or an xarray DataTree into the +`Sentinel2Root` input model, and `plan_geozarr(root)` returns the output +hierarchy as a Zarr V3 `GroupSpec`. The plan holds every group and array +document that `convert_s2_optimized` stores below the root when called with +`enable_sharding=True`, `spatial_chunk=1024` and `compression_level=3`, and +the test suite compares the two. + ## Sentinel-3 OLCI: `convert_olci_optimized` ```python diff --git a/src/eopf_geozarr/data_api/s2_plan.py b/src/eopf_geozarr/data_api/s2_plan.py index 908208ac..4a908310 100644 --- a/src/eopf_geozarr/data_api/s2_plan.py +++ b/src/eopf_geozarr/data_api/s2_plan.py @@ -275,7 +275,7 @@ def _band_array( def _plan_coordinate(name: str, size: int) -> DataArray: - """A 1-D coordinate array (`x` or `y`): float64, NaN-filled, one chunk.""" + """The `x` or `y` array of a generated level: float64, NaN-filled, one chunk.""" # create_default supplies the one-chunk grid, the `/` chunk key encoding # and the little-endian bytes codec return DataArray.create_default( @@ -428,8 +428,8 @@ def _level_spatial_attributes( """The tile's (origin, EPSG, WKT2), as the reflectance pyramid is georeferenced.""" CoordinateValues = Callable[[str], "np.ndarray | None"] -"""Looks up the stored values of the input array at an output-plan path (the -writer's `SourceReader.values`); the plan reads only the small 1-D +"""Looks up the stored values of the input array at an output-plan path (None +when the input holds no array there); the plan reads only the small 1-D coordinate arrays a group's georeferencing is derived from.""" GEOMETRY_PATH = "conditions/geometry" @@ -605,8 +605,11 @@ def _plan_reflectance(root: Sentinel2Root) -> tuple[AnyGroupSpec, _TileGeorefere rows, cols = level_shape shape2d = (rows, cols) level_members: dict[str, DataArray | ArraySpecV3] = dict(bands) - level_members["x"] = _plan_coordinate("x", cols) - level_members["y"] = _plan_coordinate("y", rows) + for axis, size in (("x", cols), ("y", rows)): + coordinate = input_levels[meters].members.get(axis) if native else None + level_members[axis] = _plan_level_coordinate( + axis, size, None if coordinate is None else coordinate.model_dump() + ) level_members["spatial_ref"] = _plan_spatial_ref(wkt2, native=native) level_attributes[meters] = _level_spatial_attributes( @@ -720,9 +723,9 @@ def _plan_carried_array( ) -> DataArray: """ One carried (non-reflectance) array, translated to its output document: - `x`/`y` become the float64 coordinate arrays, other coordinate arrays - (an array whose only dimension is its own name) keep their data type - uncompressed, and data arrays are sharded with the blosc policy. + coordinate arrays (an array whose only dimension is its own name, `x` + and `y` included) keep their data type uncompressed, and data arrays are + sharded with the blosc policy. """ attrs = _doc_attrs(doc) dims_raw = attrs.get("_ARRAY_DIMENSIONS") @@ -731,8 +734,6 @@ def _plan_carried_array( raise TypeError(msg) dims = tuple(str(dim) for dim in dims_raw) shape = tuple(doc["shape"]) - if name in ("x", "y") and dims == (name,): - return _plan_coordinate(name, shape[0]) parsed = np.dtype(str(doc["dtype"])) # the Zarr V3 form zarr-python writes for the V2 dtype, in the GeoZarr scope data_type = parse_dtype_v3(parsed, scope=GEOZARR_SCOPE) @@ -760,6 +761,18 @@ def _plan_carried_array( return _band_array(attributes, shape, data_type, fill_value, dims, typesize=parsed.itemsize) +def _plan_level_coordinate(name: str, size: int, source: _ArrayDoc | None) -> DataArray: + """ + The `x` or `y` array of one pyramid level. A native level carries the + input's own coordinate array, data type included (the int64 metres of an + ESA product stay int64); a generated level, which has no input array, + gets the float64 coordinate array. + """ + if source is None: + return _plan_coordinate(name, size) + return _plan_carried_array(name, source, spatial=False) + + def _carried_arrays(group: _GroupDoc) -> dict[str, _ArrayDoc]: """The group's non-scalar arrays (scalar arrays are dropped).""" members = group.get("members") or {} @@ -999,8 +1012,9 @@ def _plan_aux_multiscale( planned_levels[meters] = variables rows, cols = next(iter(variables.values())).shape level_members: dict[str, DataArray | ArraySpecV3] = dict(variables) - level_members["x"] = _plan_coordinate("x", cols) - level_members["y"] = _plan_coordinate("y", rows) + carried = _carried_arrays(input_levels[meters]) if native else {} + for axis, size in (("x", cols), ("y", rows)): + level_members[axis] = _plan_level_coordinate(axis, size, carried.get(axis)) level_members["spatial_ref"] = _plan_spatial_ref(wkt2, native=native) level_attributes[meters] = _level_spatial_attributes( meters=meters, shape=(rows, cols), origin=origin, epsg=epsg diff --git a/tests/test_data_api/test_s2_plan.py b/tests/test_data_api/test_s2_plan.py index 0a526087..47d3d0b2 100644 --- a/tests/test_data_api/test_s2_plan.py +++ b/tests/test_data_api/test_s2_plan.py @@ -3,8 +3,8 @@ from __future__ import annotations import json -import os import pathlib +import re from typing import Any import numpy as np @@ -12,9 +12,9 @@ import zarr from pydantic import ValidationError from pydantic_zarr.v2 import GroupSpec as GroupSpecV2 -from pydantic_zarr.v3 import GroupSpec as GroupSpecV3 from pyproj import CRS +from eopf_geozarr.conversion.open_source import open_source_datatree from eopf_geozarr.data_api.s2 import Sentinel2Root from eopf_geozarr.data_api.s2_plan import ( REFLECTANCE_SCALE_LEVELS, @@ -23,10 +23,17 @@ plan_reflectance, product_level, ) +from eopf_geozarr.s2_optimization.s2_converter import convert_s2_optimized _INPUT_DIR = pathlib.Path("tests/_test_data/s2_examples") -_SNAPSHOT_DIR = pathlib.Path("tests/_test_data/optimized_geozarr_examples") _INPUT_PATHS = sorted(_INPUT_DIR.glob("*.json")) +_L2A_PATH = next(path for path in _INPUT_PATHS if "MSIL2A" in path.stem) + +#: The tile-sized dimensions, shrunk tenfold so that a conversion takes seconds. +_SHRUNK_SIZES = {10980: 1098, 5490: 549, 1830: 183} + +#: The spacing of the geometry angle grids, in metres. +_GEOMETRY_SPACING = 5000.0 def _read(path: pathlib.Path) -> dict[str, Any]: @@ -40,30 +47,138 @@ def _planned_root(path: pathlib.Path) -> dict[str, Any]: return plan_geozarr(root).model_dump(mode="json") -def _snapshot_root(path: pathlib.Path) -> dict[str, Any]: - snapshot = GroupSpecV3.model_validate(_read(_SNAPSHOT_DIR / path.name)) - return snapshot.model_dump(mode="json") - - def _planned_reflectance(path: pathlib.Path) -> dict[str, Any]: return _planned_root(path)["members"]["measurements"]["members"]["reflectance"] -@pytest.mark.parametrize("path", _INPUT_PATHS, ids=lambda p: p.stem[:26]) -def test_plan_matches_snapshot(path: pathlib.Path) -> None: +def _shrink(node: dict[str, Any], coordinate_dtype: str | None, name: str = "") -> None: + """Shrink the tile-sized dimensions of every array under `node`, in place.""" + if "shape" in node: + node["shape"] = [_SHRUNK_SIZES.get(size, size) for size in node["shape"]] + node["chunks"] = [ + max(1, min(chunk, size)) + for chunk, size in zip(node["chunks"], node["shape"], strict=True) + ] + attributes = node.get("attributes") or {} + if "proj:shape" in attributes: + attributes["proj:shape"] = [ + _SHRUNK_SIZES.get(size, size) for size in attributes["proj:shape"] + ] + if coordinate_dtype is not None and name in ("x", "y") and len(node["shape"]) == 1: + node["dtype"] = np.dtype(coordinate_dtype).str + node["fill_value"] = "NaN" if np.dtype(coordinate_dtype).kind == "f" else None + for member_name, member in (node.get("members") or {}).items(): + _shrink(member, coordinate_dtype, member_name) + + +def _fill(group: zarr.Group, origin: tuple[float, float], rng: np.random.Generator) -> None: + """Give every array under `group` values: coordinates on the tile's grid + (pixel centres per resolution level, nodes for the geometry grids) and + random data with nodata patches.""" + x0, y0 = origin + for path, array in group.members(max_depth=None): + if not isinstance(array, zarr.Array) or array.ndim == 0: + continue + name = path.rsplit("/", 1)[-1] + kind = array.dtype.kind + if name in ("x", "y") and array.attrs.get("_ARRAY_DIMENSIONS") == [name]: + level = re.search(r"/r(\d+)m/", f"/{path}") + step = float(level.group(1)) if level else _GEOMETRY_SPACING + offsets = (np.arange(array.shape[0]) + (0.5 if level else 0.0)) * step + array[...] = x0 + offsets if name == "x" else y0 - offsets + elif kind == "f": + values = rng.random(array.shape).astype(array.dtype) * 100 + values[rng.random(array.shape) < 0.05] = np.nan + array[...] = values + elif kind in "ui": + high = 12 if name == "scl" else min(int(np.iinfo(array.dtype).max), 12000) + 1 + values = rng.integers(0, high, size=array.shape).astype(array.dtype) + values[rng.random(array.shape) < 0.05] = 0 + array[...] = values + elif kind == "M": + array[...] = np.arange(array.size).reshape(array.shape).astype(array.dtype) + + +def _product_with_data( + path: pathlib.Path, out_dir: pathlib.Path, coordinate_dtype: str | None +) -> pathlib.Path: """ - The planned tree reproduces the stored snapshot whole — the member tree, - every array document (shapes, dtypes, shards, codecs, dimension names) - and every attribute, georeferencing included, across measurements, - conditions and quality. The plan is the snapshots' source of truth - (REGENERATE_SNAPSHOTS=1 rewrites them), and the self-consistency test - below pins the georeferencing to the product's own metadata. + Write the fixture product at `path` as a Zarr V2 store that holds data. + + The fixtures are metadata documents of real products; here their + tile-sized dimensions are shrunk tenfold and every array gets values. The + x/y arrays keep the data type the product declares (int64) unless + `coordinate_dtype` names another. """ - planned = _planned_root(path) - if os.environ.get("REGENERATE_SNAPSHOTS"): - snapshot_path = _SNAPSHOT_DIR / path.name - snapshot_path.write_text(json.dumps(planned, indent=2, sort_keys=True) + "\n") - assert planned == _snapshot_root(path) + document = _read(path) + _shrink(document, coordinate_dtype) + store_path = out_dir / "product.zarr" + GroupSpecV2.model_validate(document).to_zarr(store_path, path="") # type: ignore[arg-type] + group = zarr.open_group(store_path, mode="r+", zarr_format=2) + band = group["measurements/reflectance/r10m/b02"] + transform = band.attrs["proj:transform"] + assert isinstance(transform, list) + _fill(group, (float(transform[2]), float(transform[5])), np.random.default_rng(0)) # type: ignore[arg-type] + zarr.consolidate_metadata(group.store, zarr_format=2) + return store_path + + +def _canonical(document: object) -> str: + """A document as sorted JSON text: equal texts are equal documents (a NaN + never equals itself as a float).""" + return json.dumps(document, sort_keys=True) + + +@pytest.mark.filterwarnings("ignore") +@pytest.mark.parametrize( + ("path", "coordinate_dtype"), + [*((path, None) for path in _INPUT_PATHS), (_L2A_PATH, "float64")], + ids=lambda value: value.stem[:26] if isinstance(value, pathlib.Path) else str(value), +) +def test_plan_matches_the_converter_output( + path: pathlib.Path, coordinate_dtype: str | None, tmp_path: pathlib.Path +) -> None: + """ + The plan describes the store `convert_s2_optimized` writes. For a product + that holds data, every group and array document the converter stores + below the root equals the planned one — the member tree, shapes, data + types, fill values, chunk grids, codecs, dimension names and attributes, + georeferencing included — across measurements, conditions and quality, + for L1C and L2A, and for x/y coordinates stored as int64 or as float64. + + The root's own attributes are left out: the converter writes them (the + product metadata and the STAC assets) in its consolidation step, and the + plan leaves them empty. + """ + source_path = _product_with_data(path, tmp_path, coordinate_dtype) + output_path = tmp_path / "output.zarr" + convert_s2_optimized( + dt_input=open_source_datatree(str(source_path)), + output_path=str(output_path), + enable_sharding=True, + spatial_chunk=1024, + compression_level=3, + validate_output=False, + ) + written = {} + for document_path in output_path.rglob("zarr.json"): + document = json.loads(document_path.read_text()) + # the converter consolidates metadata; the plan holds node documents only + document.pop("consolidated_metadata", None) + written[str(document_path.relative_to(output_path))] = document + + source = zarr.open_group(source_path, mode="r", zarr_format=2) + + def coordinate_values(array_path: str) -> np.ndarray | None: + member = source.get(array_path) + return np.asarray(member[...]) if isinstance(member, zarr.Array) else None + + plan = plan_geozarr(load_sentinel2(source), coordinate_values=coordinate_values) + planned = json.loads(json.dumps(plan.to_stored_metadata_json())) + + assert written.keys() == planned.keys() + assert written.pop("zarr.json")["node_type"] == planned.pop("zarr.json")["node_type"] + assert [key for key in written if _canonical(written[key]) != _canonical(planned[key])] == [] @pytest.mark.parametrize("path", _INPUT_PATHS, ids=lambda p: p.stem[:26]) From dbb39b0756122ac6c50940b77ac57641a57380eb Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Mon, 16 Nov 2026 08:22:38 +0100 Subject: [PATCH 39/45] docs(data-api): correct two plan docstrings after the writer split The reflectance plan's docstring said every level holds float64 x/y coordinates, and `level_meters` named a writer this branch no longer has. Assisted-by: ClaudeCode:claude-fable-5.2 Co-Authored-By: Claude Fable 5.2 --- src/eopf_geozarr/data_api/s2_plan.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/eopf_geozarr/data_api/s2_plan.py b/src/eopf_geozarr/data_api/s2_plan.py index 4a908310..844cc8a6 100644 --- a/src/eopf_geozarr/data_api/s2_plan.py +++ b/src/eopf_geozarr/data_api/s2_plan.py @@ -483,8 +483,9 @@ def plan_reflectance(root: Sentinel2Root) -> AnyGroupSpec: Sentinel-2 product: one level group per entry of `REFLECTANCE_SCALE_LEVELS`, native levels carried from the input (with the product level's finer bands injected), coarser levels derived from - the level before them, each holding sharded uint16 band arrays, float64 - `x`/`y` coordinates and a `spatial_ref` grid-mapping array, under a + the level before them, each holding sharded uint16 band arrays, `x`/`y` + coordinates (the input's own arrays on a native level, float64 on a + generated one) and a `spatial_ref` grid-mapping array, under a multiscales layout attribute. """ return _plan_reflectance(root)[0] @@ -815,8 +816,7 @@ def _proj_of(name: str, doc: _ArrayDoc) -> tuple[_Transform6, int, str]: def level_meters(path: str) -> int | None: """The resolution in metres of the level group at `path` (`r10m`, or a path - ending in it), or None if it is not a level group; the one parser of level - names, which the writer uses too.""" + ending in it), or None if it is not a level group.""" match = _LEVEL_GROUP.fullmatch(path.rsplit("/", 1)[-1]) return int(match.group(1)) if match else None From 753844df1eccb24d40a3f8261a57bd2d599a8e20 Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Mon, 16 Nov 2026 08:26:08 +0100 Subject: [PATCH 40/45] feat(s2-optimization)!: drive convert_s2_optimized by the plan and remove the DataTree writer Bring back the plan-driven Sentinel-2 writer (`data_api/s2_write.py`) that the previous change set aside, on top of the plan that change checked against the DataTree writer's output. `convert_s2_optimized` validates the input into `Sentinel2Root`, plans the output hierarchy, writes the planned documents and fills the chunk data. The DataTree pyramid writer in `s2_multiscale.py` is removed. BREAKING CHANGE: `convert_s2_optimized` has a fixed write policy. A `spatial_chunk` other than 1024, a `compression_level` other than 3, `enable_sharding=False` and `scale_offset_codec=True` raise `ValueError`. The CPM writer's default spatial chunk for the `s2-optimized` pipeline changes from 256 to 1024. The output is the same as the DataTree writer's at that policy. The test that compares the plan with the converter's stored documents passes unchanged. Converting the three fixture products (shrunk, with data) with both writers gives identical chunk data and identical documents in every node; the root's STAC assets differ in one href, where two arrays compete for the key `b10_r60m`. The output snapshots are the plan's again, regenerated with the int64 x/y coordinates that native levels now carry. Assisted-by: ClaudeCode:claude-fable-5.2 Co-Authored-By: Claude Fable 5.2 --- README.md | 7 +- docs/api-reference.md | 35 +- docs/converter.md | 40 +- docs/cpm-driver.md | 6 +- docs/examples.md | 12 +- docs/faq.md | 13 +- src/eopf_geozarr/cli.py | 33 +- src/eopf_geozarr/conversion/utils.py | 17 +- src/eopf_geozarr/cpm/writer.py | 9 +- src/eopf_geozarr/data_api/s2_write.py | 419 ++++++ .../s2_optimization/s2_converter.py | 331 +++-- .../s2_optimization/s2_multiscale.py | 719 +-------- ...041_N0511_R122_T32TQM_20251008T122613.json | 957 +++++------- ...309_N0511_R108_T32TLQ_20250113T122458.json | 297 +--- ...131_N0511_R037_T29TPF_20250811T152216.json | 1287 +++++++---------- tests/test_cpm_writer.py | 29 +- tests/test_data_api/test_s2_plan.py | 25 + tests/test_data_api/test_s2_write.py | 374 +++++ tests/test_s2_converter_simplified.py | 125 +- tests/test_s2_multiscale.py | 914 +----------- tests/test_titiler_integration.py | 8 +- 21 files changed, 2122 insertions(+), 3535 deletions(-) create mode 100644 src/eopf_geozarr/data_api/s2_write.py create mode 100644 tests/test_data_api/test_s2_write.py diff --git a/README.md b/README.md index cc52331e..53a989cc 100644 --- a/README.md +++ b/README.md @@ -89,9 +89,10 @@ for every command, including Sentinel-1 GRD RTC ingestion. - **Native projections**: no reprojection to Web Mercator. - **Multiscale pyramids** for fast visualization at every zoom level. - **Source packing kept**: reflectance stays as packed integers with CF - `scale_factor`/`add_offset`/`_FillValue`, as in the ESA products. - `--scale-offset-codec` stores the packing with the Zarr `scale_offset` + - `cast_value` codecs instead, so Zarr readers get decoded values. + `scale_factor`/`add_offset`/`_FillValue`, as in the ESA products. On the + generic rechunker pipeline, `--scale-offset-codec` stores the packing with + the Zarr `scale_offset` + `cast_value` codecs instead, so Zarr readers get + decoded values. - **Validation**: `eopf-geozarr validate` checks a store against the mini spec. GeoZarr is a set of modular [Zarr conventions](https://geozarr.org/conventions) diff --git a/docs/api-reference.md b/docs/api-reference.md index 83111f16..3a0020da 100644 --- a/docs/api-reference.md +++ b/docs/api-reference.md @@ -38,39 +38,34 @@ convert_s2_optimized( dt_input: xr.DataTree, *, output_path: str, - enable_sharding: bool, - spatial_chunk: int, - compression_level: int, - validate_output: bool, + enable_sharding: bool = True, + spatial_chunk: int = 1024, + compression_level: int = 3, + validate_output: bool = True, scale_offset_codec: bool = False, ) -> xr.DataTree ``` Converts a Sentinel-2 L1C or L2A DataTree to the optimized pyramid -(`r10m` … `r720m`). All arguments after `dt_input` are keyword-only, and all -without a default are required. +(`r10m` … `r720m`). All arguments after `dt_input` are keyword-only. | Argument | Description | |---|---| | `output_path` | Local path or `s3://` URL of the output store. | -| `enable_sharding` | Enable Zarr v3 sharding. | -| `spatial_chunk` | Spatial chunk size (the CLI default is 256). | -| `compression_level` | Blosc zstd level, 1–9. | +| `enable_sharding` | Must be `True` (the default): the write policy fixes sharding on. | +| `spatial_chunk` | Must be `1024` (the default): the policy's inner chunk size. | +| `compression_level` | Must be `3` (the default): the policy's blosc zstd level. | | `validate_output` | Validate the output after writing. | -| `scale_offset_codec` | `False` (default): ESA layout with CF scale attributes. `True`: pack reflectance with the Zarr `scale_offset` + `cast_value` codecs. See [Encoding](converter.md#encoding). | +| `scale_offset_codec` | Must be `False` (the default): the output keeps the ESA layout with CF scale attributes. See [Encoding](converter.md#encoding). | -`create_multiscale_from_datatree(dt_input, *, output_group, enable_sharding, -spatial_chunk, crs=None, scale_offset_codec=False, compression_level=3)` in -`eopf_geozarr.s2_optimization.s2_multiscale` is the lower-level function that -writes the pyramid into an open `zarr.Group`. +The layout arguments are accepted only at their defaults — the write policy is +fixed, and a deviating value raises `ValueError`. -`eopf_geozarr.data_api.s2_plan` describes this output without writing it: +The lower-level, spec-level API lives in `eopf_geozarr.data_api`: `load_sentinel2(source)` validates a Zarr group or an xarray DataTree into the -`Sentinel2Root` input model, and `plan_geozarr(root)` returns the output -hierarchy as a Zarr V3 `GroupSpec`. The plan holds every group and array -document that `convert_s2_optimized` stores below the root when called with -`enable_sharding=True`, `spatial_chunk=1024` and `compression_level=3`, and -the test suite compares the two. +`Sentinel2Root` input model, `plan_geozarr(root)` derives the output hierarchy +as a Zarr V3 `GroupSpec` tree, and `write_geozarr(root, source, store)` writes +the planned documents and fills in the chunk data. ## Sentinel-3 OLCI: `convert_olci_optimized` diff --git a/docs/converter.md b/docs/converter.md index 1b014426..d365d931 100644 --- a/docs/converter.md +++ b/docs/converter.md @@ -97,19 +97,19 @@ output.zarr/ - Coarser levels also get the finer bands (for example b08 at r20m, and all bands at r60m for L1C), so every level has a complete band set. - Each variable type gets its own resampling: mean for reflectance and - probabilities (nodata excluded), subsampling for classifications, maximum - for quality masks. + probabilities (nodata excluded), subsampling for classifications; quality + masks are carried at their native resolution, not resampled. + +The write layout is fixed: Zarr v3 sharding with 1024-pixel inner chunks, +blosc-zstd level 3, and the ESA packed-integer layout (see +[Encoding](#encoding)). There are no layout options. ```bash -eopf-geozarr convert-s2-optimized S2B_MSIL2A_….zarr output.zarr --enable-sharding +eopf-geozarr convert-s2-optimized S2B_MSIL2A_….zarr output.zarr ``` | Option | Default | Description | |---|---|---| -| `--spatial-chunk N` | 256 | Spatial chunk size. | -| `--enable-sharding` | off | Enable Zarr v3 sharding. | -| `--compression-level 1-9` | 3 | Blosc zstd compression level. | -| `--scale-offset-codec` | off | Store the packing with the Zarr scale-offset codecs instead of the ESA layout (see [Encoding](#encoding)). | | `--skip-validation` | off | Do not validate the output. | | `--dask-cluster` | off | Start a local Dask cluster. | | `--verbose` | off | Print more details. | @@ -124,24 +124,25 @@ dt_input = xr.open_datatree("S2B_MSIL2A_….zarr", engine="zarr", chunks={}) dt_output = convert_s2_optimized( dt_input, output_path="output.zarr", - enable_sharding=True, - spatial_chunk=256, - compression_level=3, validate_output=True, - scale_offset_codec=False, # default: ESA layout; True packs with Zarr codecs ) +# The layout keyword arguments (enable_sharding, spatial_chunk, +# compression_level, scale_offset_codec) are still accepted, but only at +# their default values — the write policy is fixed, and a deviating value +# raises ValueError. ``` ### Encoding Every level of the reflectance pyramid keeps the packing of the source product (for example `uint16`, `scale_factor` 0.0001, `add_offset` -0.1, nodata 0 for -S2 L2A). One option selects how that packing is stored: +S2 L2A). The Sentinel-2 pipeline always writes the ESA layout; the Zarr codec +mode remains available on the generic rechunker pipeline: -| Mode | Option | On disk | Metadata | +| Mode | Where | On disk | Metadata | |---|---|---|---| -| Default: ESA layout | none | Source integer dtype, no scale codecs | CF `scale_factor`, `add_offset` and `_FillValue` on the arrays | -| Zarr codec | `--scale-offset-codec` / `scale_offset_codec=True` | Source integer dtype, packed by the Zarr `scale_offset` + `cast_value` codecs; the array's logical dtype is `float32` and its fill value is NaN | No CF scale attributes: Zarr readers return decoded values | +| ESA layout | Sentinel-2 (always), generic rechunker (default) | Source integer dtype, no scale codecs | CF `scale_factor`, `add_offset` and `_FillValue` on the arrays | +| Zarr codec | generic rechunker with `--scale-offset-codec` / `scale_offset_codec=True` | Source integer dtype, packed by the Zarr `scale_offset` + `cast_value` codecs; the array's logical dtype is `float32` and its fill value is NaN | No CF scale attributes: Zarr readers return decoded values | What a reader needs: @@ -162,9 +163,12 @@ such as the classification and quality masks, keep their integer dtype and fill value in both modes. In the CPM writer (`eopf convert-geozarr --scale-offset-codec` or -`target_store_kwargs={"scale_offset_codec": True}`), the former -`keep_scale_offset` option is still accepted for one release with a -`DeprecationWarning`: `keep_scale_offset=False` selects the codecs. +`target_store_kwargs={"scale_offset_codec": True}`), the option applies to the +generic rechunker; on a Sentinel-2 product it deviates from the fixed write +policy and is refused with a `ValueError`. The former `keep_scale_offset` +option is still accepted for one release with a `DeprecationWarning`: +`keep_scale_offset=False` selects the codecs (and is therefore also refused +for Sentinel-2). ## Sentinel-3 OLCI conversion diff --git a/docs/cpm-driver.md b/docs/cpm-driver.md index 8a036c44..e5c7269a 100644 --- a/docs/cpm-driver.md +++ b/docs/cpm-driver.md @@ -54,9 +54,9 @@ eopf convert-geozarr S2B_MSIL2A_….SAFE s3://bucket/path/out.zarr --stage-outpu | Option | Pipelines | Description | |---|---|---| -| `--spatial-chunk INTEGER` | all but Sentinel-3 OLCI | Spatial chunk size. Default: 256 (Sentinel-2), 4096 (generic), 1024 (generic rechunker). Sentinel-3 OLCI accepts it but does not apply it yet. | -| `--enable-sharding` | all but Sentinel-3 OLCI | Enable Zarr v3 sharding. Sentinel-3 OLCI accepts it but does not apply it yet. | -| `--scale-offset-codec` | Sentinel-2, generic rechunker | Pack reflectance (or, on the generic rechunker, every packed variable) with the Zarr `scale_offset` + `cast_value` codecs instead of the default ESA layout (CF `scale_factor`/`add_offset`/`_FillValue`). See [Encoding](converter.md#encoding). | +| `--spatial-chunk INTEGER` | all but Sentinel-3 OLCI | Spatial chunk size. Default: 4096 (generic), 1024 (generic rechunker, Sentinel-2). For Sentinel-2 the value is fixed by the write policy: anything other than 1024 is refused. Sentinel-3 OLCI accepts it but does not apply it yet. | +| `--enable-sharding` | generic, generic rechunker | Enable Zarr v3 sharding. Sentinel-2 output is always sharded (the flag is not applied); Sentinel-3 OLCI accepts it but does not apply it yet. | +| `--scale-offset-codec` | generic rechunker | Pack every packed variable with the Zarr `scale_offset` + `cast_value` codecs instead of the default ESA layout (CF `scale_factor`/`add_offset`/`_FillValue`). Refused for Sentinel-2, whose write policy fixes the ESA layout. See [Encoding](converter.md#encoding). | | `--output-grid TEXT` | Sentinel-3 OLCI | `native` (default) keeps the instrument swath geometry. A CRS string (for example `EPSG:4326`) warps the swath onto a regular grid. | | `--min-dimension INTEGER` | Sentinel-3 OLCI, generic | Minimum dimension of the coarsest overview level. Default: 256. | | `--groups TEXT` | generic | DataTree group to convert. Repeat the option for more groups. Required on the generic pipeline. | diff --git a/docs/examples.md b/docs/examples.md index 729bc52e..7b1ba21d 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -13,15 +13,15 @@ description: Examples for eopf-geozarr, the GeoZarr driver for EOPF CPM — conv Convert native products with CPM (see the [CPM driver guide](cpm-driver.md)): ```bash -# Sentinel-2 L2A SAFE to GeoZarr, with sharding -eopf convert-geozarr S2B_MSIL2A_….SAFE out.zarr --enable-sharding +# Sentinel-2 L2A SAFE to GeoZarr (the S2 layout is fixed: sharded, +# 1024-pixel chunks, blosc-zstd 3, ESA packed integers) +eopf convert-geozarr S2B_MSIL2A_….SAFE out.zarr # Sentinel-3 OLCI EFR on a regular WGS 84 grid eopf convert-geozarr S3A_OL_1_EFR____….SEN3 out.zarr --output-grid EPSG:4326 -# Sentinel-2 to S3, packed with the Zarr scale-offset codecs -eopf convert-geozarr S2B_MSIL2A_….SAFE s3://bucket/out.zarr \ - --stage-output --scale-offset-codec +# Sentinel-2 to S3: convert locally, then upload +eopf convert-geozarr S2B_MSIL2A_….SAFE s3://bucket/out.zarr --stage-output ``` ```python @@ -36,7 +36,7 @@ for safe in sorted(Path("inputs").glob("S2*_MSIL2A_*.SAFE")): convert( str(safe), f"outputs/{safe.stem}.zarr", - target_store_kwargs={"engine": "geozarr", "enable_sharding": True}, + target_store_kwargs={"engine": "geozarr"}, ) ``` diff --git a/docs/faq.md b/docs/faq.md index 393d58eb..fbc00cdf 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -68,12 +68,13 @@ pip install "eopf-geozarr[cpm]" # or eopf-geozarr without the CPM driver ### Why are my reflectance values integers, or why do they have NaN? -eopf-geozarr keeps the packing of the source product. By default the arrays -are packed integers with CF `scale_factor`/`add_offset`/`_FillValue` -attributes, as in the ESA products: xarray applies them by default, but a -plain Zarr reader returns the integers. With `--scale-offset-codec`, the Zarr -`scale_offset` + `cast_value` codecs store the packing instead, and Zarr readers -that support these codecs return decoded reflectance with NaN for nodata. See +eopf-geozarr keeps the packing of the source product. The arrays are packed +integers with CF `scale_factor`/`add_offset`/`_FillValue` attributes, as in +the ESA products: xarray applies them by default, but a plain Zarr reader +returns the integers. On the generic rechunker pipeline, +`--scale-offset-codec` stores the packing with the Zarr `scale_offset` + +`cast_value` codecs instead, and Zarr readers that support these codecs +return decoded values with NaN for nodata. See [Encoding](converter.md#encoding). ### How do I set up AWS credentials? diff --git a/src/eopf_geozarr/cli.py b/src/eopf_geozarr/cli.py index a78b87f0..269dd742 100755 --- a/src/eopf_geozarr/cli.py +++ b/src/eopf_geozarr/cli.py @@ -220,14 +220,12 @@ def convert_command(args: argparse.Namespace) -> None: log.info( "Detected Sentinel-2 input; using optimized flat multiscale layout " "(per-group options such as --groups/--crs-groups/--gcp-group/--min-dimension " - "do not apply; pass --no-s2-optimized to force the generic path)" + "do not apply, and the layout options --spatial-chunk/--enable-sharding are " + "fixed by the S2 write policy; pass --no-s2-optimized to force the generic path)" ) dt_geozarr = convert_s2_optimized( dt_input=dt, output_path=output_path, - enable_sharding=args.enable_sharding, - spatial_chunk=args.spatial_chunk, - compression_level=3, validate_output=True, ) # Opt-out flag first: skip the structural OLCI detection (a full @@ -1394,31 +1392,8 @@ def add_s2_optimization_commands(subparsers: argparse._SubParsersAction) -> None "input_path", type=str, help="Path to input Sentinel-2 dataset (Zarr format)" ) s2_parser.add_argument("output_path", type=str, help="Path for output optimized dataset") - s2_parser.add_argument( - "--spatial-chunk", - type=int, - default=256, - help="Spatial chunk size (default: 256)", - ) - s2_parser.add_argument("--enable-sharding", action="store_true", help="Enable Zarr v3 sharding") - s2_parser.add_argument( - "--compression-level", - type=int, - default=3, - choices=range(1, 10), - help="Compression level 1-9 (default: 3)", - ) s2_parser.add_argument("--skip-validation", action="store_true", help="Skip output validation") s2_parser.add_argument("--verbose", action="store_true", help="Enable verbose output") - s2_parser.add_argument( - "--scale-offset-codec", - action="store_true", - help=( - "Pack reflectance with the Zarr scale_offset + cast_value codecs. By default it " - "is written as in the ESA product: source integers with CF " - "scale_factor/add_offset/_FillValue and STAC raster:scale/raster:offset/nodata." - ), - ) s2_parser.add_argument( "--dask-cluster", action="store_true", @@ -1443,11 +1418,7 @@ def convert_s2_optimized_command(args: argparse.Namespace) -> None: convert_s2_optimized( dt_input=dt_input, output_path=args.output_path, - enable_sharding=args.enable_sharding, - spatial_chunk=args.spatial_chunk, - compression_level=args.compression_level, validate_output=not args.skip_validation, - scale_offset_codec=args.scale_offset_codec, ) log.info("S2 optimization completed", output_path=args.output_path) diff --git a/src/eopf_geozarr/conversion/utils.py b/src/eopf_geozarr/conversion/utils.py index 043ff56a..cdf347f2 100644 --- a/src/eopf_geozarr/conversion/utils.py +++ b/src/eopf_geozarr/conversion/utils.py @@ -912,13 +912,16 @@ def build_convention_attrs( def add_multiscale_pyramids_to_stac_metadata( - datasets: Mapping[str, object], dt_attributes: dict[Hashable, Any] + datasets: Mapping[str, xr.Dataset | Sequence[str] | None], dt_attributes: dict[Hashable, Any] ) -> dict[Hashable, Any]: """Add a `stac_discovery` asset for every written array that no asset references yet. Covers the multiscale levels and the bands injected into native levels (e.g. b08 - in r20m/r60m), so every band can carry its STAC statistics. A new asset is keyed - `_` (e.g. `b02_r120m`); a key already in use is not replaced. + in r20m/r60m), so every band can carry its STAC statistics. `datasets` maps each + written dataset group path to the dataset itself or to its data variable names + (the plan-driven writer passes names), with multiscale pyramid roots mapped to + None. A new asset is keyed `_` (e.g. `b02_r120m`); a key + already in use is not replaced. """ stac_attrs = dt_attributes.get("stac_discovery", {}).get("assets") if not stac_attrs: @@ -931,14 +934,12 @@ def add_multiscale_pyramids_to_stac_metadata( } for group_path, ds in datasets.items(): + # multiscale roots (mapped to None) hold no variables of their own if ds is None: continue - # catch object != dataset for typing - if not isinstance(ds, xr.Dataset): - log.warning("Found non-dataset object in datasets!", dataset=ds) - continue + var_names = tuple(str(name) for name in ds.data_vars) if isinstance(ds, xr.Dataset) else ds resolution = group_path.rsplit("/", 1)[-1] # "r120m" - for var_name in ds.data_vars: + for var_name in var_names: href = f"{group_path}/{var_name}" if var_name == "spatial_ref" or href.strip("/") in existing_hrefs: continue diff --git a/src/eopf_geozarr/cpm/writer.py b/src/eopf_geozarr/cpm/writer.py index b83892e5..5a5e472e 100644 --- a/src/eopf_geozarr/cpm/writer.py +++ b/src/eopf_geozarr/cpm/writer.py @@ -71,7 +71,7 @@ #: Default spatial chunk size per pipeline, matching the eopf-geozarr CLI. _DEFAULT_SPATIAL_CHUNK = { - "s2-optimized": 256, + "s2-optimized": 1024, "s3-olci-optimized": 1024, "generic": 4096, "generic-rechunker": 1024, @@ -256,10 +256,15 @@ def write( ) if selected_pipeline == "s2-optimized": + # The plan-driven S2 writer has a fixed write policy. The options + # whose explicit deviation is detectable (spatial_chunk, + # compression_level, scale_offset_codec) are forwarded so the + # policy check refuses them loudly; enable_sharding is not, + # because sharding is fixed on and this writer's own default + # (False) is indistinguishable from an explicit False. return convert_s2_optimized( dt_input=dtree, output_path=output_path, - enable_sharding=enable_sharding, spatial_chunk=resolved_spatial_chunk, compression_level=compression_level, validate_output=validate_output, diff --git a/src/eopf_geozarr/data_api/s2_write.py b/src/eopf_geozarr/data_api/s2_write.py new file mode 100644 index 00000000..24e19cf4 --- /dev/null +++ b/src/eopf_geozarr/data_api/s2_write.py @@ -0,0 +1,419 @@ +""" +Realize the Sentinel-2 GeoZarr plan: the data plane. + +`write_geozarr` writes the hierarchy that `eopf_geozarr.data_api.s2_plan` +describes, without xarray's DataTree writer. The planned metadata documents +are written first, via pydantic-zarr's `to_zarr`, so every stored document is +exactly the plan; the chunk data is then filled in with zarr-python alone. +The input is read through a small `SourceReader` protocol — a Zarr V2 store +directly, or an xarray DataTree whose variables are read as xarray's zarr +writer would store them (CF-encoded), so a tree built in memory or backed by +a Zarr V3 store feeds the writer without a scratch copy. +Native arrays are copied from the input, and the derived arrays are +block-resampled with the converter's arithmetic: injected bands come from the +finest input level that holds them, generated pyramid levels are chained from +the level before them, measurements and probabilities are reduced by the +nodata-masked block mean (rounded for integer data), classification masks +take the window-centre pixel, and coordinates take the window mean. + +The write order is metadata first, per array: a reader that opens the store +mid-write sees complete, valid documents (absent chunks read as the fill +value). Product-level publication — root attributes, consolidated metadata, +the STAC item — is not written here and stays the converter pipeline's final, +separate step, so consumers that discover the product through the root never +see a partially filled store. +""" + +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Protocol + +import numpy as np +import xarray as xr +import zarr +from pydantic_zarr.v3 import is_group_spec + +from eopf_geozarr.conversion.encoding_utils import find_fill_value +from eopf_geozarr.data_api.s2_plan import level_meters, plan_geozarr +from eopf_geozarr.pyz.datatree import encoded_variable +from eopf_geozarr.s2_optimization.s2_resampling import determine_variable_type + +if TYPE_CHECKING: + from pydantic_zarr.v3 import AnyGroupSpec + from zarr.abc.store import Store + + from eopf_geozarr.data_api.s2 import Sentinel2Root + + +class SourceReader(Protocol): + """Read access to the conversion input, by output-plan path.""" + + def values(self, path: str) -> np.ndarray | None: + """The stored values of the array at `path`, or None if there is none.""" + ... + + def nodata(self, path: str) -> int | None: + """ + The integer nodata value the input declares for the array at `path`, in + stored units, or None when it declares none: the CF `_FillValue` (a Zarr + V2 array's `fill_value`, or the attribute) or the EOPF `fill_value` + attribute. A resampling mean skips this value and no other: an array + that declares no nodata is averaged whole, zeros included. + """ + ... + + def is_group(self, path: str) -> bool: + """Whether the input holds a group at `path`.""" + ... + + def group_names(self, path: str) -> tuple[str, ...]: + """The names of the subgroups of the group at `path` (empty if none).""" + ... + + +def _integer_nodata(candidates: tuple[object, ...]) -> int | None: + """The first declared candidate, when it is a whole number (else None).""" + declared = next((value for value in candidates if value is not None), None) + if isinstance(declared, (bool, np.bool_)) or not isinstance( + declared, (int, float, np.integer, np.floating) + ): + return None + return int(declared) if float(declared).is_integer() else None + + +class ZarrSourceReader: + """`SourceReader` over the Zarr V2 store a product was read from.""" + + def __init__(self, group: zarr.Group) -> None: + self._group = group + + def _member(self, path: str) -> zarr.Group | zarr.Array | None: + try: + return self._group[path] + except KeyError: + return None + + def values(self, path: str) -> np.ndarray | None: + member = self._member(path) + return np.asarray(member[...]) if isinstance(member, zarr.Array) else None + + def nodata(self, path: str) -> int | None: + member = self._member(path) + if not isinstance(member, zarr.Array): + return None + # a Zarr V2 array's `fill_value` is what xarray reads as `_FillValue` + attrs = member.attrs + return _integer_nodata( + (member.metadata.fill_value, attrs.get("_FillValue"), attrs.get("fill_value")) + ) + + def is_group(self, path: str) -> bool: + return isinstance(self._member(path), zarr.Group) + + def group_names(self, path: str) -> tuple[str, ...]: + member = self._member(path) + return tuple(member.group_keys()) if isinstance(member, zarr.Group) else () + + +class DataTreeSourceReader: + """ + `SourceReader` over an xarray DataTree (a tree built in memory, or one + backed by a store in any zarr format). Values are read as xarray's zarr + writer would store them: CF-encoded, with `_FillValue` applied — the same + representation `group_spec_from_datatree` documents. + """ + + def __init__(self, tree: xr.DataTree) -> None: + self._tree = tree + + def _node(self, path: str) -> xr.DataTree | None: + if not path: + return self._tree + try: + member = self._tree[path] + except KeyError: + return None + return member if isinstance(member, xr.DataTree) else None + + def _variable(self, path: str) -> tuple[str, xr.Variable] | None: + node_path, _, name = path.rpartition("/") + node = self._node(node_path) + if node is None: + return None + variables = node.to_dataset(inherit=False).variables + return (name, variables[name]) if name in variables else None + + def values(self, path: str) -> np.ndarray | None: + found = self._variable(path) + return None if found is None else np.asarray(encoded_variable(*found).values) + + def nodata(self, path: str) -> int | None: + found = self._variable(path) + if found is None: + return None + # `find_fill_value` takes anything with `.encoding` and `.attrs` + return _integer_nodata((find_fill_value(found[1]),)) # type: ignore[arg-type] + + def is_group(self, path: str) -> bool: + return self._node(path) is not None + + def group_names(self, path: str) -> tuple[str, ...]: + node = self._node(path) + return tuple(node.children) if node is not None else () + + +#: Rows per stripe for the streamed block mean (a multiple of the coarsening +#: factor is taken per stripe, so windows never straddle a stripe boundary). +_MEAN_STRIPE_ROWS = 2048 + + +def write_geozarr( + root: Sentinel2Root, source: zarr.Group | xr.DataTree, store: Store | str +) -> AnyGroupSpec: + """ + Write the GeoZarr hierarchy planned from `root` to `store`, copying and + resampling chunk data from `source` — the Zarr V2 input store or the + xarray DataTree `root` was read from. Returns the plan that was written. + """ + reader: SourceReader = ( + DataTreeSourceReader(source) + if isinstance(source, xr.DataTree) + else ZarrSourceReader(source) + ) + plan = plan_geozarr(root, coordinate_values=reader.values) + # the metadata plane: every group and array document, exactly as planned + output = plan.to_zarr(store, path="") # type: ignore[arg-type] + _fill_group(plan, reader, output, "") + return plan + + +def _fill_group(spec: AnyGroupSpec, source: SourceReader, output: zarr.Group, path: str) -> None: + """Fill the data of every array under one planned group (recursively).""" + for name, member in spec.members.items(): + member_path = f"{path}/{name}".lstrip("/") + if is_group_spec(member): + attributes = member.attributes + if isinstance(attributes, Mapping) and "multiscales" in attributes: + _fill_pyramid(member, source, output, member_path) + else: + _fill_group(member, source, output, member_path) + else: + _fill_carried_array(source, output, member_path) + + +def _fill_carried_array(source: SourceReader, output: zarr.Group, path: str) -> None: + """Copy one carried array's data from the input (grid mappings hold 0).""" + out_array = _output_array(output, path) + if path.rsplit("/", 1)[-1] == "spatial_ref": + out_array[...] = 0 + return + values = source.values(path) + if values is None: + msg = f"The input source holds no array at {path!r}" + raise ValueError(msg) + out_array[...] = values + + +def _fill_pyramid(spec: AnyGroupSpec, source: SourceReader, output: zarr.Group, path: str) -> None: + """ + Fill one multiscale subtree, finest level first: native levels are copied + from the input (with their injected bands resampled from the finest + input level that holds them), and generated levels are chained from the + data of the level before them, as the converter chains them. + """ + levels = sorted(spec.members, key=_level_meters) + previous_data: dict[str, np.ndarray] = {} + # the nodata each variable's input declares, carried down the chain + nodata: dict[str, int | None] = {} + previous_coords: dict[str, np.ndarray] = {} + previous_meters: int | None = None + for level_name in levels: + level_spec = spec.members[level_name] + if not is_group_spec(level_spec): + msg = f"Planned pyramid member {path}/{level_name} is not a group" + raise TypeError(msg) + meters = _level_meters(level_name) + level_path = f"{path}/{level_name}" + native = source.is_group(level_path) + data: dict[str, np.ndarray] = {} + coords: dict[str, np.ndarray] = {} + for var in level_spec.members: + if var == "spatial_ref": + continue + if var in ("x", "y"): + coords[var] = _level_coordinate( + source, + f"{level_path}/{var}", + previous_coords.get(var), + meters, + previous_meters, + native=native, + ) + else: + data[var] = _level_variable( + nodata, + source, + var, + path, + level_path, + meters, + previous_meters, + previous_data, + native=native, + ) + for var, values in {**data, **coords}.items(): + _output_array(output, f"{level_path}/{var}")[...] = values + if "spatial_ref" in level_spec.members: + _output_array(output, f"{level_path}/spatial_ref")[...] = 0 + previous_data, previous_coords, previous_meters = data, coords, meters + + +def _level_variable( + nodata: dict[str, int | None], + source: SourceReader, + var: str, + base_path: str, + level_path: str, + meters: int, + previous_meters: int | None, + previous_data: dict[str, np.ndarray], + *, + native: bool, +) -> np.ndarray: + """ + The data of one pyramid-level variable: copied, injected, or chained. + `nodata` records, per variable, the nodata its input declares (from the + level it was last read from), which the resampling mean skips. + """ + if native: + values = source.values(f"{level_path}/{var}") + if values is not None: + nodata[var] = source.nodata(f"{level_path}/{var}") + return values + # an injected band: resample from the finest input level that holds it + injected = _finest_input_source(source, base_path, var, meters) + if injected is None: + msg = f"No input level finer than {meters} m holds the injected band {var!r}" + raise ValueError(msg) + src_values, src_meters, src_path = injected + nodata[var] = source.nodata(src_path) + return _coarsen(src_values, meters // src_meters, var, nodata[var]) + if previous_meters is None: + msg = f"The finest planned level {level_path} is missing from the input source" + raise ValueError(msg) + if var not in previous_data: + msg = f"Variable {var!r} of generated level {level_path} is missing from the previous level" + raise ValueError(msg) + return _coarsen(previous_data[var], meters // previous_meters, var, nodata.get(var)) + + +def _level_coordinate( + source: SourceReader, + coord_path: str, + previous: np.ndarray | None, + meters: int, + previous_meters: int | None, + *, + native: bool, +) -> np.ndarray: + """A level's x/y values: the input's at native levels, window means after.""" + if native: + values = source.values(coord_path) + if values is None: + msg = f"The input source holds no coordinate array at {coord_path!r}" + raise ValueError(msg) + return values + if previous is None or previous_meters is None: + msg = f"No previous level to derive the coordinate at {coord_path!r} from" + raise ValueError(msg) + factor = meters // previous_meters + size = previous.shape[0] // factor + return previous[: size * factor].reshape(size, factor).mean(axis=1) + + +def _coarsen(values: np.ndarray, factor: int, var: str, fill: int | None) -> np.ndarray: + """ + Downsample one variable by `factor`, with the converter's arithmetic: + classification masks take the window-centre pixel; everything else takes + the block mean — NaN-skipping for floats, nodata-masked and rounded for + integers (an all-nodata window keeps the fill value). `fill` is the + nodata the input declares; with None, integers are averaged whole. + """ + kind = determine_variable_type(var) + rows = values.shape[0] // factor * factor + cols = values.shape[1] // factor * factor + trimmed = values[:rows, :cols] + if kind == "classification": + offset = factor // 2 + return trimmed[offset::factor, offset::factor] + if kind not in ("reflectance", "probability"): + msg = f"Unknown/Unapplicable variable type {kind} for {var!r}" + raise ValueError(msg) + out = np.empty((rows // factor, cols // factor), dtype=values.dtype) + stripe = factor * max(1, _MEAN_STRIPE_ROWS // factor) + for row in range(0, rows, stripe): + block = trimmed[row : row + stripe] + windows = block.reshape(block.shape[0] // factor, factor, cols // factor, factor) + out[row // factor : (row + block.shape[0]) // factor] = _window_mean(windows, fill) + return out + + +def _window_mean(windows: np.ndarray, fill: int | None) -> np.ndarray: + """The converter's block-mean reduction over one (i, factor, j, factor) view.""" + if np.issubdtype(windows.dtype, np.floating): + # float values: nodata is NaN, the NaN-skipping mean excludes it, and + # an all-NaN window stays NaN (as xarray's skipna mean leaves it) + total = np.nansum(windows.astype("float64"), axis=(1, 3)) + count = np.sum(~np.isnan(windows), axis=(1, 3)) + mean = total / np.maximum(count, 1) + return np.where(count > 0, mean, np.nan).astype(windows.dtype) + as_float = windows.astype("float64") + if fill is None: + return np.round(as_float.mean(axis=(1, 3))).astype(windows.dtype) + # raw integers: mask nodata, average, round (a plain cast truncates), and + # keep the fill where a window holds nothing but nodata + mask = windows != fill + total = np.where(mask, as_float, 0.0).sum(axis=(1, 3)) + count = mask.sum(axis=(1, 3)) + mean = np.round(total / np.maximum(count, 1)) + return np.where(count > 0, mean, fill).astype(windows.dtype) + + +def _finest_input_source( + source: SourceReader, base_path: str, var: str, meters: int +) -> tuple[np.ndarray, int, str] | None: + """The finest input level of this subtree holding `var`, with its metres and path.""" + candidates = sorted( + (name for name in source.group_names(base_path) if _is_level_name(name)), + key=_level_meters, + ) + for name in candidates: + src_meters = _level_meters(name) + if src_meters >= meters: + return None + values = source.values(f"{base_path}/{name}/{var}") + if values is not None: + return values, src_meters, f"{base_path}/{name}/{var}" + return None + + +def _level_meters(name: str) -> int: + """The resolution in metres of a level group the plan names (`level_meters`).""" + meters = level_meters(name) + if meters is None: + msg = f"{name!r} is not a resolution level name" + raise ValueError(msg) + return meters + + +def _is_level_name(name: str) -> bool: + return level_meters(name) is not None + + +def _output_array(output: zarr.Group, path: str) -> zarr.Array: + member = output[path] + if not isinstance(member, zarr.Array): + msg = f"The planned store holds no array at {path!r}" + raise TypeError(msg) + return member diff --git a/src/eopf_geozarr/s2_optimization/s2_converter.py b/src/eopf_geozarr/s2_optimization/s2_converter.py index 64583802..1fc4e7c2 100644 --- a/src/eopf_geozarr/s2_optimization/s2_converter.py +++ b/src/eopf_geozarr/s2_optimization/s2_converter.py @@ -5,28 +5,27 @@ from __future__ import annotations import time +from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypedDict import structlog -import xarray as xr import zarr from pydantic import TypeAdapter +from pydantic_zarr.v3 import is_array_spec, is_group_spec from pyproj import CRS from eopf_geozarr.conversion import utils from eopf_geozarr.conversion.geozarr import get_zarr_group from eopf_geozarr.data_api.s1 import Sentinel1Root from eopf_geozarr.data_api.s2 import Sentinel2Root - -from .s2_multiscale import ( - _AUX_MULTISCALES, - REFLECTANCE_MULTISCALE, - S2Type, - create_multiscale_from_datatree, -) +from eopf_geozarr.data_api.s2_plan import load_sentinel2 +from eopf_geozarr.data_api.s2_write import write_geozarr if TYPE_CHECKING: - from collections.abc import Mapping + from collections.abc import Sequence + + import xarray as xr + from pydantic_zarr.v3 import AnyGroupSpec log = structlog.get_logger() @@ -139,84 +138,53 @@ def _validate_s2_input(dt_input: xr.DataTree) -> None: raise ValueError("Input dataset is not a Sentinel-2 product") -def _multiscale_paths(dt_input: xr.DataTree, datasets: Mapping[str, object]) -> list[str]: - """Pyramid parent groups of the multiscales built for this product level. - - Lists `/measurements/reflectance` and the auxiliary pyramids, each only if it - was actually written (i.e. has levels in `datasets`): not every processing - baseline carries every auxiliary group. - """ - s2_type = S2Type.from_datatree(dt_input) - return [ - spec.base_path - for spec in (REFLECTANCE_MULTISCALE, *_AUX_MULTISCALES) - if spec.applies_to(s2_type) - and any(path.startswith(spec.base_path + "/") for path in datasets) - ] - - -def add_s2_stac_assets( - dt_input: xr.DataTree, - datasets: Mapping[str, object], - crs: CRS | None = None, -) -> None: - """Add the S2 pyramid levels and the reflectance pyramid as STAC assets. - - Updates `dt_input.attrs["stac_discovery"]` in place, so call it before - `updated_root_consolidation` writes the root metadata from those attributes. - This is a temporary fix that should move to eopf-stac. - """ - if not dt_input.attrs: - return - - # this can be used to add multiscale paths to the stac attributes - updated_stac_attrs = utils.add_multiscale_pyramids_to_stac_metadata(datasets, dt_input.attrs) - - # Reference the pyramid root group, not the individual levels. That - # group carries the `multiscales` attribute, and the - # `profile=multiscales` media-type parameter tells a consumer to look - # for it there and resolve the levels from the convention itself. - stac = updated_stac_attrs.get("stac_discovery") - if stac is None: - return - - reflectance_asset: dict[str, Any] = { - "href": "/measurements/reflectance", - "type": "application/vnd.zarr; version=3; profile=multiscales", - "title": "Surface Reflectance", - "roles": ["data", "reflectance"], - "gsd": 10, - } - - if crs is not None and crs.to_epsg() is not None: - reflectance_asset.update(utils.proj_attrs_for_crs(crs)) - - base = datasets.get("/measurements/reflectance/r10m") - if isinstance(base, xr.Dataset): - reflectance_asset["proj:shape"] = [base.sizes["y"], base.sizes["x"]] - - stac.setdefault("assets", {})["reflectance"] = reflectance_asset +#: The write policy the spec-level plan fixes; `convert_s2_optimized` refuses +#: option values that deviate from it. +_PLAN_POLICY = ( + "sharding enabled, 1024-pixel inner chunks, blosc-zstd level 3, " + "and the ESA packed-integer layout (no scale_offset codec)" +) -def convert_s2( +def convert_s2_optimized( dt_input: xr.DataTree, + *, output_path: str, - validate_output: bool, - enable_sharding: bool, - spatial_chunk: int, + enable_sharding: bool = True, + spatial_chunk: int = 1024, + compression_level: int = 3, + validate_output: bool = True, + scale_offset_codec: bool = False, ) -> xr.DataTree: """ - Convert S2 dataset to optimized structure. + Convert a Sentinel-2 product to the optimized GeoZarr layout. + + The conversion is plan-driven: the input store is validated into the + `Sentinel2Root` model, `plan_geozarr` derives the output hierarchy from + the model's own metadata, and `write_geozarr` writes the planned + documents first and then fills in the chunk data. The write policy is + the plan's fixed policy, so the layout options must hold their default + values; a deviating value is refused. - Args: - dt_input: Input Sentinel-2 DataTree - output_path: Output path for optimized dataset - validate_output: Whether to validate the output - verbose: Enable verbose logging + Args: + dt_input: Input Sentinel-2 DataTree. A tree opened from a Zarr V2 + store is read through its backing store; any other tree (built in + memory by the CPM SAFE reader, or backed by a Zarr V3 store) is + read through the tree itself, with its variables taken as + xarray's zarr writer would store them. + output_path: Output path + enable_sharding: Must be True (the plan's policy). + spatial_chunk: Must be 1024 (the plan's policy). + compression_level: Must be 3 (the plan's policy). + validate_output: Whether to validate the output + scale_offset_codec: Must be False: the output is written as in the + ESA product (packed integers with CF `scale_factor` / + `add_offset` / `_FillValue`). - Returns: - Optimized DataTree + Returns: + Optimized DataTree """ + start_time = time.time() log.info( @@ -225,30 +193,62 @@ def convert_s2( output_path=output_path, ) + deviations = [ + name + for name, held in ( + ("enable_sharding=False", not enable_sharding), + (f"spatial_chunk={spatial_chunk}", spatial_chunk != 1024), + (f"compression_level={compression_level}", compression_level != 3), + ("scale_offset_codec=True", scale_offset_codec), + ) + if held + ] + if deviations: + msg = ( + f"The plan-driven S2 writer has a fixed write policy ({_PLAN_POLICY}); " + f"unsupported option(s): {', '.join(deviations)}" + ) + raise ValueError(msg) + _validate_s2_input(dt_input) - # Step 1: Process data while preserving original structure - log.info("Step 1: Processing data with original structure preserved") + # Initialize CRS from dataset + crs = initialize_crs_from_dataset(dt_input) - # Step 2: Create multiscale pyramids for each group in the original structure - log.info("Step 2: Creating multiscale pyramids (preserving original hierarchy)") - datasets = create_multiscale_from_datatree( - dt_input, - output_group=zarr.open_group(output_path), - spatial_chunk=spatial_chunk, - enable_sharding=enable_sharding, + try: + backing: zarr.Group | None = get_zarr_group(dt_input) + except TypeError: + # A tree built in memory (the CPM SAFE reader) has no backing store. + backing = None + # A Zarr V2 store is the input model's native domain and is read directly; + # everything else (an in-memory tree, a V3-backed tree) is read through + # the tree's GroupSpec-shaped view — no scratch copy. + source: zarr.Group | xr.DataTree = ( + backing if backing is not None and backing.metadata.zarr_format == 2 else dt_input ) - log.info("Created multiscale pyramids", num_groups=len(datasets)) + log.info("Step 1: Validating the input against the Sentinel-2 model") + root = load_sentinel2(source) + + log.info("Step 2: Writing the planned GeoZarr hierarchy") + plan = write_geozarr(root, source, output_path) # Step 3: Root-level consolidation log.info("Step 3: Final root-level metadata consolidation") - add_s2_stac_assets(dt_input, datasets) + datasets = _planned_dataset_index(plan) + add_s2_stac_assets( + dt_input, datasets, crs=crs, reflectance_shape=_planned_reflectance_shape(plan) + ) utils.updated_root_consolidation( dt_input=dt_input, output_path=output_path, datasets=datasets, - additional_consolidate_paths=_multiscale_paths(dt_input, datasets), + # the paths the plan maps to None are the multiscale pyramid roots + # (reflectance and the written aux pyramids alike), so the consolidated + # set follows the plan instead of a second policy table + additional_consolidate_paths=[ + path for path, variable_names in datasets.items() if variable_names is None + ], ) # Step 4: Validation @@ -269,93 +269,92 @@ def convert_s2( return result_dt -def convert_s2_optimized( - dt_input: xr.DataTree, - *, - output_path: str, - enable_sharding: bool, - spatial_chunk: int, - compression_level: int, - validate_output: bool, - scale_offset_codec: bool = False, -) -> xr.DataTree: +def _planned_dataset_index(plan: AnyGroupSpec) -> dict[str, tuple[str, ...] | None]: """ - Convenience function for S2 optimization. - - Args: - dt_input: Input Sentinel-2 DataTree - output_path: Output path - enable_sharding: Enable Zarr v3 sharding - spatial_chunk: Spatial chunk size - compression_level: Compression level 1-9 - validate_output: Whether to validate the output - scale_offset_codec: Pack reflectance with the Zarr `scale_offset` + - `cast_value` codecs. By default it is written as in the ESA - product: packed integers with CF `scale_factor` / `add_offset` / - `_FillValue` and STAC `raster:scale` / `raster:offset` / `nodata`. - - Returns: - Optimized DataTree + The planned dataset paths, each mapped to its data variable names (an + array that is not a coordinate or the grid mapping), with multiscale + roots mapped to None — the bookkeeping the root consolidation reads, + matching what the DataTree writer's `processed_groups` carried. """ + index: dict[str, tuple[str, ...] | None] = {} + + def walk(spec: AnyGroupSpec, path: str) -> None: + attributes = spec.attributes + if path and isinstance(attributes, Mapping) and "multiscales" in attributes: + index[path] = None + names = tuple( + name + for name, member in spec.members.items() + if is_array_spec(member) + and name != "spatial_ref" + and (member.dimension_names or ()) != (name,) + ) + if names: + index[path] = names + for name, member in spec.members.items(): + if is_group_spec(member): + walk(member, f"{path}/{name}") + + walk(plan, "") + return index + + +def _planned_reflectance_shape(plan: AnyGroupSpec) -> tuple[int, ...] | None: + """The (rows, cols) of the finest planned reflectance level, if present.""" + level = plan.get_path("measurements/reflectance/r10m") + if not is_group_spec(level): + return None + for member in level.members.values(): + if is_array_spec(member) and len(member.shape) == 2: + return tuple(member.shape) + return None - start_time = time.time() - - log.info( - "Starting S2 optimized conversion", - num_groups=len(dt_input.groups), - output_path=output_path, - ) - _validate_s2_input(dt_input) - - # Initialize CRS from dataset - crs = initialize_crs_from_dataset(dt_input) - - # Step 1: Process data while preserving original structure - log.info("Step 1: Processing data with original structure preserved") - - # Step 2: Create multiscale pyramids for each group in the original structure - log.info("Step 2: Creating multiscale pyramids (preserving original hierarchy)") - - output_group = zarr.open_group(output_path) - datasets = create_multiscale_from_datatree( - dt_input, - output_group=output_group, - spatial_chunk=spatial_chunk, - enable_sharding=enable_sharding, - crs=crs, - scale_offset_codec=scale_offset_codec, - compression_level=compression_level, - ) +def add_s2_stac_assets( + dt_input: xr.DataTree, + datasets: Mapping[str, Sequence[str] | None], + crs: CRS | None = None, + reflectance_shape: tuple[int, ...] | None = None, +) -> None: + """Add the S2 pyramid levels and the reflectance pyramid as STAC assets. - log.info("Created multiscale pyramids", num_groups=len(datasets)) + `datasets` is the planned dataset index: every dataset group path mapped + to its data variable names, with multiscale roots mapped to None. + `reflectance_shape` is the finest reflectance level's (rows, cols) for the + asset's proj:shape. Updates `dt_input.attrs["stac_discovery"]` in place, + so call it before `updated_root_consolidation` writes the root metadata + from those attributes. This is a temporary fix that should move to + eopf-stac. + """ + if not dt_input.attrs: + return - # Step 3: Root-level consolidation - log.info("Step 3: Final root-level metadata consolidation") - add_s2_stac_assets(dt_input, datasets, crs=crs) - utils.updated_root_consolidation( - dt_input=dt_input, - output_path=output_path, - datasets=datasets, - additional_consolidate_paths=_multiscale_paths(dt_input, datasets), - ) + # this can be used to add multiscale paths to the stac attributes + updated_stac_attrs = utils.add_multiscale_pyramids_to_stac_metadata(datasets, dt_input.attrs) - # Step 4: Validation - if validate_output: - log.info("Step 4: Validating optimized dataset") - validation_results = validate_optimized_dataset(output_path) - if not validation_results["is_valid"]: - log.warning("Validation issues found", issues=validation_results["issues"]) + # Reference the pyramid root group, not the individual levels. That + # group carries the `multiscales` attribute, and the + # `profile=multiscales` media-type parameter tells a consumer to look + # for it there and resolve the levels from the convention itself. + stac = updated_stac_attrs.get("stac_discovery") + if stac is None: + return - # Create result DataTree - result_dt = utils.create_result_datatree(output_path) + reflectance_asset: dict[str, Any] = { + "href": "/measurements/reflectance", + "type": "application/vnd.zarr; version=3; profile=multiscales", + "title": "Surface Reflectance", + "roles": ["data", "reflectance"], + "gsd": 10, + } - total_time = time.time() - start_time - log.info("Optimization complete", duration_seconds=round(total_time, 2)) + if crs is not None and crs.to_epsg() is not None: + reflectance_asset.update(utils.proj_attrs_for_crs(crs)) - utils.optimization_summary(dt_input, result_dt, output_path) + if reflectance_shape is not None: + reflectance_asset["proj:shape"] = list(reflectance_shape) - return result_dt + stac.setdefault("assets", {})["reflectance"] = reflectance_asset def is_sentinel2_dataset(group: zarr.Group) -> bool: diff --git a/src/eopf_geozarr/s2_optimization/s2_multiscale.py b/src/eopf_geozarr/s2_optimization/s2_multiscale.py index e4cbab47..4d871bfa 100644 --- a/src/eopf_geozarr/s2_optimization/s2_multiscale.py +++ b/src/eopf_geozarr/s2_optimization/s2_multiscale.py @@ -1,36 +1,25 @@ """ -Streaming multiscale pyramid creation for optimized S2 structure. -Uses lazy evaluation to minimize memory usage during dataset preparation. +The Sentinel-2 multiscale policy tables. + +This module holds the declarative side of the S2 multiscale layout: the aux +pyramid groups and levels (`_AUX_MULTISCALES`, mirrored by the plan's +`AUX_MULTISCALE_LEVELS`) and the SCL flag vocabulary. The pyramids themselves +are planned by `eopf_geozarr.data_api.s2_plan` (whose +`REFLECTANCE_SCALE_LEVELS` is the reflectance policy) and written by +`eopf_geozarr.data_api.s2_write`; the former DataTree-based write path was +removed once the plan-driven writer reproduced its stores byte for byte. """ from __future__ import annotations from dataclasses import dataclass from enum import StrEnum -from itertools import pairwise -from typing import TYPE_CHECKING, Any, Literal, cast +from typing import TYPE_CHECKING, Any -import numpy as np -import rasterio.transform -import rioxarray # noqa: F401 # enables the .rio accessor -import structlog -import xarray as xr -import zarr -from affine import Affine -from zarr_cm import LayoutObject - -from eopf_geozarr.conversion import encoding_utils, utils from eopf_geozarr.cpm.routing import product_type_of -from eopf_geozarr.s2_optimization import s2_resampling -from eopf_geozarr.s2_optimization.s2_band_mapping import BAND_INFO - -from .s2_resampling import determine_variable_type if TYPE_CHECKING: - from pyproj import CRS - from zarr.core.common import JSON - from zarr_cm import MultiscalesAttrs, SpatialAttrs, Transform - + import xarray as xr SCL_VALUES = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] SCL_LABELS = [ @@ -55,17 +44,6 @@ SCL_NODATA = SCL_VALUES[SCL_LABELS.index("NO_DATA")] -def _declare_scl_nodata(dataset: xr.Dataset) -> xr.Dataset: - """Set the SCL NO_DATA class as `_FillValue` when the source declares no nodata value. - - Not all products declare one on SCL (e.g. Zarr v2 products and the r60m SCL of - Zarr v3 products), but some clients require a CF `_FillValue`. - """ - if "scl" in dataset.data_vars and encoding_utils.find_fill_value(dataset["scl"]) is None: - dataset["scl"].encoding["_FillValue"] = SCL_NODATA - return dataset - - class S2Type(StrEnum): L1C = "L1C" L2A = "L2A" @@ -88,12 +66,9 @@ def from_datatree(cls, dt: xr.DataTree) -> S2Type | None: return cls.from_filename(product_type_of(dt)) or cls.from_filename(dt.name) -log = structlog.get_logger() - - @dataclass(frozen=True) class MultiscaleSpec: - """A group that gets a multiscale pyramid, as input to `generic_multiscales`.""" + """A group that gets a multiscale pyramid.""" base_path: str """Group holding the pyramid levels, e.g. `/measurements/reflectance`.""" @@ -116,12 +91,7 @@ def applies_to(self, s2_type: S2Type | None) -> bool: return self.product_levels is None or s2_type in self.product_levels -REFLECTANCE_MULTISCALE = MultiscaleSpec( - base_path="/measurements/reflectance", - scale_levels=(10, 20, 60, 120, 360, 720), -) - -# Auxiliary (non-reflectance) groups. Groups missing from the input are skipped with a warning. +# Auxiliary (non-reflectance) groups. Groups missing from the input are skipped. _AUX_MULTISCALES: tuple[MultiscaleSpec, ...] = ( MultiscaleSpec( base_path="/conditions/mask/l2a_classification", @@ -144,666 +114,3 @@ def applies_to(self, s2_type: S2Type | None) -> bool: scale_levels=(60, 120, 360, 720), ), ) - -GEOMETRY_PATH = "/conditions/geometry" -"""Group of the sun and viewing angle grids (node-registered, in the tile CRS).""" - -MultiscalesFlavor = Literal["experimental_multiscales_convention"] - - -def _spatial_level_attrs(dataset: xr.Dataset) -> dict[str, list[float] | list[int]]: - """`spatial:shape` and `spatial:transform` for a multiscales layout entry. - - `write_dataset_geo_metadata` leaves out an all-zero transform, but the minispec requires - `spatial:transform` on every layout entry, so fall back to the coordinate grid. - """ - transform = dataset.attrs.get("spatial:transform") - if transform is None: - transform = ( - list(utils._preferred_spatial_transform(dataset)) - if utils._has_spatial_transform(dataset) - else [] - ) - return {"spatial:shape": dataset.attrs["spatial:shape"], "spatial:transform": transform} - - -def _coarsen_variable(var_name: str, var_data: xr.DataArray, factor: int) -> xr.DataArray: - """Coarsen a single variable using type-aware resampling. - - Dispatches to the appropriate coarsen reduction (mean, max, subsample) - based on `determine_variable_type`. Preserves encoding and dtype. - """ - var_type = determine_variable_type(var_name) - - coarsened = var_data.coarsen({"x": factor, "y": factor}, boundary="trim") - if var_type in ("reflectance", "probability"): - if np.issubdtype(var_data.dtype, np.floating): - # Decoded values: nodata is NaN, so skipping NaN excludes it from the mean. - result = coarsened.mean(skipna=True) # type: ignore[attr-defined] - else: - # Raw integers: mask nodata, average, and round before the integer cast - # (a plain cast truncates). - fill_value = encoding_utils.find_fill_value(var_data) - if fill_value is None: - result = coarsened.mean().round() # type: ignore[attr-defined] - else: - result = ( - var_data.where(var_data != fill_value) - .coarsen({"x": factor, "y": factor}, boundary="trim") - .mean(skipna=True) # type: ignore[attr-defined] - .round() - .fillna(fill_value) - ) - elif var_type == "classification": - result = coarsened.reduce(subsample_2) - else: - raise ValueError(f"Unknown/Unapplicable variable type {var_type}") - - # `xr.DataArray.astype` clears `.encoding`, so we capture it first and - # restore it on the cast result. Without this, downstream code that - # inspects encoding (e.g. to push CF scale-offset into a codec pipeline) - # would see an empty encoding on every coarsened level. - # The attributes can carry the CF packing (ESA layout), so keep them too: - # `where` and the arithmetic above do not always do so. - encoding = var_data.encoding - cast_result: xr.DataArray = result.astype(var_data.dtype) - cast_result.encoding = encoding - cast_result.attrs = dict(var_data.attrs) - return cast_result - - -def inject_missing_bands( - dataset: xr.Dataset, - dt_input: xr.DataTree, - target_resolution: int, - spatial_chunk: int, - *, - bands: set[str] | None = None, - scale_offset_codec: bool = False, -) -> xr.Dataset: - """Inject bands whose native resolution is finer than `target_resolution`. - - For each spectral band defined in `BAND_INFO` whose native resolution is - finer than `target_resolution`, this function checks whether the band is - already present in `dataset`. If not, it looks for the band in the - appropriate source group (e.g. `/measurements/reflectance/r10m`), - downsamples it by the coarsening operation aligned to ESA's S2-PDGS-MPC-ATBD-L2A - (block-mean), and merges it into `dataset`. - - Args: - dataset: The target-resolution dataset (e.g. the r20m or r60m - reflectance group). - dt_input: The full input DataTree (used to locate finer-resolution - source bands). - target_resolution: Target resolution in metres (e.g. 20 or 60). - spatial_chunk: Spatial chunk size - bands: If provided, only inject these band names. If `None` - (default), inject every eligible band from `BAND_INFO`. - scale_offset_codec: Encoding mode (see `normalize_packed`). It selects - the form of the injected packed bands: decoded float32 for the - Zarr codecs, packed integers for the ESA layout. - - Returns: - `dataset` with any missing finer-resolution bands added. - """ - for band_name, info in BAND_INFO.items(): - if bands is not None and band_name not in bands: - continue - native_res = info.native_resolution # type: ignore[attr-defined] - if native_res >= target_resolution: - continue - if band_name in dataset.data_vars: - continue - - source_path = f"/measurements/reflectance/r{native_res}m" - if source_path not in dt_input.groups: - continue - - source_ds = dt_input[source_path].to_dataset() - - if band_name not in source_ds.data_vars: - continue - - band_src = source_ds[band_name] - packing = encoding_utils.packing_of(band_src) - if packing is not None: - # Use the form of the encoding mode, so the injected band has the same - # dtype as the other bands and the mean skips nodata in both input forms. - band_src = encoding_utils.normalize_packed( - band_src, packing, scale_offset_codec=scale_offset_codec - ) - factor = target_resolution // native_res - band_ds = _coarsen_variable(band_name, band_src, factor) - - # Replace coordinates with the target dataset's coordinates so that - # xarray.Dataset.assign does not try to align on mismatched values. - band_ds = xr.DataArray( - band_ds.values, - dims=band_ds.dims, - coords={d: dataset.coords[d] for d in band_ds.dims if d in dataset.coords}, - attrs=band_src.attrs, - name=band_name, - ) - - # Preserve source encoding so downstream encoding logic can inspect it - band_ds.encoding = band_src.encoding.copy() - - dataset = dataset.assign({band_name: band_ds}) - log.info( - "Injected downsampled band from finer resolution", - band=band_name, - source=f"r{native_res}m", - target=f"r{target_resolution}m", - shape=band_ds.shape, - ) - - return utils._rechunk_ds(dataset, spatial_chunk) - - -def select_unique_variable_type(ds: xr.Dataset) -> str: - variable_types = { - s2_resampling.determine_variable_type(str(data_var)) for data_var in ds.data_vars - } - if len(variable_types) > 1: - err_msg = f"The given dataset contains multiple data variable types: {variable_types}. It is not possible to map them to a single variable type." - raise ValueError(err_msg) - - return next(iter(variable_types)) - - -def generic_multiscales( - spec: MultiscaleSpec, - src_processed_groups: dict[str, Any], - output_group: zarr.Group, - spatial_chunk: int, - enable_sharding: bool = True, - crs: CRS | None = None, - scale_offset_codec: bool = False, - compression_level: int = 3, -) -> dict[str, Any]: - base_path, scale_levels = spec.base_path, spec.scale_levels - finest_dataset_key = spec.finest_key - additional_attributes = spec.additional_attributes - # Create downsampled resolution groups - if finest_dataset_key not in src_processed_groups: - raise KeyError( - f"The given `finest_dataset_key` {finest_dataset_key} is not present in `src_processed_groups` {list(src_processed_groups.keys())} which is required for the correct calculation of multiscales." - ) - - # iterate over pre-defined pyramid-dict (or smth) and generate layout data -> use LayoutObject/... - current_level_name: str = finest_dataset_key - fine_base: xr.Dataset = src_processed_groups[finest_dataset_key] - - # determine variable type and subsequent resampling method for MS layout - variable_type = select_unique_variable_type(fine_base) - resampling_method = ( - "average" - if variable_type in ("reflectance", "probability") - else "nearest" - if variable_type == "classification" - else None - ) - - # only accept ('reflectance', 'probability', or 'classification') which arr covered by determine_variable_type(..) loudly fail for other input types, as they are not safely implemented yet - if resampling_method is None: - raise ValueError( - f"resampling method for MS generation is derived from variable_type {variable_type} and didnt match any from ('reflectance', 'probability', or 'classification')" - ) - - spatial_levels: dict[str, dict[str, list[float] | list[int]]] = { - finest_dataset_key: _spatial_level_attrs(fine_base) - } - - # predefined layout asset - layout_: list[dict[str, Any]] = [ - { - "asset": finest_dataset_key, - **spatial_levels[finest_dataset_key], - } - ] - - dst_processed_groups: dict[str, Any] = {f"{base_path}/{finest_dataset_key}": fine_base} - - # iterate over source, dest pairs: (60, 120), (120, 360), ... - for source_level, dest_level in pairwise(scale_levels): - src_level_name = f"r{source_level}m" - src_level_path = f"{base_path}/{src_level_name}" - - dest_level_name = f"r{dest_level}m" - dest_level_path = f"{base_path}/{dest_level_name}" - - # each step must be an exact integer factor (20->60 = 3, 60->120 = 2, ...) - if dest_level % source_level: - raise ValueError(f"{dest_level} m is not an integer multiple of {source_level} m") - downsample_factor = dest_level // source_level - - if dest_level_name in src_processed_groups: - # reuse the native group (e.g. reflectance r20m/r60m), no coarsening needed. - # Fails loudly afterwards if its geo metadata is missing. - ds_out = src_processed_groups[dest_level_name] - - # Store results - dst_processed_groups[dest_level_path] = ds_out - else: - source_ds = ( - src_processed_groups[src_level_name] - if src_level_name in src_processed_groups - else dst_processed_groups[src_level_path] - ) - - log.info( - "Creating level with resolution", - base_path=base_path, - level=dest_level_name, - resolution=dest_level, - ) - - # Create downsampled dataset by coarsening. The coarsened dask chunks follow - # the source level (rechunked to its shards on write), so rechunk to - # `spatial_chunk` like the native levels before deriving the encoding. - downsampled_dataset = utils._rechunk_ds( - create_downsampled_resolution_group(source_ds, factor=downsample_factor), - spatial_chunk, - ) - - log.info("Writing level to path", level=dest_level_name, output_path=dest_level_path) - - # Create encoding - encoding = utils.create_uniform_encoding( - downsampled_dataset, - enable_sharding=enable_sharding, - scale_offset_codec=scale_offset_codec, - compression_level=compression_level, - ) - - # Write dataset - ds_out = utils.stream_write_dataset( - downsampled_dataset, - path=dest_level_path, - group=output_group, - encoding=encoding, - add_geo_metadata=True, - crs=crs, - ) - - # Store results - dst_processed_groups[dest_level_path] = ds_out - - # determine multiscale metadata for all datasets - spatial_levels[dest_level_path] = _spatial_level_attrs(ds_out) - - # Nominal factor (ratio of pixel spacings), not the ratio of shapes: boundary="trim" - # gives e.g. 305 -> 152 px at r720m. Intentional, see #313. - transform: Transform = { - "scale": [downsample_factor, downsample_factor], - "translation": [0.0, 0.0], - } - lo = { - "asset": dest_level_name, - "derived_from": current_level_name, - "transform": transform, - **spatial_levels[dest_level_path], - } - - layout_.append(lo) - - current_level_name = dest_level_name - - # Step 3: Add multiscales metadata to parent groups - log.info("Adding multiscales metadata to parent groups") - - # Get the parent group (it was created when writing the resolution groups). - # `output_group[base_path]` is typed `Array | Group`; `base_path` always - # addresses a group (the reflectance parent), so verify that at runtime. - parent_group = output_group[base_path] - if not isinstance(parent_group, zarr.Group): - raise TypeError( - f"expected a zarr.Group at {base_path!r}, got {type(parent_group).__name__}" - ) - - # LayoutObject is a TypedDict (no validation); zarr_cm validates in build_convention_attrs - layout: list[LayoutObject] = [LayoutObject(**lo) for lo in layout_] - ms: MultiscalesAttrs = {"layout": layout, "resampling_method": resampling_method} - - # add geozarr attrs to base of /multiscales - fine_base_spatial = grid_spatial_attrs( - transform=Affine(*spatial_levels[finest_dataset_key]["spatial:transform"]), - shape=(fine_base.sizes["y"], fine_base.sizes["x"]), - ) - - conv = utils.build_convention_attrs(multiscales=ms, spatial=fine_base_spatial, crs=crs) - parent_group.attrs.update(cast("dict[str, JSON]", conv)) - - # Add `additional_attributes` to every level in one place. The finest level and - # levels reused from the source were written before this function ran, so the - # arrays on disk are updated as well as the in-memory datasets. - if additional_attributes is not None: - for level_path, level_ds in dst_processed_groups.items(): - for data_var in level_ds.data_vars: - level_ds[data_var].attrs.update(additional_attributes) - level_array = output_group[f"{level_path.lstrip('/')}/{data_var}"] - level_array.attrs.update(cast("dict[str, JSON]", additional_attributes)) - - # add it as none here to be recognized later and can be created as a zarr root with necessary metadata - dst_processed_groups[base_path] = None - - return dst_processed_groups - - -def grid_spatial_attrs(transform: Affine, shape: tuple[int, int]) -> SpatialAttrs: - """Spatial-convention data for a regular grid with an affine *transform*. - - *shape* is ``(height, width)``. Emits ``spatial:dimensions`` ``["y","x"]``, - pixel registration, the bounding box, and the 6-element row-major affine - transform. - """ - height, width = shape - left, bottom, right, top = rasterio.transform.array_bounds(height, width, transform) - return { - "spatial:dimensions": ["y", "x"], - "spatial:registration": "pixel", - "spatial:bbox": [float(left), float(bottom), float(right), float(top)], - "spatial:transform": [ - float(transform.a), - float(transform.b), - float(transform.c), - float(transform.d), - float(transform.e), - float(transform.f), - ], - } - - -def create_multiscale_from_datatree( - dt_input: xr.DataTree, - *, - output_group: zarr.Group, - enable_sharding: bool, - spatial_chunk: int, - crs: CRS | None = None, - scale_offset_codec: bool = False, - compression_level: int = 3, -) -> dict[str, dict]: - """ - Create multiscale versions preserving original structure. - Keeps all original groups, adds r120m, r360m, r720m downsampled versions. - - Args: - dt_input: Input DataTree with original structure - output_path: Base output path - enable_sharding: Enable Zarr v3 sharding - spatial_chunk: Spatial chunk size - crs: Coordinate Reference System for datasets - scale_offset_codec: Pack packed variables with the Zarr scale-offset - codecs. By default they are written with CF attributes, as in the - ESA product. - - Returns: - Dictionary of processed groups - """ - processed_groups: dict[str, Any] = {} - # The scale levels in the output data. 10, 20, 60 already exist in the source data. - - s2_type = S2Type.from_datatree(dt_input) - if s2_type is None: - log.warning( - "Could not determine S2 product level (L1C/L2A); no bands are injected", - product_type=product_type_of(dt_input), - name=dt_input.name, - ) - - # Step 1: Copy all original groups as-is - for group_path in dt_input.groups: - if group_path == ".": - continue - - # Skip the quicklook groups (`/quality/l1c_quicklook`, `/quality/l2a_quicklook`). - # They duplicate RGB data that downstream consumers can derive from the - # reflectance bands, so dropping them shrinks the output store and - # speeds up conversion. See EOPF-Explorer/data-model#81. - if group_path.startswith(("/quality/l1c_quicklook", "/quality/l2a_quicklook")): - log.info("Skipping quicklook group", group_path=group_path) - continue - - group_node = dt_input[group_path] - - # Skip parent groups that have children (only process leaf groups) - if hasattr(group_node, "children") and len(group_node.children) > 0: - continue - - base_dataset = group_node.to_dataset() - - # Skip empty groups - if not base_dataset.data_vars: - log.info("Skipping empty group", group_path=group_path) - continue - - log.info("Copying original group", group_path=group_path) - - dataset = _declare_scl_nodata(utils._rechunk_ds(base_dataset, spatial_chunk)) - - # Determine if this is a measurement-related resolution group - group_name = group_path.split("/")[-1] - is_measurement_group = ( - group_name.startswith("r") - and group_name.endswith("m") - and "/measurements/" in group_path - ) - - if is_measurement_group: - # Inject bands whose native resolution is finer than this group's - # (e.g. b08 native at 10m into r20m/r60m) so they propagate through - # the full overview chain (r120m … r720m). - if group_path.startswith("/measurements/reflectance/"): - try: - group_resolution = int(group_name[1:-1]) - except ValueError: - group_resolution = 0 - - # just add the b08 band - if s2_type == "L2A": - if group_resolution > 10: - dataset = inject_missing_bands( - dataset, - dt_input, - group_resolution, - spatial_chunk, - scale_offset_codec=scale_offset_codec, - bands={"b08"}, - ) - - # add all lower level bands here! - elif s2_type == "L1C": - if group_resolution == 20: - dataset = inject_missing_bands( - dataset, - dt_input, - group_resolution, - spatial_chunk, - scale_offset_codec=scale_offset_codec, - bands={ - "b02", - "b03", - "b04", - "b08", - }, - ) - elif group_resolution == 60: - dataset = inject_missing_bands( - dataset, - dt_input, - group_resolution, - spatial_chunk, - scale_offset_codec=scale_offset_codec, - bands={ - "b02", - "b03", - "b04", - "b08", - "b05", - "b06", - "b07", - "b8a", - "b11", - "b12", - }, - ) - - # Measurement groups: apply custom encoding - encoding = utils.create_uniform_encoding( - dataset, - enable_sharding=enable_sharding, - scale_offset_codec=scale_offset_codec, - compression_level=compression_level, - ) - - # convert float64 arrays to float32. `xr.DataArray.astype` clears - # encoding, so we capture and restore it — downstream pyramid - # levels are coarsened from this dataset and rely on the encoding - # to drive CF packing / codec filter generation. - for data_var in dataset.data_vars: - if dataset[data_var].dtype in (np.dtype("f8")): - var_encoding = dataset[data_var].encoding - dataset[data_var] = dataset[data_var].astype("float32") - dataset[data_var].encoding = var_encoding - - else: - # Non-measurement groups: preserve original encoding - encoding = utils.create_uniform_encoding( - dataset, - enable_sharding=enable_sharding, - scale_offset_codec=scale_offset_codec, - compression_level=compression_level, - ) - - # Drop scalar (0-D) coordinates such as a source `band` label: the - # minispec's DataArray rules forbid scalar arrays in a GeoZarr dataset. - scalar_coords = [name for name, coord in dataset.coords.items() if coord.ndim == 0] - if scalar_coords: - dataset = dataset.drop_vars(scalar_coords) - for name in scalar_coords: - encoding.pop(str(name), None) - - # The sun and viewing angle grids in `/conditions/geometry` are in the tile CRS. - # Their values are at the grid nodes: `(x[0], y[0])` is the upper-left corner - # of the tile, not the centre of a cell. - is_geometry_group = group_path == GEOMETRY_PATH - add_geo_metadata = is_geometry_group or any( - m in group_path for m in ("/measurements/", "/quality/", "/conditions/mask") - ) - ds_out = utils.stream_write_dataset( - dataset, - path=group_path, - group=output_group, - encoding=encoding, - add_geo_metadata=add_geo_metadata, - crs=crs, - registration="node" if is_geometry_group else "pixel", - ) - - processed_groups[group_path] = ds_out - - # iterate over auxiliary multisacles to generate non-measurement MS - for aux in _AUX_MULTISCALES: - if not aux.applies_to(s2_type): - continue - base_path, finest_key = aux.base_path, aux.finest_key - src_path = f"{base_path}/{finest_key}" - # Not every processing baseline carries every auxiliary group: skip, don't fail. - if src_path not in processed_groups: - log.warning( - "Skipping S2 auxiliary multiscales: source group missing from input", - base_path=base_path, - src_path=src_path, - product_level=s2_type, - ) - continue - - log.info("Adding multiscales for S2 auxiliary group", base_path=base_path) - # Pass every native level, so `generic_multiscales` reuses them instead of - # coarsening them again from the finest level. - native_levels = { - f"r{level}m": processed_groups[f"{base_path}/r{level}m"] - for level in aux.scale_levels - if f"{base_path}/r{level}m" in processed_groups - } - processed_groups.update( - generic_multiscales( - aux, - src_processed_groups=native_levels, - output_group=output_group, - spatial_chunk=spatial_chunk, - enable_sharding=enable_sharding, - crs=crs, - scale_offset_codec=scale_offset_codec, - compression_level=compression_level, - ) - ) - - # generate multiscales for "/measurements/reflectance" from its native r10m/r20m/r60m levels - reflectance_path = REFLECTANCE_MULTISCALE.base_path - log.info("Adding multiscales for S2 reflectance", base_path=reflectance_path) - measurement_processed_groups: dict[str, Any] = { - key: processed_groups[f"{reflectance_path}/{key}"] for key in ("r10m", "r20m", "r60m") - } - ms_measurement_processed_groups = generic_multiscales( - REFLECTANCE_MULTISCALE, - src_processed_groups=measurement_processed_groups, - output_group=output_group, - spatial_chunk=spatial_chunk, - enable_sharding=enable_sharding, - crs=crs, - scale_offset_codec=scale_offset_codec, - compression_level=compression_level, - ) - - # update processed groups with multiscale included groups, old instances of dataset are replaced, - # which is no issue as they were not touched - processed_groups.update(ms_measurement_processed_groups) - - return processed_groups - - -def create_downsampled_resolution_group(source_dataset: xr.Dataset, factor: int) -> xr.Dataset: - """Create a downsampled version of a dataset by given factor.""" - if not source_dataset or len(source_dataset.data_vars) == 0: - return xr.Dataset() - - # Get reference dimensions - ref_var = next(iter(source_dataset.data_vars.values())) - if ref_var.ndim < 2: - return xr.Dataset() - - current_height, current_width = ref_var.shape[-2:] - target_height = current_height // factor - target_width = current_width // factor - - if target_height < 1 or target_width < 1: - return xr.Dataset() - - # Downsample all variables using existing lazy operations - lazy_vars = {} - for var_name, var_data in source_dataset.data_vars.items(): - if var_data.ndim < 2: - continue - lazy_vars[var_name] = _coarsen_variable(str(var_name), var_data, factor) - - if not lazy_vars: - return xr.Dataset() - - # Create dataset with lazy variables and coordinates - return xr.Dataset(lazy_vars, attrs=source_dataset.attrs) - - -def subsample_2(a: xr.DataArray, axis: tuple[int, ...] | None = None) -> xr.DataArray: - """Pick the centre pixel of each coarsening window (nearest-neighbour). - - `coarsen` places the output coordinates at the window centres, so the - centre pixel keeps classification aligned with the averaged bands. For an - even window there is no single centre pixel and the lower-right one of the - middle four is taken. - """ - if axis is None: - axis = tuple(range(a.ndim)) - indexer = [a.shape[i] // 2 if i in axis else slice(None) for i in range(a.ndim)] - return a[tuple(indexer)] diff --git a/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json b/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json index c98de997..9d6b6645 100644 --- a/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json +++ b/tests/_test_data/optimized_geozarr_examples/S2A_MSIL2A_20251008T100041_N0511_R122_T32TQM_20251008T122613.json @@ -5,49 +5,7 @@ "attributes": {}, "members": { "geometry": { - "attributes": { - "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", - "spatial:bbox": [ - 302386.95652173914, - 4892626.956521739, - 407413.04347826086, - 4997653.043478261 - ], - "spatial:dimensions": [ - "y", - "x" - ], - "spatial:registration": "node", - "spatial:shape": [ - 23, - 23 - ], - "spatial:transform": [ - 4773.913043478271, - 0.0, - 302386.95652173914, - 0.0, - -4773.913043478504, - 4997653.043478261 - ], - "zarr_conventions": [ - { - "description": "Spatial coordinate information", - "name": "spatial", - "schema_url": "https://raw.githubusercontent.com/zarr-conventions/spatial/refs/tags/v0.1/schema.json", - "spec_url": "https://github.com/zarr-conventions/spatial/blob/v0.1/README.md", - "uuid": "689b58e2-cf7b-45e0-9fff-9cfc0883d6b4" - }, - { - "description": "Coordinate reference system information for geospatial data", - "name": "proj", - "schema_url": "https://raw.githubusercontent.com/zarr-conventions/proj/refs/tags/v0.1/schema.json", - "spec_url": "https://github.com/zarr-conventions/proj/blob/v0.1/README.md", - "uuid": "f17cb550-5864-4468-aeb7-f3180cfb622f" - } - ] - }, + "attributes": {}, "members": { "angle": { "attributes": {}, @@ -313,65 +271,9 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "dimension_names": null, - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "sun_angles": { "attributes": { - "_FillValue": "AAAAAAAA+H8=", - "grid_mapping": "spatial_ref" + "_FillValue": "AAAAAAAA+H8=" }, "chunk_grid": { "configuration": { @@ -449,8 +351,7 @@ }, "viewing_incidence_angles": { "attributes": { - "_FillValue": "AAAAAAAA+H8=", - "grid_mapping": "spatial_ref" + "_FillValue": "AAAAAAAA+H8=" }, "chunk_grid": { "configuration": { @@ -535,9 +436,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -560,11 +459,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 23 @@ -573,9 +472,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -598,11 +495,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 23 @@ -625,10 +522,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -642,10 +539,10 @@ "spatial:transform": [ 10.0, 0.0, - 300000.0, + 699960.0, 0.0, -10.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -1093,7 +990,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -1101,9 +997,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -1126,11 +1020,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 10980 @@ -1139,9 +1033,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -1164,11 +1056,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 10980 @@ -1185,10 +1077,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -1202,10 +1094,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 699960.0, 0.0, -20.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -1843,7 +1735,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -1851,9 +1742,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -1876,11 +1765,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 5490 @@ -1889,9 +1778,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -1914,11 +1801,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 5490 @@ -1935,10 +1822,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -1952,10 +1839,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 699960.0, 0.0, -60.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -2308,7 +2195,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -2316,9 +2202,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -2341,11 +2225,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 1830 @@ -2354,9 +2238,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -2379,11 +2261,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 1830 @@ -2412,10 +2294,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 699960.0, 0.0, -60.0, - 5000040.0 + 4700040.0 ] }, { @@ -2428,10 +2310,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 699960.0, 0.0, -120.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -2454,10 +2336,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 699960.0, 0.0, -360.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -2480,10 +2362,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 699960.0, 0.0, -720.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -2501,10 +2383,10 @@ }, "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -2514,10 +2396,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 699960.0, 0.0, -60.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -2549,10 +2431,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -2566,10 +2448,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 699960.0, 0.0, -120.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -2735,7 +2617,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -2827,10 +2708,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -2844,10 +2725,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 699960.0, 0.0, -360.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -3013,7 +2894,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -3105,10 +2985,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -3122,10 +3002,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 699960.0, 0.0, -60.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -3298,7 +3178,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -3306,9 +3185,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -3331,11 +3208,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 1830 @@ -3344,9 +3221,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -3369,11 +3244,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 1830 @@ -3390,10 +3265,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890600.0, - 409440.0, - 5000040.0 + 699960.0, + 4590600.0, + 809400.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -3407,10 +3282,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 699960.0, 0.0, -720.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -3576,7 +3451,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -3680,10 +3554,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 699960.0, 0.0, -20.0, - 5000040.0 + 4700040.0 ] }, { @@ -3696,10 +3570,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 699960.0, 0.0, -60.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -3722,10 +3596,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 699960.0, 0.0, -120.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -3748,10 +3622,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 699960.0, 0.0, -360.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -3774,10 +3648,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 699960.0, 0.0, -720.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -3795,10 +3669,10 @@ }, "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -3808,10 +3682,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 699960.0, 0.0, -20.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -3843,10 +3717,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -3860,10 +3734,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 699960.0, 0.0, -120.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -4046,7 +3920,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -4138,10 +4011,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -4155,10 +4028,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 699960.0, 0.0, -20.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -4348,7 +4221,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -4356,9 +4228,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -4381,11 +4251,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 5490 @@ -4394,9 +4264,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -4419,11 +4287,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 5490 @@ -4440,10 +4308,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -4457,10 +4325,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 699960.0, 0.0, -360.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -4643,7 +4511,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -4735,10 +4602,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -4752,10 +4619,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 699960.0, 0.0, -60.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -4945,7 +4812,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -4953,9 +4819,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -4978,11 +4842,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 1830 @@ -4991,9 +4855,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -5016,11 +4878,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 1830 @@ -5037,10 +4899,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890600.0, - 409440.0, - 5000040.0 + 699960.0, + 4590600.0, + 809400.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -5054,10 +4916,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 699960.0, 0.0, -720.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -5240,7 +5102,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -7343,10 +7204,10 @@ "spatial:transform": [ 10.0, 0.0, - 300000.0, + 699960.0, 0.0, -10.0, - 5000040.0 + 4700040.0 ] }, { @@ -7359,10 +7220,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 699960.0, 0.0, -20.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -7385,10 +7246,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 699960.0, 0.0, -60.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -7411,10 +7272,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 699960.0, 0.0, -120.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -7437,10 +7298,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 699960.0, 0.0, -360.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -7463,10 +7324,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 699960.0, 0.0, -720.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -7484,10 +7345,10 @@ }, "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -7497,10 +7358,10 @@ "spatial:transform": [ 10.0, 0.0, - 300000.0, + 699960.0, 0.0, -10.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -7532,10 +7393,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -7549,10 +7410,10 @@ "spatial:transform": [ 10.0, 0.0, - 300000.0, + 699960.0, 0.0, -10.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -8032,7 +7893,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -8040,9 +7900,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -8065,11 +7923,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 10980 @@ -8078,9 +7936,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -8103,11 +7959,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 10980 @@ -8124,10 +7980,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -8141,10 +7997,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 699960.0, 0.0, -120.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -9441,7 +9297,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -9533,10 +9388,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -9550,10 +9405,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 699960.0, 0.0, -20.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -10754,7 +10609,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -10762,9 +10616,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -10787,11 +10639,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 5490 @@ -10800,9 +10652,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -10825,11 +10675,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 5490 @@ -10846,10 +10696,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -10863,10 +10713,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 699960.0, 0.0, -360.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -12163,7 +12013,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -12255,10 +12104,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -12272,10 +12121,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 699960.0, 0.0, -60.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -13579,7 +13428,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -13587,9 +13435,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -13612,11 +13458,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 1830 @@ -13625,9 +13471,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -13650,11 +13494,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 1830 @@ -13671,10 +13515,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890600.0, - 409440.0, - 5000040.0 + 699960.0, + 4590600.0, + 809400.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -13688,10 +13532,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 699960.0, 0.0, -720.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -14988,7 +14832,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -15099,10 +14942,10 @@ "spatial:transform": [ 10.0, 0.0, - 300000.0, + 699960.0, 0.0, -10.0, - 5000040.0 + 4700040.0 ] }, { @@ -15115,10 +14958,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 699960.0, 0.0, -20.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -15141,10 +14984,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 699960.0, 0.0, -60.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -15167,10 +15010,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 699960.0, 0.0, -120.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -15193,10 +15036,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 699960.0, 0.0, -360.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -15219,10 +15062,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 699960.0, 0.0, -720.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -15240,10 +15083,10 @@ }, "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -15253,10 +15096,10 @@ "spatial:transform": [ 10.0, 0.0, - 300000.0, + 699960.0, 0.0, -10.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -15288,10 +15131,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -15305,10 +15148,10 @@ "spatial:transform": [ 10.0, 0.0, - 300000.0, + 699960.0, 0.0, -10.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -15472,7 +15315,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -15576,9 +15418,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -15601,11 +15441,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 10980 @@ -15614,9 +15454,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -15639,11 +15477,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 10980 @@ -15660,10 +15498,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -15677,10 +15515,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 699960.0, 0.0, -120.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -15837,7 +15675,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -16025,10 +15862,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -16042,10 +15879,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 699960.0, 0.0, -20.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -16209,7 +16046,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -16313,9 +16149,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -16338,11 +16172,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 5490 @@ -16351,9 +16185,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -16376,11 +16208,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 5490 @@ -16397,10 +16229,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -16414,10 +16246,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 699960.0, 0.0, -360.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -16574,7 +16406,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -16762,10 +16593,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -16779,10 +16610,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 699960.0, 0.0, -60.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -16946,7 +16777,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -17050,9 +16880,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -17075,11 +16903,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 1830 @@ -17088,9 +16916,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -17113,11 +16939,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 1830 @@ -17134,10 +16960,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890600.0, - 409440.0, - 5000040.0 + 699960.0, + 4590600.0, + 809400.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -17151,10 +16977,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 699960.0, 0.0, -720.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -17311,7 +17137,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -17506,10 +17331,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -17523,10 +17348,10 @@ "spatial:transform": [ 10.0, 0.0, - 300000.0, + 699960.0, 0.0, -10.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -18054,7 +17879,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -18062,9 +17886,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -18087,11 +17909,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 10980 @@ -18100,9 +17922,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -18125,11 +17945,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 10980 @@ -18146,10 +17966,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -18163,10 +17983,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 699960.0, 0.0, -20.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -18924,7 +18744,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -18932,9 +18751,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -18957,11 +18774,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 5490 @@ -18970,9 +18787,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -18995,11 +18810,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 5490 @@ -19016,10 +18831,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -19033,10 +18848,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 699960.0, 0.0, -60.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -19449,7 +19264,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -19457,9 +19271,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -19482,11 +19294,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 1830 @@ -19495,9 +19307,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -19520,11 +19330,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 1830 @@ -19553,10 +19363,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 699960.0, 0.0, -20.0, - 5000040.0 + 4700040.0 ] }, { @@ -19569,10 +19379,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 699960.0, 0.0, -60.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -19595,10 +19405,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 699960.0, 0.0, -120.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -19621,10 +19431,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 699960.0, 0.0, -360.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -19647,10 +19457,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 699960.0, 0.0, -720.0, - 5000040.0 + 4700040.0 ], "transform": { "scale": [ @@ -19668,10 +19478,10 @@ }, "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -19681,10 +19491,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 699960.0, 0.0, -20.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -19716,10 +19526,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -19733,10 +19543,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 699960.0, 0.0, -120.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -19985,7 +19795,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -20077,10 +19886,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -20094,10 +19903,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 699960.0, 0.0, -20.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -20353,7 +20162,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -20361,9 +20169,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -20386,11 +20192,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 5490 @@ -20399,9 +20205,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -20424,11 +20228,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 5490 @@ -20445,10 +20249,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -20462,10 +20266,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 699960.0, 0.0, -360.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -20714,7 +20518,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -20806,10 +20609,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 699960.0, + 4590240.0, + 809760.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -20823,10 +20626,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 699960.0, 0.0, -60.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -21075,7 +20878,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -21167,10 +20969,10 @@ "grid_mapping": "spatial_ref", "proj:code": "EPSG:32632", "spatial:bbox": [ - 300000.0, - 4890600.0, - 409440.0, - 5000040.0 + 699960.0, + 4590600.0, + 809400.0, + 4700040.0 ], "spatial:dimensions": [ "y", @@ -21184,10 +20986,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 699960.0, 0.0, -720.0, - 5000040.0 + 4700040.0 ], "zarr_conventions": [ { @@ -21436,7 +21238,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], diff --git a/tests/_test_data/optimized_geozarr_examples/S2B_MSIL1C_20250113T103309_N0511_R108_T32TLQ_20250113T122458.json b/tests/_test_data/optimized_geozarr_examples/S2B_MSIL1C_20250113T103309_N0511_R108_T32TLQ_20250113T122458.json index fdc6dcda..bdf0344d 100644 --- a/tests/_test_data/optimized_geozarr_examples/S2B_MSIL1C_20250113T103309_N0511_R108_T32TLQ_20250113T122458.json +++ b/tests/_test_data/optimized_geozarr_examples/S2B_MSIL1C_20250113T103309_N0511_R108_T32TLQ_20250113T122458.json @@ -5,49 +5,7 @@ "attributes": {}, "members": { "geometry": { - "attributes": { - "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", - "spatial:bbox": [ - 302386.95652173914, - 4892626.956521739, - 407413.04347826086, - 4997653.043478261 - ], - "spatial:dimensions": [ - "y", - "x" - ], - "spatial:registration": "node", - "spatial:shape": [ - 23, - 23 - ], - "spatial:transform": [ - 4773.913043478271, - 0.0, - 302386.95652173914, - 0.0, - -4773.913043478504, - 4997653.043478261 - ], - "zarr_conventions": [ - { - "description": "Spatial coordinate information", - "name": "spatial", - "schema_url": "https://raw.githubusercontent.com/zarr-conventions/spatial/refs/tags/v0.1/schema.json", - "spec_url": "https://github.com/zarr-conventions/spatial/blob/v0.1/README.md", - "uuid": "689b58e2-cf7b-45e0-9fff-9cfc0883d6b4" - }, - { - "description": "Coordinate reference system information for geospatial data", - "name": "proj", - "schema_url": "https://raw.githubusercontent.com/zarr-conventions/proj/refs/tags/v0.1/schema.json", - "spec_url": "https://github.com/zarr-conventions/proj/blob/v0.1/README.md", - "uuid": "f17cb550-5864-4468-aeb7-f3180cfb622f" - } - ] - }, + "attributes": {}, "members": { "angle": { "attributes": {}, @@ -313,65 +271,9 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "dimension_names": null, - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "sun_angles": { "attributes": { - "_FillValue": "AAAAAAAA+H8=", - "grid_mapping": "spatial_ref" + "_FillValue": "AAAAAAAA+H8=" }, "chunk_grid": { "configuration": { @@ -449,8 +351,7 @@ }, "viewing_incidence_angles": { "attributes": { - "_FillValue": "AAAAAAAA+H8=", - "grid_mapping": "spatial_ref" + "_FillValue": "AAAAAAAA+H8=" }, "chunk_grid": { "configuration": { @@ -535,9 +436,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -560,11 +459,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 23 @@ -573,9 +472,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -598,11 +495,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 23 @@ -1093,7 +990,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -1101,9 +997,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -1126,11 +1020,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 10980 @@ -1139,9 +1033,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -1164,11 +1056,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 10980 @@ -1843,7 +1735,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -1851,9 +1742,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -1876,11 +1765,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 5490 @@ -1889,9 +1778,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -1914,11 +1801,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 5490 @@ -2308,7 +2195,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -2316,9 +2202,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -2341,11 +2225,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 1830 @@ -2354,9 +2238,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -2379,11 +2261,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 1830 @@ -2735,7 +2617,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -3013,7 +2894,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -3298,7 +3178,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -3306,9 +3185,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -3331,11 +3208,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 1830 @@ -3344,9 +3221,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -3369,11 +3244,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 1830 @@ -3576,7 +3451,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -6368,7 +6242,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -6376,9 +6249,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -6401,11 +6272,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 10980 @@ -6414,9 +6285,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -6439,11 +6308,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 10980 @@ -7880,7 +7749,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -9090,7 +8958,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -9098,9 +8965,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -9123,11 +8988,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 5490 @@ -9136,9 +9001,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -9161,11 +9024,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 5490 @@ -10602,7 +10465,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -12121,7 +11983,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -12129,9 +11990,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -12154,11 +12013,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 1830 @@ -12167,9 +12026,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -12192,11 +12049,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 1830 @@ -13633,7 +13490,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -14287,7 +14143,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -14295,9 +14150,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -14320,11 +14173,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 10980 @@ -14333,9 +14186,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -14358,11 +14209,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 10980 @@ -15157,7 +15008,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -15165,9 +15015,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -15190,11 +15038,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 5490 @@ -15203,9 +15051,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -15228,11 +15074,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 5490 @@ -15682,7 +15528,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -15690,9 +15535,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -15715,11 +15558,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 1830 @@ -15728,9 +15571,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -15753,11 +15594,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 1830 diff --git a/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json b/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json index bd4d8443..584ef86a 100644 --- a/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json +++ b/tests/_test_data/optimized_geozarr_examples/S2C_MSIL2A_20250811T112131_N0511_R037_T29TPF_20250811T152216.json @@ -5,49 +5,7 @@ "attributes": {}, "members": { "geometry": { - "attributes": { - "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", - "spatial:bbox": [ - 302386.95652173914, - 4892626.956521739, - 407413.04347826086, - 4997653.043478261 - ], - "spatial:dimensions": [ - "y", - "x" - ], - "spatial:registration": "node", - "spatial:shape": [ - 23, - 23 - ], - "spatial:transform": [ - 4773.913043478271, - 0.0, - 302386.95652173914, - 0.0, - -4773.913043478504, - 4997653.043478261 - ], - "zarr_conventions": [ - { - "description": "Spatial coordinate information", - "name": "spatial", - "schema_url": "https://raw.githubusercontent.com/zarr-conventions/spatial/refs/tags/v0.1/schema.json", - "spec_url": "https://github.com/zarr-conventions/spatial/blob/v0.1/README.md", - "uuid": "689b58e2-cf7b-45e0-9fff-9cfc0883d6b4" - }, - { - "description": "Coordinate reference system information for geospatial data", - "name": "proj", - "schema_url": "https://raw.githubusercontent.com/zarr-conventions/proj/refs/tags/v0.1/schema.json", - "spec_url": "https://github.com/zarr-conventions/proj/blob/v0.1/README.md", - "uuid": "f17cb550-5864-4468-aeb7-f3180cfb622f" - } - ] - }, + "attributes": {}, "members": { "angle": { "attributes": {}, @@ -313,65 +271,9 @@ "storage_transformers": [], "zarr_format": 3 }, - "spatial_ref": { - "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", - "false_easting": 500000.0, - "false_northing": 0.0, - "geographic_crs_name": "WGS 84", - "grid_mapping_name": "transverse_mercator", - "horizontal_datum_name": "World Geodetic System 1984", - "inverse_flattening": 298.257223563, - "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, - "longitude_of_prime_meridian": 0.0, - "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", - "reference_ellipsoid_name": "WGS 84", - "scale_factor_at_central_meridian": 0.9996, - "semi_major_axis": 6378137.0, - "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" - }, - "chunk_grid": { - "configuration": { - "chunk_shape": [] - }, - "name": "regular" - }, - "chunk_key_encoding": { - "configuration": { - "separator": "/" - }, - "name": "default" - }, - "codecs": [ - { - "configuration": { - "endian": "little" - }, - "name": "bytes" - }, - { - "configuration": { - "checksum": false, - "level": 0 - }, - "name": "zstd" - } - ], - "data_type": "int64", - "dimension_names": null, - "fill_value": 0, - "node_type": "array", - "shape": [], - "storage_transformers": [], - "zarr_format": 3 - }, "sun_angles": { "attributes": { - "_FillValue": "AAAAAAAA+H8=", - "grid_mapping": "spatial_ref" + "_FillValue": "AAAAAAAA+H8=" }, "chunk_grid": { "configuration": { @@ -449,8 +351,7 @@ }, "viewing_incidence_angles": { "attributes": { - "_FillValue": "AAAAAAAA+H8=", - "grid_mapping": "spatial_ref" + "_FillValue": "AAAAAAAA+H8=" }, "chunk_grid": { "configuration": { @@ -535,9 +436,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -560,11 +459,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 23 @@ -573,9 +472,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -598,11 +495,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 23 @@ -623,12 +520,12 @@ "r10m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -642,10 +539,10 @@ "spatial:transform": [ 10.0, 0.0, - 300000.0, + 600000.0, 0.0, -10.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -1047,7 +944,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -1055,15 +952,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -1093,7 +990,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -1101,9 +997,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -1126,11 +1020,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 10980 @@ -1139,9 +1033,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -1164,11 +1056,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 10980 @@ -1183,12 +1075,12 @@ "r20m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -1202,10 +1094,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 600000.0, 0.0, -20.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -1797,7 +1689,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -1805,15 +1697,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -1843,7 +1735,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -1851,9 +1742,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -1876,11 +1765,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 5490 @@ -1889,9 +1778,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -1914,11 +1801,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 5490 @@ -1933,12 +1820,12 @@ "r60m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -1952,10 +1839,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 600000.0, 0.0, -60.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -2262,7 +2149,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -2270,15 +2157,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -2308,7 +2195,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -2316,9 +2202,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -2341,11 +2225,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 1830 @@ -2354,9 +2238,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -2379,11 +2261,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 1830 @@ -2412,10 +2294,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 600000.0, 0.0, -60.0, - 5000040.0 + 4600020.0 ] }, { @@ -2428,10 +2310,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 600000.0, 0.0, -120.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -2454,10 +2336,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 600000.0, 0.0, -360.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -2480,10 +2362,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 600000.0, 0.0, -720.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -2499,12 +2381,12 @@ ], "resampling_method": "nearest" }, - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -2514,10 +2396,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 600000.0, 0.0, -60.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -2547,12 +2429,12 @@ "r120m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -2566,10 +2448,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 600000.0, 0.0, -120.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -2696,7 +2578,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -2704,15 +2586,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -2735,7 +2617,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -2825,12 +2706,12 @@ "r360m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -2844,10 +2725,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 600000.0, 0.0, -360.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -2974,7 +2855,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -2982,15 +2863,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -3013,7 +2894,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -3103,12 +2983,12 @@ "r60m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -3122,10 +3002,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 600000.0, 0.0, -60.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -3252,7 +3132,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -3260,15 +3140,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -3298,7 +3178,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -3306,9 +3185,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -3331,11 +3208,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 1830 @@ -3344,9 +3221,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -3369,11 +3244,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 1830 @@ -3388,12 +3263,12 @@ "r720m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890600.0, - 409440.0, - 5000040.0 + 600000.0, + 4490580.0, + 709440.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -3407,10 +3282,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 600000.0, 0.0, -720.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -3537,7 +3412,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -3545,15 +3420,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -3576,7 +3451,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -3680,10 +3554,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 600000.0, 0.0, -20.0, - 5000040.0 + 4600020.0 ] }, { @@ -3696,10 +3570,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 600000.0, 0.0, -60.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -3722,10 +3596,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 600000.0, 0.0, -120.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -3748,10 +3622,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 600000.0, 0.0, -360.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -3774,10 +3648,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 600000.0, 0.0, -720.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -3793,12 +3667,12 @@ ], "resampling_method": "nearest" }, - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -3808,10 +3682,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 600000.0, 0.0, -20.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -3841,12 +3715,12 @@ "r120m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -3860,10 +3734,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 600000.0, 0.0, -120.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -4007,7 +3881,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -4015,15 +3889,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -4046,7 +3920,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -4136,12 +4009,12 @@ "r20m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -4155,10 +4028,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 600000.0, 0.0, -20.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -4302,7 +4175,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -4310,15 +4183,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -4348,7 +4221,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -4356,9 +4228,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -4381,11 +4251,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 5490 @@ -4394,9 +4264,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -4419,11 +4287,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 5490 @@ -4438,12 +4306,12 @@ "r360m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -4457,10 +4325,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 600000.0, 0.0, -360.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -4604,7 +4472,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -4612,15 +4480,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -4643,7 +4511,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -4733,12 +4600,12 @@ "r60m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -4752,10 +4619,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 600000.0, 0.0, -60.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -4899,7 +4766,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -4907,15 +4774,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -4945,7 +4812,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -4953,9 +4819,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -4978,11 +4842,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 1830 @@ -4991,9 +4855,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -5016,11 +4878,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 1830 @@ -5035,12 +4897,12 @@ "r720m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890600.0, - 409440.0, - 5000040.0 + 600000.0, + 4490580.0, + 709440.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -5054,10 +4916,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 600000.0, 0.0, -720.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -5201,7 +5063,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -5209,15 +5071,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -5240,7 +5102,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -7343,10 +7204,10 @@ "spatial:transform": [ 10.0, 0.0, - 300000.0, + 600000.0, 0.0, -10.0, - 5000040.0 + 4600020.0 ] }, { @@ -7359,10 +7220,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 600000.0, 0.0, -20.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -7385,10 +7246,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 600000.0, 0.0, -60.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -7411,10 +7272,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 600000.0, 0.0, -120.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -7437,10 +7298,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 600000.0, 0.0, -360.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -7463,10 +7324,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 600000.0, 0.0, -720.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -7482,12 +7343,12 @@ ], "resampling_method": "average" }, - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -7497,10 +7358,10 @@ "spatial:transform": [ 10.0, 0.0, - 300000.0, + 600000.0, 0.0, -10.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -7530,12 +7391,12 @@ "r10m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -7549,10 +7410,10 @@ "spatial:transform": [ 10.0, 0.0, - 300000.0, + 600000.0, 0.0, -10.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -7986,7 +7847,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -7994,15 +7855,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -8032,7 +7893,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -8040,9 +7900,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -8065,11 +7923,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 10980 @@ -8078,9 +7936,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -8103,11 +7959,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 10980 @@ -8122,12 +7978,12 @@ "r120m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -8141,10 +7997,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 600000.0, 0.0, -120.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -9402,7 +9258,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -9410,15 +9266,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -9441,7 +9297,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -9531,12 +9386,12 @@ "r20m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -9550,10 +9405,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 600000.0, 0.0, -20.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -10708,7 +10563,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -10716,15 +10571,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -10754,7 +10609,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -10762,9 +10616,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -10787,11 +10639,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 5490 @@ -10800,9 +10652,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -10825,11 +10675,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 5490 @@ -10844,12 +10694,12 @@ "r360m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -10863,10 +10713,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 600000.0, 0.0, -360.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -12124,7 +11974,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -12132,15 +11982,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -12163,7 +12013,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -12253,12 +12102,12 @@ "r60m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -12272,10 +12121,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 600000.0, 0.0, -60.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -13533,7 +13382,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -13541,15 +13390,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -13579,7 +13428,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -13587,9 +13435,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -13612,11 +13458,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 1830 @@ -13625,9 +13471,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -13650,11 +13494,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 1830 @@ -13669,12 +13513,12 @@ "r720m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890600.0, - 409440.0, - 5000040.0 + 600000.0, + 4490580.0, + 709440.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -13688,10 +13532,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 600000.0, 0.0, -720.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -14949,7 +14793,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -14957,15 +14801,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -14988,7 +14832,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -15099,10 +14942,10 @@ "spatial:transform": [ 10.0, 0.0, - 300000.0, + 600000.0, 0.0, -10.0, - 5000040.0 + 4600020.0 ] }, { @@ -15115,10 +14958,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 600000.0, 0.0, -20.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -15141,10 +14984,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 600000.0, 0.0, -60.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -15167,10 +15010,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 600000.0, 0.0, -120.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -15193,10 +15036,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 600000.0, 0.0, -360.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -15219,10 +15062,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 600000.0, 0.0, -720.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -15238,12 +15081,12 @@ ], "resampling_method": "average" }, - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -15253,10 +15096,10 @@ "spatial:transform": [ 10.0, 0.0, - 300000.0, + 600000.0, 0.0, -10.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -15286,12 +15129,12 @@ "r10m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -15305,10 +15148,10 @@ "spatial:transform": [ 10.0, 0.0, - 300000.0, + 600000.0, 0.0, -10.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -15426,7 +15269,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -15434,15 +15277,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -15472,7 +15315,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -15576,9 +15418,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -15601,11 +15441,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 10980 @@ -15614,9 +15454,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -15639,11 +15477,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 10980 @@ -15658,12 +15496,12 @@ "r120m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -15677,10 +15515,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 600000.0, 0.0, -120.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -15798,7 +15636,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -15806,15 +15644,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -15837,7 +15675,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -16023,12 +15860,12 @@ "r20m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -16042,10 +15879,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 600000.0, 0.0, -20.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -16163,7 +16000,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -16171,15 +16008,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -16209,7 +16046,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -16313,9 +16149,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -16338,11 +16172,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 5490 @@ -16351,9 +16185,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -16376,11 +16208,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 5490 @@ -16395,12 +16227,12 @@ "r360m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -16414,10 +16246,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 600000.0, 0.0, -360.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -16535,7 +16367,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -16543,15 +16375,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -16574,7 +16406,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -16760,12 +16591,12 @@ "r60m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -16779,10 +16610,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 600000.0, 0.0, -60.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -16900,7 +16731,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -16908,15 +16739,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -16946,7 +16777,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -17050,9 +16880,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -17075,11 +16903,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 1830 @@ -17088,9 +16916,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -17113,11 +16939,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 1830 @@ -17132,12 +16958,12 @@ "r720m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890600.0, - 409440.0, - 5000040.0 + 600000.0, + 4490580.0, + 709440.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -17151,10 +16977,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 600000.0, 0.0, -720.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -17272,7 +17098,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -17280,15 +17106,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -17311,7 +17137,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -17504,12 +17329,12 @@ "r10m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -17523,10 +17348,10 @@ "spatial:transform": [ 10.0, 0.0, - 300000.0, + 600000.0, 0.0, -10.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -18008,7 +17833,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -18016,15 +17841,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -18054,7 +17879,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -18062,9 +17886,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -18087,11 +17909,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 10980 @@ -18100,9 +17922,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -18125,11 +17945,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 10980 @@ -18144,12 +17964,12 @@ "r20m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -18163,10 +17983,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 600000.0, 0.0, -20.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -18878,7 +18698,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -18886,15 +18706,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -18924,7 +18744,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -18932,9 +18751,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -18957,11 +18774,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 5490 @@ -18970,9 +18787,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -18995,11 +18810,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 5490 @@ -19014,12 +18829,12 @@ "r60m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -19033,10 +18848,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 600000.0, 0.0, -60.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -19403,7 +19218,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -19411,15 +19226,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -19449,7 +19264,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -19457,9 +19271,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -19482,11 +19294,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 1830 @@ -19495,9 +19307,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -19520,11 +19330,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 1830 @@ -19553,10 +19363,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 600000.0, 0.0, -20.0, - 5000040.0 + 4600020.0 ] }, { @@ -19569,10 +19379,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 600000.0, 0.0, -60.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -19595,10 +19405,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 600000.0, 0.0, -120.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -19621,10 +19431,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 600000.0, 0.0, -360.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -19647,10 +19457,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 600000.0, 0.0, -720.0, - 5000040.0 + 4600020.0 ], "transform": { "scale": [ @@ -19666,12 +19476,12 @@ ], "resampling_method": "average" }, - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -19681,10 +19491,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 600000.0, 0.0, -20.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -19714,12 +19524,12 @@ "r120m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -19733,10 +19543,10 @@ "spatial:transform": [ 120.0, 0.0, - 300000.0, + 600000.0, 0.0, -120.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -19946,7 +19756,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -19954,15 +19764,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -19985,7 +19795,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -20075,12 +19884,12 @@ "r20m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -20094,10 +19903,10 @@ "spatial:transform": [ 20.0, 0.0, - 300000.0, + 600000.0, 0.0, -20.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -20307,7 +20116,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -20315,15 +20124,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -20353,7 +20162,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -20361,9 +20169,7 @@ "zarr_format": 3 }, "x": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -20386,11 +20192,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "x" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 5490 @@ -20399,9 +20205,7 @@ "zarr_format": 3 }, "y": { - "attributes": { - "_FillValue": "AAAAAAAA+H8=" - }, + "attributes": {}, "chunk_grid": { "configuration": { "chunk_shape": [ @@ -20424,11 +20228,11 @@ "name": "bytes" } ], - "data_type": "float64", + "data_type": "int64", "dimension_names": [ "y" ], - "fill_value": "NaN", + "fill_value": 0, "node_type": "array", "shape": [ 5490 @@ -20443,12 +20247,12 @@ "r360m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -20462,10 +20266,10 @@ "spatial:transform": [ 360.0, 0.0, - 300000.0, + 600000.0, 0.0, -360.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -20675,7 +20479,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -20683,15 +20487,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -20714,7 +20518,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -20804,12 +20607,12 @@ "r60m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890240.0, - 409800.0, - 5000040.0 + 600000.0, + 4490220.0, + 709800.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -20823,10 +20626,10 @@ "spatial:transform": [ 60.0, 0.0, - 300000.0, + 600000.0, 0.0, -60.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -21036,7 +20839,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -21044,15 +20847,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -21075,7 +20878,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], @@ -21165,12 +20967,12 @@ "r720m": { "attributes": { "grid_mapping": "spatial_ref", - "proj:code": "EPSG:32632", + "proj:code": "EPSG:32629", "spatial:bbox": [ - 300000.0, - 4890600.0, - 409440.0, - 5000040.0 + 600000.0, + 4490580.0, + 709440.0, + 4600020.0 ], "spatial:dimensions": [ "y", @@ -21184,10 +20986,10 @@ "spatial:transform": [ 720.0, 0.0, - 300000.0, + 600000.0, 0.0, -720.0, - 5000040.0 + 4600020.0 ], "zarr_conventions": [ { @@ -21397,7 +21199,7 @@ }, "spatial_ref": { "attributes": { - "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]", + "crs_wkt": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]", "false_easting": 500000.0, "false_northing": 0.0, "geographic_crs_name": "WGS 84", @@ -21405,15 +21207,15 @@ "horizontal_datum_name": "World Geodetic System 1984", "inverse_flattening": 298.257223563, "latitude_of_projection_origin": 0.0, - "longitude_of_central_meridian": 9.0, + "longitude_of_central_meridian": -9.0, "longitude_of_prime_meridian": 0.0, "prime_meridian_name": "Greenwich", - "projected_crs_name": "WGS 84 / UTM zone 32N", + "projected_crs_name": "WGS 84 / UTM zone 29N", "reference_ellipsoid_name": "WGS 84", "scale_factor_at_central_meridian": 0.9996, "semi_major_axis": 6378137.0, "semi_minor_axis": 6356752.314245179, - "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]" + "spatial_ref": "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32629\"]]" }, "chunk_grid": { "configuration": { @@ -21436,7 +21238,6 @@ } ], "data_type": "int64", - "dimension_names": null, "fill_value": 0, "node_type": "array", "shape": [], diff --git a/tests/test_cpm_writer.py b/tests/test_cpm_writer.py index 2d63eaf5..50c26d9c 100644 --- a/tests/test_cpm_writer.py +++ b/tests/test_cpm_writer.py @@ -103,26 +103,21 @@ def test_write_s2_default_writes_esa_layout(tmp_path: pathlib.Path) -> None: assert asset["gsd"] == 10 -def test_write_s2_scale_offset_codec(tmp_path: pathlib.Path) -> None: - """`scale_offset_codec=True` stores the packing in Zarr codecs, without CF or STAC scale fields.""" - root = _write_s2(tmp_path, scale_offset_codec=True) - b04 = root["measurements/reflectance/r10m/b04"] - assert isinstance(b04, zarr.Array) - assert b04.dtype == np.float32 - assert {"ScaleOffset", "CastValue"} <= set(_codec_names(b04)) - assert "scale_factor" not in b04.attrs - asset = _reflectance_asset(root) - assert "raster:scale" not in asset +def test_write_s2_scale_offset_codec_is_refused(tmp_path: pathlib.Path) -> None: + """`scale_offset_codec=True` deviates from the plan-driven S2 writer's + fixed policy (the ESA packed-integer layout) and is refused.""" + with pytest.raises(ValueError, match="fixed write policy"): + _write_s2(tmp_path, scale_offset_codec=True) def test_write_s2_keep_scale_offset_is_deprecated(tmp_path: pathlib.Path) -> None: - """`keep_scale_offset` still works for one release; `False` selects the codecs.""" - with pytest.warns(DeprecationWarning, match="scale_offset_codec"): - root = _write_s2(tmp_path, keep_scale_offset=False) - b04 = root["measurements/reflectance/r10m/b04"] - assert isinstance(b04, zarr.Array) - assert b04.dtype == np.float32 - assert {"ScaleOffset", "CastValue"} <= set(_codec_names(b04)) + """`keep_scale_offset=False` still maps to `scale_offset_codec=True` with a + deprecation warning, which the S2 write policy then refuses.""" + with ( + pytest.warns(DeprecationWarning, match="scale_offset_codec"), + pytest.raises(ValueError, match="fixed write policy"), + ): + _write_s2(tmp_path, keep_scale_offset=False) def test_write_olci_end_to_end(tmp_path: pathlib.Path) -> None: diff --git a/tests/test_data_api/test_s2_plan.py b/tests/test_data_api/test_s2_plan.py index 47d3d0b2..31ab4ee5 100644 --- a/tests/test_data_api/test_s2_plan.py +++ b/tests/test_data_api/test_s2_plan.py @@ -3,6 +3,7 @@ from __future__ import annotations import json +import os import pathlib import re from typing import Any @@ -12,6 +13,7 @@ import zarr from pydantic import ValidationError from pydantic_zarr.v2 import GroupSpec as GroupSpecV2 +from pydantic_zarr.v3 import GroupSpec as GroupSpecV3 from pyproj import CRS from eopf_geozarr.conversion.open_source import open_source_datatree @@ -26,6 +28,7 @@ from eopf_geozarr.s2_optimization.s2_converter import convert_s2_optimized _INPUT_DIR = pathlib.Path("tests/_test_data/s2_examples") +_SNAPSHOT_DIR = pathlib.Path("tests/_test_data/optimized_geozarr_examples") _INPUT_PATHS = sorted(_INPUT_DIR.glob("*.json")) _L2A_PATH = next(path for path in _INPUT_PATHS if "MSIL2A" in path.stem) @@ -47,6 +50,11 @@ def _planned_root(path: pathlib.Path) -> dict[str, Any]: return plan_geozarr(root).model_dump(mode="json") +def _snapshot_root(path: pathlib.Path) -> dict[str, Any]: + snapshot = GroupSpecV3.model_validate(_read(_SNAPSHOT_DIR / path.name)) + return snapshot.model_dump(mode="json") + + def _planned_reflectance(path: pathlib.Path) -> dict[str, Any]: return _planned_root(path)["members"]["measurements"]["members"]["reflectance"] @@ -181,6 +189,23 @@ def coordinate_values(array_path: str) -> np.ndarray | None: assert [key for key in written if _canonical(written[key]) != _canonical(planned[key])] == [] +@pytest.mark.parametrize("path", _INPUT_PATHS, ids=lambda p: p.stem[:26]) +def test_plan_matches_snapshot(path: pathlib.Path) -> None: + """ + The planned tree reproduces the stored snapshot whole — the member tree, + every array document (shapes, dtypes, shards, codecs, dimension names) + and every attribute, georeferencing included, across measurements, + conditions and quality. The plan is the snapshots' source of truth + (REGENERATE_SNAPSHOTS=1 rewrites them), and the self-consistency test + below pins the georeferencing to the product's own metadata. + """ + planned = _planned_root(path) + if os.environ.get("REGENERATE_SNAPSHOTS"): + snapshot_path = _SNAPSHOT_DIR / path.name + snapshot_path.write_text(json.dumps(planned, indent=2, sort_keys=True) + "\n") + assert planned == _snapshot_root(path) + + @pytest.mark.parametrize("path", _INPUT_PATHS, ids=lambda p: p.stem[:26]) def test_plan_georeferencing_is_self_consistent(path: pathlib.Path) -> None: """ diff --git a/tests/test_data_api/test_s2_write.py b/tests/test_data_api/test_s2_write.py new file mode 100644 index 00000000..c15ed041 --- /dev/null +++ b/tests/test_data_api/test_s2_write.py @@ -0,0 +1,374 @@ +""" +Tests for the plan-driven writer (`eopf_geozarr.data_api.s2_write`). + +`write_geozarr` replaced the DataTree-based writer after reproducing its +stores byte for byte, file by file, on these fixtures (the parity test lived +here until that writer was removed). These tests pin what the writer +guarantees on its own: the stored documents are exactly the plan, and the +chunk data follows the copy / inject / coarsen semantics, checked against +independently formulated references. +""" + +from __future__ import annotations + +import hashlib +import json +import warnings +from typing import TYPE_CHECKING, Any + +import numpy as np +import pytest +import xarray as xr +import zarr +from pydantic_zarr.v3 import GroupSpec as GroupSpecV3 + +from eopf_geozarr.data_api.s2_plan import load_sentinel2 +from eopf_geozarr.data_api.s2_write import ( + DataTreeSourceReader, + ZarrSourceReader, + _coarsen, + write_geozarr, +) + +from ..conftest import create_zarrv2_group_from_json, get_stem, s2_example_json_paths + +if TYPE_CHECKING: + import pathlib + + from pydantic_zarr.v3 import AnyGroupSpec + +# Fallback footprint for coordinate arrays in groups that carry no proj +# attributes (geometry, meteorology), where the writer only copies the values. +_TILE_X_MIN = 300000.0 +_TILE_Y_MAX = 5000040.0 +_TILE_EXTENT = 109800.0 + +#: Arrays at most this many elements get deterministic test data, so the +#: resampling arithmetic is exercised on values, not only on nodata fill. +_PATTERN_MAX_ELEMENTS = 1830 * 1830 + +#: Larger arrays seeded anyway: the scene classification and one finest band, +#: so the window-centre subsampling and the band injection are exercised on +#: real values. +_PATTERNED_PATHS = ( + "conditions/mask/l2a_classification/r20m/scl", + "conditions/mask/l1c_classification/r60m/b00", + "measurements/reflectance/r10m/b08", + "quality/probability/r20m/cld", +) + +#: The L2A product used for the value-semantics checks. +_L2A_PATH = next(path for path in s2_example_json_paths if "MSIL2A" in path.stem) + + +def _walk_groups(group: zarr.Group, prefix: str = "") -> list[tuple[str, zarr.Group]]: + found: list[tuple[str, zarr.Group]] = [(prefix, group)] + for name, subgroup in group.groups(): + found.extend(_walk_groups(subgroup, f"{prefix}{name}/")) + return found + + +def _group_transform(group: zarr.Group) -> tuple[float, ...] | None: + """The proj:transform any of the group's arrays carries, if any.""" + for _, array in group.arrays(): + transform = array.attrs.get("proj:transform") + if not isinstance(transform, (list, tuple)) or len(transform) < 6: + continue + values = [value for value in transform[:6] if isinstance(value, (int, float))] + if len(values) == 6: + return tuple(float(value) for value in values) + return None + + +def _pattern(shape: tuple[int, ...], dtype: np.dtype) -> np.ndarray: + """Deterministic 2-D test values, with occasional zeros (the nodata fill).""" + modulus = min(999, int(np.iinfo(dtype).max)) + rows = np.arange(shape[0], dtype="uint16")[:, None] + cols = np.arange(shape[1], dtype="uint16")[None, :] + return ((rows * np.uint16(7) + cols) % np.uint16(modulus)).astype(dtype) + + +def _seed_input_store(group: zarr.Group) -> None: + """Give the metadata-only fixture store coordinates and array values. + + Coordinates are the pixel centres of each group's own `proj:transform`. + They are recreated as float64 so that the centres made up for groups + without a transform are stored exactly; the int64 coordinates the + fixtures declare are covered by the plan's converter comparison. Selected + arrays get deterministic values. + """ + patterned = set(_PATTERNED_PATHS) + for group_path, subgroup in _walk_groups(group): + transform = _group_transform(subgroup) + for name, array in subgroup.arrays(): + path = f"{group_path}{name}" + if name in ("x", "y") and array.ndim == 1: + centers = np.arange(array.shape[0]) + 0.5 + if transform is not None: + res_x, _, x0, _, res_y, y0 = transform + values = x0 + centers * res_x if name == "x" else y0 + centers * res_y + else: + res = _TILE_EXTENT / array.shape[0] + values = ( + _TILE_X_MIN + centers * res if name == "x" else _TILE_Y_MAX - centers * res + ) + replacement = zarr.create_array( + group.store, + name=path, + shape=array.shape, + dtype="float64", + chunks=array.chunks, + zarr_format=2, + fill_value=float("nan"), + attributes=dict(array.attrs), + overwrite=True, + ) + replacement[:] = values + elif array.ndim == 2 and np.issubdtype(array.dtype, np.integer): + if array.size <= _PATTERN_MAX_ELEMENTS or path in patterned: + array[...] = _pattern(array.shape, array.dtype) + + +def _written_store( + source_path: pathlib.Path, tmp_path: pathlib.Path +) -> tuple[AnyGroupSpec, zarr.Group, zarr.Group]: + """Seed the fixture store, write it with `write_geozarr`, open both.""" + input_path = create_zarrv2_group_from_json(source_path, tmp_path) + _seed_input_store(zarr.open_group(input_path, mode="r+", zarr_format=2)) + source = zarr.open_group(input_path, mode="r", zarr_format=2) + output_path = tmp_path / "planned.zarr" + plan = write_geozarr(load_sentinel2(source), source, str(output_path)) + return plan, source, zarr.open_group(output_path, mode="r", use_consolidated=False) + + +def _reference_block_mean(values: np.ndarray, factor: int, fill: int) -> np.ndarray: + """The converter's masked block mean, formulated independently (nanmean).""" + rows = values.shape[0] // factor * factor + cols = values.shape[1] // factor * factor + windows = values[:rows, :cols].reshape(rows // factor, factor, cols // factor, factor) + masked = np.where(windows == fill, np.nan, windows.astype("float64")) + with warnings.catch_warnings(): + warnings.simplefilter("ignore", RuntimeWarning) + mean = np.nanmean(masked, axis=(1, 3)) + return np.where(np.isnan(mean), fill, np.round(mean)).astype(values.dtype) + + +def _reference_plain_mean(values: np.ndarray, factor: int) -> np.ndarray: + """The block mean of every value, rounded: no value is nodata.""" + rows = values.shape[0] // factor * factor + cols = values.shape[1] // factor * factor + windows = values[:rows, :cols].reshape(rows // factor, factor, cols // factor, factor) + return np.round(windows.astype("float64").mean(axis=(1, 3))).astype(values.dtype) + + +@pytest.mark.parametrize("source_path", s2_example_json_paths, ids=get_stem) +def test_write_geozarr_realizes_the_plan(source_path: pathlib.Path, tmp_path: pathlib.Path) -> None: + """ + The written store holds exactly the planned hierarchy: reading it back + gives documents equal to the plan, for every group and array. + """ + plan, _, output = _written_store(source_path, tmp_path) + observed = GroupSpecV3.from_zarr(output).model_dump(mode="json") + assert observed == plan.model_dump(mode="json") + # the geometry grid is georeferenced at its nodes from the x/y values the writer + # read from the source (EOPF-Explorer/data-model#346): the seeded pixel centres + geometry = observed["members"]["conditions"]["members"]["geometry"]["attributes"] + res = _TILE_EXTENT / 23 + assert geometry["spatial:registration"] == "node" + assert geometry["spatial:transform"] == pytest.approx( + [res, 0.0, _TILE_X_MIN + 0.5 * res, 0.0, -res, _TILE_Y_MAX - 0.5 * res] + ) + + +def test_write_geozarr_data_semantics(tmp_path: pathlib.Path) -> None: + """ + The written chunk data follows the writer's semantics, checked on seeded + values: native arrays are copied, injected bands are the masked block + mean of the finest input level holding them, generated levels chain from + the previous level (mean for bands and probabilities, window-centre pixel + for the classification), coordinates take window means, and grid-mapping + arrays hold zero. The mean skips only the nodata the input declares: the + bands declare 0, the probabilities and atmosphere arrays declare none, so + their zeros (a valid probability) count. + """ + _, source, output = _written_store(_L2A_PATH, tmp_path) + + def read(group: zarr.Group, path: str) -> np.ndarray: + member = group[path] + assert isinstance(member, zarr.Array) + return np.asarray(member[...]) + + # a native array is copied (b01 r60m is small enough to carry the pattern) + native = read(output, "measurements/reflectance/r60m/b01") + np.testing.assert_array_equal(native, read(source, "measurements/reflectance/r60m/b01")) + + # an injected band is the masked block mean of its finest input level + injected = read(output, "measurements/reflectance/r60m/b08") + reference = _reference_block_mean(read(source, "measurements/reflectance/r10m/b08"), 6, 0) + np.testing.assert_array_equal(injected, reference) + + # a generated band level is the masked block mean of the previous level + generated = read(output, "measurements/reflectance/r120m/b01") + np.testing.assert_array_equal(generated, _reference_block_mean(native, 2, 0)) + + # a generated level of an array that declares no nodata is the plain block + # mean of the previous level, zeros included + for path, name, finer, coarser, factor in ( + ("quality/probability", "cld", "r20m", "r60m", 3), + ("quality/atmosphere", "aot", "r60m", "r120m", 2), + ): + previous = read(output, f"{path}/{finer}/{name}") + assert (previous == 0).any(), "fixture precondition: the seeded values hold zeros" + plain = _reference_plain_mean(previous, factor) + assert not np.array_equal(plain, _reference_block_mean(previous, factor, 0)) + np.testing.assert_array_equal(read(output, f"{path}/{coarser}/{name}"), plain) + + # a generated classification level takes each window's centre pixel + scl_native = read(output, "conditions/mask/l2a_classification/r60m/scl") + scl_generated = read(output, "conditions/mask/l2a_classification/r120m/scl") + np.testing.assert_array_equal(scl_generated, scl_native[1::2, 1::2]) + + # a generated level's coordinates are the window means of the previous level's + x_native = read(output, "measurements/reflectance/r60m/x") + x_generated = read(output, "measurements/reflectance/r120m/x") + np.testing.assert_array_equal( + x_generated, x_native[: x_generated.shape[0] * 2].reshape(-1, 2).mean(axis=1) + ) + + # grid-mapping arrays hold zero + assert read(output, "measurements/reflectance/r120m/spatial_ref") == 0 + + +@pytest.mark.parametrize("factor", [2, 3]) +@pytest.mark.parametrize("var_name", ["scl", "b00"]) +def test_coarsen_classification_takes_the_window_centre(var_name: str, factor: int) -> None: + """Classification variables (SCL, L1C cloud bitmask) take the centre pixel + of each window; for an even factor, the lower-right of the middle pixels.""" + size = 2 * factor + data = np.arange(size * size, dtype="uint8").reshape(size, size) + result = _coarsen(data, factor, var_name, fill=0) + centre = factor // 2 + np.testing.assert_array_equal(result, data[centre::factor, centre::factor]) + + +def test_coarsen_float_keeps_all_nan_windows_nan() -> None: + """The float block mean skips NaN, and a window holding nothing but NaN + stays NaN (it is nodata, not zero).""" + data = np.array( + [ + [1.0, 2.0, np.nan, np.nan], + [3.0, np.nan, np.nan, np.nan], + ], + dtype="float32", + ) + result = _coarsen(data, 2, "b02", fill=None) + np.testing.assert_array_equal(result, np.array([[2.0, np.nan]], dtype="float32")) + + +def test_coarsen_refuses_quality_masks() -> None: + """Quality-mask downsampling is not implemented, so it is refused.""" + data = np.zeros((4, 4), dtype="uint8") + with pytest.raises(ValueError, match="quality_mask"): + _coarsen(data, 2, "quality_cirrus", fill=0) + + +def test_write_geozarr_refuses_a_source_missing_the_planned_arrays( + tmp_path: pathlib.Path, +) -> None: + """A source store that lacks a planned array's data is refused.""" + input_path = create_zarrv2_group_from_json(s2_example_json_paths[0], tmp_path) + input_group = zarr.open_group(input_path, mode="r", zarr_format=2) + root = load_sentinel2(input_group) + empty_source = zarr.create_group(tmp_path / "empty.zarr", zarr_format=2) + with pytest.raises(ValueError, match="input source"): + write_geozarr(root, empty_source, str(tmp_path / "out.zarr")) + + +def _store_contents(path: pathlib.Path) -> dict[str, object]: + """Every file of a store: metadata documents as parsed JSON (their key + order is not semantic), chunk files as content digests.""" + contents: dict[str, object] = {} + for file in sorted(path.rglob("*")): + if not file.is_file(): + continue + relative = str(file.relative_to(path)) + if file.name in ("zarr.json", ".zattrs", ".zgroup", ".zarray", ".zmetadata"): + contents[relative] = json.loads(file.read_text()) + else: + contents[relative] = hashlib.sha256(file.read_bytes()).hexdigest() + return contents + + +@pytest.mark.parametrize("source_path", s2_example_json_paths, ids=get_stem) +def test_write_geozarr_from_a_datatree_matches_the_store_write( + source_path: pathlib.Path, tmp_path: pathlib.Path +) -> None: + """ + A DataTree source produces the same store as the Zarr-store source, chunk + for chunk: the tree's GroupSpec-shaped view validates into the same input + model, and the tree reader feeds the writer the same values — whether the + tree holds the raw packed values (`mask_and_scale=False`) or the decoded + ones, which the reader re-encodes as xarray's own writer would. + """ + input_path = create_zarrv2_group_from_json(source_path, tmp_path) + _seed_input_store(zarr.open_group(input_path, mode="r+", zarr_format=2)) + source = zarr.open_group(input_path, mode="r", zarr_format=2) + store_output = tmp_path / "from_store.zarr" + write_geozarr(load_sentinel2(source), source, str(store_output)) + reference = _store_contents(store_output) + + for mask_and_scale in (False, True): + tree = xr.open_datatree( + str(input_path), + engine="zarr", + chunks={}, + consolidated=False, + mask_and_scale=mask_and_scale, + decode_coords="all", + ) + tree_output = tmp_path / f"from_tree_{mask_and_scale}.zarr" + write_geozarr(load_sentinel2(tree), tree, str(tree_output)) + assert _store_contents(tree_output) == reference, f"{mask_and_scale=}" + + +@pytest.mark.parametrize( + ("fill_value", "attributes", "expected"), + [ + (0, {}, 0), + (None, {"_FillValue": 255}, 255), + (None, {"fill_value": 0}, 0), + (7, {"_FillValue": 255, "fill_value": 0}, 7), + (None, {"_FillValue": 255, "fill_value": 0}, 255), + (None, {}, None), + (None, {"fill_value": "NaN"}, None), + ], + ids=[ + "zarr-fill-value", + "cf-attribute", + "eopf-attribute", + "zarr-fill-value-first", + "cf-before-eopf", + "undeclared", + "not-a-number", + ], +) +def test_source_readers_report_the_declared_nodata( + fill_value: int | None, attributes: dict[str, Any], expected: int | None +) -> None: + """ + Both source readers report the nodata an input array declares, in the + converter's order: the CF `_FillValue` (a Zarr V2 array's `fill_value`, + xarray's encoding, or the attribute), then the EOPF `fill_value` + attribute; an array that declares none has none. + """ + group = zarr.open_group({}, mode="w", zarr_format=2) + group.create_array( + "level/var", shape=(2, 2), dtype="uint8", fill_value=fill_value + ).attrs.update(attributes) + assert ZarrSourceReader(group).nodata("level/var") == expected + + variable = xr.DataArray(np.zeros((2, 2), dtype="uint8"), dims=["y", "x"], attrs=attributes) + if fill_value is not None: + variable.encoding["_FillValue"] = fill_value + tree = xr.DataTree.from_dict({"level": xr.Dataset({"var": variable})}) + assert DataTreeSourceReader(tree).nodata("level/var") == expected diff --git a/tests/test_s2_converter_simplified.py b/tests/test_s2_converter_simplified.py index 704bf4af..e8d6b68a 100644 --- a/tests/test_s2_converter_simplified.py +++ b/tests/test_s2_converter_simplified.py @@ -8,7 +8,6 @@ import uuid from pathlib import Path from typing import cast -from unittest.mock import Mock, patch import numpy as np import pytest @@ -22,7 +21,6 @@ write_store_geo_metadata, ) from eopf_geozarr.s2_optimization.s2_converter import ( - _multiscale_paths, _validate_s2_input, add_s2_stac_assets, convert_s2_optimized, @@ -302,26 +300,32 @@ def test_updated_root_consolidation_aux_multiscales( ) -> None: """Each written auxiliary pyramid gets its own consolidated metadata listing its levels. - Pyramids missing from `datasets` (e.g. an L2A product whose processing baseline - lacks a group) are not passed on for consolidation. + The converter derives the consolidated set from the paths the plan maps to + None, so a pyramid missing from `datasets` (e.g. an L2A product whose + processing baseline lacks a group) is never passed on for consolidation. """ output_path = tmp_path / "test.zarr" levels = ("r60m", "r120m") - datasets = {"/measurements/reflectance/r10m": xr.Dataset()} + datasets: dict[str, xr.Dataset | None] = { + "/measurements/reflectance/r10m": xr.Dataset(), + "/measurements/reflectance": None, + } for base_path in aux_groups: + datasets[base_path] = None for level in levels: datasets[f"{base_path}/{level}"] = xr.Dataset({"b00": (["y", "x"], np.zeros((2, 2)))}) # Write every group into one store, as the pipeline does. for k, v in datasets.items(): - v.to_zarr(output_path, group=k.lstrip("/"), mode="a", zarr_format=3, consolidated=False) + if v is not None: + v.to_zarr(output_path, group=k.lstrip("/"), mode="a", zarr_format=3, consolidated=False) dt_input = xr.DataTree(name="S2A_MSIL2A_20250811T112131") updated_root_consolidation( dt_input=dt_input, output_path=str(output_path), datasets=datasets, - additional_consolidate_paths=_multiscale_paths(dt_input, datasets), + additional_consolidate_paths=[path for path, ds in datasets.items() if ds is None], ) for base_path in aux_groups: @@ -484,86 +488,27 @@ def test_write_store_geo_metadata_antimeridian_falls_back_to_full_range(tmp_path assert bbox == [-180.0, bbox[1], 180.0, bbox[3]], bbox -class TestConvenienceFunction: - """Test the convenience function.""" - - @patch("eopf_geozarr.conversion.utils.create_result_datatree") - @patch("eopf_geozarr.s2_optimization.s2_converter.zarr.open_group") - @patch("eopf_geozarr.s2_optimization.s2_converter.initialize_crs_from_dataset") - @patch("eopf_geozarr.s2_optimization.s2_converter.get_zarr_group") - @patch("eopf_geozarr.s2_optimization.s2_converter.is_sentinel2_dataset") - @patch("eopf_geozarr.s2_optimization.s2_converter.create_multiscale_from_datatree") - @patch("eopf_geozarr.s2_optimization.s2_converter.utils.updated_root_consolidation") - def test_convert_s2_optimized_convenience_function( - self, - mock_consolidation: Mock, - mock_multiscale: Mock, - mock_is_s2: Mock, - mock_get_zarr_group: Mock, - mock_init_crs: Mock, - mock_zarr_open_group: Mock, - mock_create_result_datatree: Mock, - ) -> None: - """Test the convenience function parameter passing.""" - # Setup mocks - # Only pyramids with written levels are consolidated, so return one level of each - mock_multiscale.return_value = { - "/measurements/reflectance/r10m": xr.Dataset(), - "/conditions/mask/l2a_classification/r20m": xr.Dataset(), - "/quality/probability/r20m": xr.Dataset(), - "/quality/atmosphere/r10m": xr.Dataset(), - "/conditions/mask/l1c_classification/r60m": xr.Dataset(), - } - mock_is_s2.return_value = True - mock_get_zarr_group.return_value = Mock() - mock_init_crs.return_value = None # Return None for CRS - - # Mock zarr.open_group to return a group with proper groups() and members() methods - mock_zarr_group = Mock() - mock_zarr_group.groups.return_value = iter([]) # Return empty iterator for groups - mock_zarr_group.members.return_value = {} # Return empty dict for members - mock_zarr_open_group.return_value = mock_zarr_group - - # Mock create_result_datatree to return a mock DataTree with groups attribute - mock_result_dt = Mock() - mock_result_dt.groups = [] # Empty list for groups - mock_create_result_datatree.return_value = mock_result_dt - - # Test parameter passing - Mock DataTree with groups attribute - dt_input = Mock() - dt_input.groups = ["/measurements/reflectance/r10m"] - # `S2Type.from_datatree` reads these; a bare Mock attribute is not a string - dt_input.attrs = {} - dt_input.name = "S2A_MSIL2A_test" - output_path = "/test/path" - +@pytest.mark.parametrize( + "deviation", + [ + {"enable_sharding": False}, + {"spatial_chunk": 512}, + {"compression_level": 2}, + {"scale_offset_codec": True}, + ], + ids=lambda d: next(iter(d)), +) +def test_convert_s2_optimized_refuses_non_policy_options(deviation: dict) -> None: + """The plan-driven writer has a fixed write policy; a deviating layout + option is refused before any work happens.""" + with pytest.raises(ValueError, match="fixed write policy"): convert_s2_optimized( - dt_input, - output_path=output_path, - enable_sharding=False, - spatial_chunk=512, - compression_level=2, + xr.DataTree(), + output_path="/unused", validate_output=False, + **deviation, ) - # Verify multiscale function was called with correct args - mock_multiscale.assert_called_once() - call_kwargs = mock_multiscale.call_args.kwargs - assert call_kwargs["enable_sharding"] is False - assert call_kwargs["spatial_chunk"] == 512 - - # Verify root consolidation runs on the converter output, with the L2A pyramids - mock_consolidation.assert_called_once() - consolidation_kwargs = mock_consolidation.call_args.kwargs - assert consolidation_kwargs["output_path"] == output_path - assert consolidation_kwargs["additional_consolidate_paths"] == [ - "/measurements/reflectance", - "/conditions/mask/l2a_classification", - "/quality/probability", - "/quality/atmosphere", - "/conditions/mask/l1c_classification", - ] - def test_add_s2_stac_assets_writes_reflectance_asset_to_root(tmp_path: Path) -> None: """The reflectance asset added by `add_s2_stac_assets` ends up in the consolidated root.""" @@ -580,14 +525,14 @@ def test_add_s2_stac_assets_writes_reflectance_asset_to_root(tmp_path: Path) -> zarr_format=3, consolidated=False, ) - datasets = {"/measurements/reflectance/r10m": r10m} + datasets: dict[str, tuple[str, ...] | None] = {"/measurements/reflectance/r10m": ()} # adding dummy data to dt_input to mimic input reference dtreee dt_input = xr.DataTree(xr.Dataset({"dummy": (["y"], np.zeros(10))})) dt_input.attrs = {"stac_discovery": {"properties": {"mission": "sentinel-2"}}} # test execution of func: the S2 assets are added before the root metadata is written - add_s2_stac_assets(dt_input, datasets, crs=CRS.from_epsg(32632)) + add_s2_stac_assets(dt_input, datasets, crs=CRS.from_epsg(32632), reflectance_shape=(10, 20)) updated_root_consolidation( output_path=output_path, datasets=datasets, @@ -611,10 +556,11 @@ def test_add_s2_stac_assets_writes_reflectance_asset_to_root(tmp_path: Path) -> def test_add_multiscale_pyramids_to_stac_metadata_adds_missing_levels() -> None: - """Pyramid levels absent from existing STAC assets get one asset per data variable.""" + """Pyramid levels absent from existing STAC assets get one asset per data + variable, whether the level is given as a dataset or as its variable names.""" existing_asset = {"href": "/measurements/reflectance/r10m/b02", "title": "B02"} attrs: dict = {"stac_discovery": {"assets": {"b02": dict(existing_asset)}}} - datasets = { + datasets: dict[str, xr.Dataset | tuple[str, ...] | None] = { # already referenced by an existing asset -> must not be duplicated "/measurements/reflectance/r10m": xr.Dataset({"b02": (["y", "x"], np.zeros((4, 4)))}), # new pyramid level -> assets added, spatial_ref skipped @@ -625,7 +571,9 @@ def test_add_multiscale_pyramids_to_stac_metadata_adds_missing_levels() -> None: "spatial_ref": ((), 0), } ), - "/measurements/reflectance/r60m": None, + # the plan-driven converter passes variable names instead of datasets + "/measurements/reflectance/r60m": ("b01", "spatial_ref"), + "/measurements/reflectance": None, } result = add_multiscale_pyramids_to_stac_metadata(datasets, attrs) @@ -635,6 +583,7 @@ def test_add_multiscale_pyramids_to_stac_metadata_adds_missing_levels() -> None: "b02": existing_asset, "b02_r20m": {"href": "/measurements/reflectance/r20m/b02", "title": "b02_r20m"}, "b05_r20m": {"href": "/measurements/reflectance/r20m/b05", "title": "b05_r20m"}, + "b01_r60m": {"href": "/measurements/reflectance/r60m/b01", "title": "b01_r60m"}, } diff --git a/tests/test_s2_multiscale.py b/tests/test_s2_multiscale.py index 851c8009..125f8072 100644 --- a/tests/test_s2_multiscale.py +++ b/tests/test_s2_multiscale.py @@ -1,22 +1,19 @@ """ -Tests for S2 multiscale pyramid creation with xy-aligned sharding. +Tests for the S2 optimized converter pipeline: the uniform encoding it stores +and the structure `convert_s2_optimized` produces end to end. The pyramids +themselves are planned by `data_api.s2_plan` and written by +`data_api.s2_write`, which carry their own tests; the golden snapshots are +pinned by `tests/test_data_api/test_s2_plan.py`. """ -import json -import os import pathlib -from collections.abc import Mapping, Sequence from itertools import pairwise -from typing import Any, cast +from typing import Any import numpy as np import pytest import xarray as xr import zarr -from affine import Affine -from pydantic_zarr.core import tuplify_json -from pydantic_zarr.v3 import GroupSpec -from pyproj import CRS from structlog.testing import capture_logs from zarr.core.metadata import ArrayV3Metadata @@ -25,22 +22,9 @@ calculate_aligned_chunk_size, create_uniform_encoding, rechunk_dataset_for_encoding, - write_dataset_geo_metadata, ) from eopf_geozarr.s2_optimization.s2_converter import convert_s2_optimized -from eopf_geozarr.s2_optimization.s2_multiscale import ( - _AUX_MULTISCALES, - MultiscaleSpec, - S2Type, - _coarsen_variable, - _declare_scl_nodata, - create_downsampled_resolution_group, - create_multiscale_from_datatree, - generic_multiscales, - inject_missing_bands, -) - -from .conftest import create_zarrv2_group_from_json, get_stem, s2_example_json_paths +from eopf_geozarr.s2_optimization.s2_multiscale import _AUX_MULTISCALES, S2Type def _codec_names(metadata: ArrayV3Metadata) -> list[str]: @@ -61,86 +45,6 @@ def sample_dataset(s2_group_example: pathlib.Path) -> xr.Dataset: )["measurements/reflectance/r10m"].to_dataset() -def test_create_downsampled_resolution_group_quality_mask() -> None: - """Quality-mask downsampling is disabled, so it should raise.""" - x = np.arange(8) - y = np.arange(6) - quality = xr.DataArray( - np.random.randint(0, 2, (6, 8), dtype=np.uint8), - dims=["y", "x"], - coords={"y": y, "x": x}, - name="quality_clouds", - ) - ds = xr.Dataset({"quality_clouds": quality}) - - with pytest.raises(ValueError, match="quality_mask"): - create_downsampled_resolution_group(ds, factor=2) - - -def test_generic_multiscales_prefers_coordinate_transform_for_inconsistent_rio( - tmp_path: pathlib.Path, -) -> None: - """Derived levels should not reuse the stale rio transform inherited from the finest level.""" - crs = CRS.from_epsg(32631) - size = 24 # 24 px at 10 m -> 12 px at 20 m -> 4 px at 60 m -> 2 px at 120 m - x = 600000.0 + np.arange(size, dtype="float64") * 10 - y = 4900020.0 - np.arange(size, dtype="float64") * 10 - r10m = _rechunk_ds( - xr.Dataset( - {"band": (["y", "x"], np.ones((size, size), dtype=np.uint16))}, - coords={"x": x, "y": y}, - ), - 1024, - ) - r10m = write_dataset_geo_metadata(r10m, crs=crs) - # A GeoTransform on `spatial_ref` is carried into every coarsened level, where - # the rio transform then no longer matches the coordinate grid. - r10m.rio.write_transform(Affine(10.0, 0.0, 599995.0, 0.0, -10.0, 4900025.0), inplace=True) - - output_path = tmp_path / "multiscales.zarr" - base_path = "/measurements/reflectance" - with capture_logs(): - generic_multiscales( - MultiscaleSpec(base_path=base_path, scale_levels=(10, 20, 60, 120)), - src_processed_groups={"r10m": r10m}, - output_group=zarr.create_group(output_path), - spatial_chunk=1024, - crs=crs, - ) - - parent_group = zarr.open_group(output_path, path=base_path) - multiscales = parent_group.attrs["multiscales"] - assert isinstance(multiscales, Mapping) - layout = multiscales["layout"] - assert isinstance(layout, Sequence) - assert [level["asset"] for level in layout if isinstance(level, Mapping)] == [ - "r10m", - "r20m", - "r60m", - "r120m", - ] - derived_level = next( - level for level in layout if isinstance(level, Mapping) and level["asset"] == "r120m" - ) - assert isinstance(derived_level, Mapping) - assert derived_level["derived_from"] == "r60m" - assert derived_level["spatial:shape"] == [2, 2] - transform = derived_level["spatial:transform"] - assert isinstance(transform, Sequence) - # Origin is the outer pixel edge, half of the 120 m pixel outside the first centre. - assert tuple(transform) == ( - 120.0, - 0.0, - 599995.0, - 0.0, - -120.0, - 4900025.0, - ) - - # The parent footprint covers the pixel edges of the finest level (#266). - assert parent_group.attrs["spatial:bbox"] == [599995.0, 4899785.0, 600235.0, 4900025.0] - - @pytest.mark.parametrize("mask_and_scale", [False, True], ids=["raw", "decoded"]) @pytest.mark.parametrize("scale_offset_codec", [True, False], ids=["codec", "cf"]) def test_create_measurements_encoding( @@ -249,81 +153,7 @@ def _band_names(group: zarr.Group) -> set[str]: # L1C r60m is filled with every finer band, so it and its overviews carry all 13. _L1C_ALL_BANDS = {f"b{i:02d}" for i in range(1, 13)} | {"b8a"} -# Footprint of an S2 tile (109.8 km square) in UTM, used to give the JSON fixtures -# real coordinates: they carry no chunk data, so every x/y value is the fill value. -_TILE_CRS = CRS.from_epsg(32632) -_TILE_X_MIN = 300000.0 -_TILE_Y_MAX = 5000040.0 -_TILE_EXTENT = 109800.0 - - -def _with_tile_coordinates(ds: xr.Dataset) -> xr.Dataset: - """Replace the x/y coordinates with pixel centres covering `_TILE_EXTENT`.""" - if "x" not in ds.dims or "y" not in ds.dims: - return ds - res_x = _TILE_EXTENT / ds.sizes["x"] - res_y = _TILE_EXTENT / ds.sizes["y"] - return ds.assign_coords( - x=_TILE_X_MIN + (np.arange(ds.sizes["x"]) + 0.5) * res_x, - y=_TILE_Y_MAX - (np.arange(ds.sizes["y"]) + 0.5) * res_y, - ) - - -@pytest.mark.filterwarnings("ignore:.*:RuntimeWarning") -@pytest.mark.filterwarnings("ignore:.*:FutureWarning") -@pytest.mark.filterwarnings("ignore:.*:UserWarning") -@pytest.mark.parametrize("source_path", s2_example_json_paths, ids=get_stem) -def test_create_multiscale_from_datatree_snapshot( - source_path: pathlib.Path, tmp_path: pathlib.Path -) -> None: - """Compare the output structure of a Zarr v2 S2 input against a stored snapshot. - - Any change to array metadata (dtype, fill value, chunks, codecs, attributes) - or to the set of arrays shows up here. When a change is intended, regenerate - the snapshots with `REGENERATE_SNAPSHOTS=1 pytest -k snapshot` and review - the JSON diff. - """ - input_group = zarr.open_group(create_zarrv2_group_from_json(source_path, tmp_path)) - dt_input = xr.open_datatree( - input_group.store, # pyright: ignore[reportArgumentType] - engine="zarr", - chunks={}, - mask_and_scale=False, - decode_coords="all", - ).map_over_datasets(_with_tile_coordinates) - output_path = str(tmp_path / "output.zarr") - with capture_logs(): - create_multiscale_from_datatree( - dt_input, - output_group=zarr.create_group(output_path), - enable_sharding=True, - spatial_chunk=1024, - crs=_TILE_CRS, - ) - observed_json = GroupSpec.from_zarr( - zarr.open_group(output_path, use_consolidated=False) - ).model_dump() - snapshot_path = pathlib.Path("tests/_test_data/optimized_geozarr_examples") / ( - source_path.stem + ".json" - ) - if os.environ.get("REGENERATE_SNAPSHOTS"): - snapshot_path.write_text(json.dumps(observed_json, indent=2, sort_keys=True) + "\n") - - observed = GroupSpec(**tuplify_json(observed_json)).to_flat() - expected = GroupSpec(**tuplify_json(json.loads(snapshot_path.read_text()))).to_flat() - assert set(observed) == set(expected) - - # Compare as JSON: a NaN fill value never equals itself as a float. - def canonical(node: object) -> str: - return json.dumps(node.model_dump(), sort_keys=True) # type: ignore[attr-defined] - - assert [key for key in observed if canonical(observed[key]) != canonical(expected[key])] == [] - - -@pytest.mark.filterwarnings("ignore:.*:RuntimeWarning") -@pytest.mark.filterwarnings("ignore:.*:FutureWarning") -@pytest.mark.filterwarnings("ignore:.*:UserWarning") def test_create_multiscale_from_datatree( s2_group_example: pathlib.Path, tmp_path: pathlib.Path, @@ -495,733 +325,3 @@ def test_create_multiscale_from_datatree( if not statistics_by_href.get(f"{level_group.path}/{band}") ] assert without_statistics == [] - - -# A 6x6 nodata block in r60m covers r120m[0:3, 0:3] and r360m[0, 0] entirely. -_NODATA_BLOCK = 6 -_SCALE_FACTOR = 0.0001 -_ADD_OFFSET = -0.1 - - -def _make_minimal_s2_datatree(*, raw: bool) -> xr.DataTree: - """Build a tiny reflectance DataTree for behavior tests. - - Three levels (r10m, r20m, r60m), one band each, packed like ESA S2 L2A - reflectance (uint16, `scale_factor` 0.0001, `add_offset` -0.1, nodata 0). - The r60m band has a nodata block of `_NODATA_BLOCK` pixels in its top-left - corner. - - `raw=False` gives decoded floats with the CF values in `.encoding`, as the - CLI opens products. `raw=True` gives the packed integers with the CF values - in `.attrs` and the nodata value only in the EOPF `fill_value` attribute, - as CPM Zarr v3 products opened with `mask_and_scale=False`. - """ - rng = np.random.default_rng(0) - - def _band(size: int, *, nodata_block: int = 0) -> xr.DataArray: - data = rng.uniform(0.0, 1.0, size=(size, size)).astype("float64") - data[:nodata_block, :nodata_block] = np.nan - coords = { - "x": np.arange(size, dtype="float64"), - "y": np.arange(size, dtype="float64"), - } - if raw: - packed = np.round((data - _ADD_OFFSET) / _SCALE_FACTOR) - packed = np.where(np.isnan(data), 0, packed).astype("uint16") - return xr.DataArray( - packed, - dims=["y", "x"], - coords=coords, - attrs={"scale_factor": _SCALE_FACTOR, "add_offset": _ADD_OFFSET, "fill_value": 0}, - ) - da = xr.DataArray(data, dims=["y", "x"], coords=coords) - da.encoding = { - "scale_factor": _SCALE_FACTOR, - "add_offset": _ADD_OFFSET, - "_FillValue": 0, - "dtype": np.dtype("uint16"), - } - return da - - r10m = xr.Dataset({"b02": _band(120)}) - r20m = xr.Dataset({"b05": _band(60)}) - r60m = xr.Dataset({"b01": _band(20, nodata_block=_NODATA_BLOCK)}) - # L1C cloud classification bitmask (OPAQUE | CIRRUS | SNOW_ICE), unpacked uint8 - # on the r60m grid, as in ESA products. Required by `create_multiscale_from_datatree`. - l1c_classification = xr.Dataset( - { - "b00": xr.DataArray( - rng.integers(0, 8, size=(20, 20), dtype="uint8"), - dims=["y", "x"], - coords=r60m.coords, - attrs={"flag_masks": [1, 2, 4], "flag_meanings": ["OPAQUE", "CIRRUS", "SNOW_ICE"]}, - ) - } - ) - - dt = xr.DataTree() - dt["measurements/reflectance/r10m"] = xr.DataTree(r10m) - dt["measurements/reflectance/r20m"] = xr.DataTree(r20m) - dt["measurements/reflectance/r60m"] = xr.DataTree(r60m) - dt["conditions/mask/l1c_classification/r60m"] = xr.DataTree(l1c_classification) - return dt - - -def _decoded(da: xr.DataArray) -> np.ndarray: - """Values of a synthetic band as the source product defines them (NaN for nodata).""" - values = da.values.astype("float64") - if np.issubdtype(da.dtype, np.integer): - return np.where(values == 0, np.nan, values * _SCALE_FACTOR + _ADD_OFFSET) - return values - - -# Spatial chunk small enough that no padding is needed for the 20x20 r60m band. -_BEHAVIOR_SPATIAL_CHUNK = 16 - -# Original groups in the synthetic datatree — those that are packed on input. -_ORIGINAL_GROUPS = { - "measurements/reflectance/r10m": "b02", - "measurements/reflectance/r20m": "b05", - "measurements/reflectance/r60m": "b01", -} - -# Downsampled groups added by `create_multiscale_from_datatree`, derived from the -# r60m level by successive coarsening. `_coarsen_variable` preserves the source -# variable's packing, so these levels are encoded like the original groups. -_DOWNSAMPLED_GROUPS = ( - "measurements/reflectance/r120m", - "measurements/reflectance/r360m", - "measurements/reflectance/r720m", -) - - -@pytest.mark.filterwarnings("ignore:.*:RuntimeWarning") -@pytest.mark.filterwarnings("ignore:.*:FutureWarning") -@pytest.mark.filterwarnings("ignore:.*:UserWarning") -@pytest.mark.parametrize("raw", [False, True], ids=["decoded", "raw"]) -@pytest.mark.parametrize("scale_offset_codec", [True, False], ids=["codec", "cf"]) -def test_create_multiscale_from_datatree_behavior( - scale_offset_codec: bool, - raw: bool, - tmp_path: pathlib.Path, -) -> None: - """Verify both encoding modes on every level of a tiny pyramid, for both input forms. - - * default: every level keeps the source packing in Zarr `scale_offset` + - `cast_value` codecs; the logical dtype is float32 (decoded) and there are - no CF scale attributes. - * `scale_offset_codec=False`: every level is uint16 on disk with the CF - `scale_factor`, `add_offset` and `_FillValue` attributes, as in the ESA - product. - - In both modes, decoded values match the source within one packing step and - nodata stays nodata through the pyramid. - """ - dt_input = _make_minimal_s2_datatree(raw=raw) - output_path = str(tmp_path / "output.zarr") - - with capture_logs(): - create_multiscale_from_datatree( - dt_input, - output_group=zarr.create_group(output_path), - enable_sharding=False, - spatial_chunk=_BEHAVIOR_SPATIAL_CHUNK, - # The spatial convention attrs that the pyramid layout needs are only written with a CRS. - crs=CRS.from_epsg(32632), - scale_offset_codec=scale_offset_codec, - ) - - def _check_array(path: str) -> None: - arr = zarr.open_array(output_path, path=path) - assert isinstance(arr.metadata, ArrayV3Metadata) - codec_names = _codec_names(arr.metadata) - cf_attrs = {"scale_factor", "add_offset"} & set(arr.attrs) - if not scale_offset_codec: - assert arr.dtype == np.uint16, f"{path}: expected uint16 on disk, got {arr.dtype}" - assert "ScaleOffset" not in codec_names - assert "CastValue" not in codec_names - assert arr.attrs["scale_factor"] == pytest.approx(_SCALE_FACTOR) - assert arr.attrs["add_offset"] == pytest.approx(_ADD_OFFSET) - assert arr.attrs["_FillValue"] == 0 - else: - assert arr.dtype == np.float32, ( - f"{path}: expected float32 logical dtype, got {arr.dtype}" - ) - assert "ScaleOffset" in codec_names, f"{path}: codecs={codec_names}" - assert "CastValue" in codec_names, f"{path}: codecs={codec_names}" - assert cf_attrs == set(), f"{path}: unexpected CF attrs {cf_attrs}" - - for group_path, var_name in _ORIGINAL_GROUPS.items(): - _check_array(f"{group_path}/{var_name}") - - parent_group = zarr.open_group(output_path, path="measurements/reflectance") - for group_path in _DOWNSAMPLED_GROUPS: - # All three downsampled levels should exist for the minimal datatree - # (10/20/60 → 120/360/720). - sub = group_path.removeprefix("measurements/reflectance/") - assert sub in dict(parent_group.groups()), f"missing downsampled group {group_path}" - ds = xr.open_dataset(output_path, engine="zarr", group=group_path, decode_coords="all") - assert ds.data_vars, f"{group_path} has no variables" - for name in ds.data_vars: - _check_array(f"{group_path}/{name}") - - # Decoded values match the source, quantised onto the packing grid. - for group_path, var_name in _ORIGINAL_GROUPS.items(): - expected = _decoded(dt_input[group_path].to_dataset()[var_name]) - observed = xr.open_dataset( - output_path, engine="zarr", group=group_path, decode_coords="all" - )[var_name].values - # Quantisation plus the float32 round trip stay within one packing step. - np.testing.assert_allclose(observed, expected, atol=_SCALE_FACTOR, rtol=0) - - # Nodata stays nodata through the pyramid: pixels fully covered by the - # source nodata block decode to NaN, the others do not. - for group_path, nodata_extent in ( - ("measurements/reflectance/r60m", _NODATA_BLOCK), - ("measurements/reflectance/r120m", _NODATA_BLOCK // 2), - ("measurements/reflectance/r360m", _NODATA_BLOCK // 6), - ): - decoded = xr.open_dataset( - output_path, engine="zarr", group=group_path, decode_coords="all" - )["b01"].values - block = decoded[:nodata_extent, :nodata_extent] - assert np.isnan(block).all(), f"{group_path}: nodata block not NaN" - assert np.isnan(decoded).sum() == block.size, f"{group_path}: unexpected NaN outside block" - - -@pytest.mark.filterwarnings("ignore:.*:RuntimeWarning") -@pytest.mark.filterwarnings("ignore:.*:FutureWarning") -@pytest.mark.filterwarnings("ignore:.*:UserWarning") -def test_create_multiscale_reuses_native_reflectance_levels(tmp_path: pathlib.Path) -> None: - """Native r20m/r60m reflectance groups are reused, not coarsened again from r10m. - - The "skip existing path" guard in `stream_write_dataset` would hide a - regression on disk, so the created levels are checked through the logs and - the native groups through their variables and values. - """ - dt_input = _make_minimal_s2_datatree(raw=False) - output_path = str(tmp_path / "output.zarr") - - with capture_logs() as logs: - create_multiscale_from_datatree( - dt_input, - output_group=zarr.create_group(output_path), - enable_sharding=False, - spatial_chunk=_BEHAVIOR_SPATIAL_CHUNK, - crs=CRS.from_epsg(32632), - ) - - created = {e["level"] for e in logs if e["event"] == "Creating level with resolution"} - assert created == {"r120m", "r360m", "r720m"} - - # The native levels hold their own band with their own values, not a coarsened r10m band. - for group_path, var_name in _ORIGINAL_GROUPS.items(): - ds = xr.open_dataset(output_path, engine="zarr", group=group_path, decode_coords="all") - assert set(ds.data_vars) == {var_name}, f"{group_path}: {set(ds.data_vars)}" - expected = _decoded(dt_input[group_path].to_dataset()[var_name]) - np.testing.assert_allclose(ds[var_name].values, expected, atol=_SCALE_FACTOR, rtol=0) - - -@pytest.mark.parametrize("enable_sharding", [False, True]) -def test_create_multiscale_applies_compression_level_to_all_levels( - tmp_path: pathlib.Path, enable_sharding: bool -) -> None: - """A non-default `compression_level` reaches the coarsened levels, not only the native ones.""" - from zarr.codecs import BloscCodec - - dt_input = _make_minimal_s2_datatree(raw=False) - output_path = str(tmp_path / "output.zarr") - create_multiscale_from_datatree( - dt_input, - output_group=zarr.create_group(output_path), - enable_sharding=enable_sharding, - spatial_chunk=_BEHAVIOR_SPATIAL_CHUNK, - crs=CRS.from_epsg(32632), - compression_level=7, - ) - - levels: dict[str, set[int]] = {} - for group_path in (*_ORIGINAL_GROUPS, *_DOWNSAMPLED_GROUPS): - level = zarr.open_group(f"{output_path}/{group_path}", mode="r") - for name, array in level.arrays(): - if name in ("x", "y", "spatial_ref"): - continue - assert isinstance(array.metadata, ArrayV3Metadata) - codecs = [ - inner - for codec in array.metadata.codecs - for inner in (codec, *getattr(codec, "codecs", ())) - ] - levels[f"{group_path}/{name}"] = { - codec.clevel for codec in codecs if isinstance(codec, BloscCodec) - } - assert levels, "no data arrays found" - assert all(clevels == {7} for clevels in levels.values()), levels - - -def test_create_multiscale_reuses_native_aux_levels(tmp_path: pathlib.Path) -> None: - """Native r60m levels of the auxiliary pyramids are reused, not coarsened again from r20m. - - Checked through the logs and the stored values, so the test does not rely on - the "skip existing path" guard in `stream_write_dataset`, which would hide a - coarsened level on disk. - """ - dt_input = _make_minimal_s2_datatree(raw=False) - dt_input.name = "S2A_MSIL2A_20250811T112131" - rng = np.random.default_rng(1) - aux_vars = {"conditions/mask/l2a_classification": "scl", "quality/probability": "cld"} - for base_path, var_name in aux_vars.items(): - for level, size in (("r20m", 60), ("r60m", 20)): - coords = {"x": np.arange(float(size)), "y": np.arange(float(size))} - data = rng.integers(0, 12, size=(size, size), dtype="uint8") - band = xr.DataArray(data, dims=["y", "x"], coords=coords) - dt_input[f"{base_path}/{level}"] = xr.DataTree(xr.Dataset({var_name: band})) - output_path = str(tmp_path / "output.zarr") - - with capture_logs() as logs: - create_multiscale_from_datatree( - dt_input, - output_group=zarr.create_group(output_path), - enable_sharding=False, - spatial_chunk=_BEHAVIOR_SPATIAL_CHUNK, - crs=CRS.from_epsg(32632), - ) - - for base_path, var_name in aux_vars.items(): - created = { - e["level"] - for e in logs - if e["event"] == "Creating level with resolution" and e["base_path"] == f"/{base_path}" - } - assert created == {"r120m", "r360m", "r720m"}, base_path - - # The native r60m level holds the source values, not r20m values sampled down. - group_path = f"{base_path}/r60m" - ds = xr.open_dataset( - output_path, engine="zarr", group=group_path, mask_and_scale=False, decode_coords="all" - ) - expected = dt_input[group_path].to_dataset()[var_name].values - np.testing.assert_array_equal(ds[var_name].values, expected) - - -def _convention_names(attrs: Mapping[str, Any]) -> set[str]: - """Names of the conventions declared in `zarr_conventions`.""" - return {c["name"] for c in cast("list[dict[str, Any]]", attrs["zarr_conventions"])} - - -def test_create_multiscale_declares_crs_on_conditions_groups(tmp_path: pathlib.Path) -> None: - """`conditions/geometry` and `conditions/mask/detector_footprint/r*` declare the tile CRS. - - The angle grids are node-registered: `(x[0], y[0])` is the upper-left corner of - the tile, so `spatial:transform` starts there and is not moved by a half cell. - Arrays without the x/y dimensions get no grid mapping. - See EOPF-Explorer/data-model#346. - """ - dt_input = _make_minimal_s2_datatree(raw=False) - rng = np.random.default_rng(2) - - # 23 x 23 nodes with a step of 5000 m, from the upper-left corner of the tile. - size, step, ulx, uly = 23, 5000.0, 600000.0, 7800000.0 - x = ulx + step * np.arange(size) - y = uly - step * np.arange(size) - dt_input["conditions/geometry"] = xr.DataTree( - xr.Dataset( - { - "mean_sun_angles": (["angle"], rng.uniform(0, 180, 2)), - "sun_angles": (["angle", "y", "x"], rng.uniform(0, 180, (2, size, size))), - "mean_viewing_incidence_angles": (["band", "angle"], rng.uniform(0, 180, (3, 2))), - "viewing_incidence_angles": ( - ["band", "detector", "angle", "y", "x"], - rng.uniform(0, 180, (3, 2, 2, size, size)), - ), - }, - coords={ - "x": x, - "y": y, - "angle": ["zenith", "azimuth"], - "band": ["b01", "b02", "b03"], - "detector": [1, 2], - }, - ) - ) - r60m_coords = dt_input["measurements/reflectance/r60m"].to_dataset().coords - footprint = xr.DataArray( - rng.integers(0, 3, size=(20, 20), dtype="uint8"), dims=["y", "x"], coords=r60m_coords - ) - dt_input["conditions/mask/detector_footprint/r60m"] = xr.DataTree( - xr.Dataset({"b01": footprint}) - ) - output_path = str(tmp_path / "output.zarr") - - with capture_logs(): - create_multiscale_from_datatree( - dt_input, - output_group=zarr.create_group(output_path), - enable_sharding=False, - spatial_chunk=_BEHAVIOR_SPATIAL_CHUNK, - crs=CRS.from_epsg(32636), - ) - - geometry = zarr.open_group(output_path, path="conditions/geometry", mode="r") - attrs = geometry.attrs.asdict() - assert _convention_names(attrs) == {"spatial", "proj"} - assert attrs["proj:code"] == "EPSG:32636" - assert attrs["spatial:dimensions"] == ["y", "x"] - assert attrs["spatial:registration"] == "node" - assert attrs["spatial:shape"] == [size, size] - assert attrs["spatial:transform"] == [step, 0.0, ulx, 0.0, -step, uly] - assert attrs["spatial:bbox"] == [ulx, uly - step * (size - 1), ulx + step * (size - 1), uly] - - assert geometry["sun_angles"].attrs["grid_mapping"] == "spatial_ref" - assert geometry["viewing_incidence_angles"].attrs["grid_mapping"] == "spatial_ref" - assert "grid_mapping" not in geometry["mean_sun_angles"].attrs - assert "grid_mapping" not in geometry["mean_viewing_incidence_angles"].attrs - - detector_footprint = zarr.open_group( - output_path, path="conditions/mask/detector_footprint/r60m", mode="r" - ).attrs.asdict() - assert _convention_names(detector_footprint) == {"spatial", "proj"} - assert detector_footprint["proj:code"] == "EPSG:32636" - assert detector_footprint["spatial:registration"] == "pixel" - assert detector_footprint["spatial:shape"] == [20, 20] - assert "spatial:transform" in detector_footprint - - -def test_create_multiscale_builds_atmosphere_pyramid(tmp_path: pathlib.Path) -> None: - """`quality/atmosphere` (aot, wvp) gets a pyramid like the reflectance bands. - - Its native r10m/r20m/r60m levels are reused, r120m/r360m/r720m are block means - of the level before them with nodata (0) skipped, and the parent group lists all - six levels in its `multiscales` layout. - """ - dt_input = _make_minimal_s2_datatree(raw=False) - dt_input.name = "S2A_MSIL2A_20250811T112131" - rng = np.random.default_rng(3) - for level, size in (("r10m", 120), ("r20m", 60), ("r60m", 20)): - coords = {"x": np.arange(float(size)), "y": np.arange(float(size))} - variables = {} - for name in ("aot", "wvp"): - data = rng.integers(1, 3000, size=(size, size)).astype("float64") * 0.001 - data[:2, :2] = np.nan - da = xr.DataArray(data, dims=["y", "x"], coords=coords) - da.encoding = {"scale_factor": 0.001, "_FillValue": 0, "dtype": np.dtype("uint16")} - variables[name] = da - dt_input[f"quality/atmosphere/{level}"] = xr.DataTree(xr.Dataset(variables)) - output_path = str(tmp_path / "output.zarr") - - with capture_logs() as logs: - create_multiscale_from_datatree( - dt_input, - output_group=zarr.create_group(output_path), - enable_sharding=False, - spatial_chunk=_BEHAVIOR_SPATIAL_CHUNK, - crs=CRS.from_epsg(32632), - ) - - created = { - e["level"] - for e in logs - if e["event"] == "Creating level with resolution" - and e["base_path"] == "/quality/atmosphere" - } - assert created == {"r120m", "r360m", "r720m"} - - parent = zarr.open_group(output_path, path="quality/atmosphere", mode="r") - multiscales: Any = parent.attrs["multiscales"] - assert [lo["asset"] for lo in multiscales["layout"]] == [ - "r10m", - "r20m", - "r60m", - "r120m", - "r360m", - "r720m", - ] - assert multiscales["resampling_method"] == "average" - - def open_level(name: str) -> xr.Dataset: - return xr.open_dataset( - output_path, engine="zarr", group=f"quality/atmosphere/{name}", decode_coords="all" - ) - - r60m, r120m = open_level("r60m"), open_level("r120m") - source_r60m = dt_input["quality/atmosphere/r60m"].to_dataset() - for name in ("aot", "wvp"): - expected = r60m[name].coarsen(x=2, y=2, boundary="trim").mean(skipna=True) # type: ignore[attr-defined] - np.testing.assert_allclose(r120m[name].values, expected.values, atol=0.001) - # the native r60m values are kept, not coarsened again from r20m - np.testing.assert_allclose(r60m[name].values, source_r60m[name].values, atol=0.001) - - -@pytest.mark.parametrize("enable_sharding", [False, True]) -def test_create_multiscale_chunks_coarsened_levels_like_native_levels( - tmp_path: pathlib.Path, enable_sharding: bool -) -> None: - """Every level, native or coarsened, is chunked by `spatial_chunk`. - - `quality/probability` has no native r60m level, so its r60m is coarsened from - r20m by a factor of 3 and would otherwise take its chunks from the r20m dask - chunks (the r20m shard, or a third of `spatial_chunk`). - """ - dt_input = _make_minimal_s2_datatree(raw=False) - dt_input.name = "S2A_MSIL2A_20250811T112131" - rng = np.random.default_rng(2) - coords = {"x": np.arange(60.0), "y": np.arange(60.0)} - cld = xr.DataArray(rng.integers(0, 101, size=(60, 60), dtype="uint8"), dims=["y", "x"]) - dt_input["quality/probability/r20m"] = xr.DataTree(xr.Dataset({"cld": cld}, coords=coords)) - output_path = str(tmp_path / "output.zarr") - create_multiscale_from_datatree( - dt_input, - output_group=zarr.create_group(output_path), - enable_sharding=enable_sharding, - spatial_chunk=_BEHAVIOR_SPATIAL_CHUNK, - crs=CRS.from_epsg(32632), - ) - - root = zarr.open_group(output_path, mode="r") - chunks = { - path: (array.shape, array.chunks) - for path, array in root.members(max_depth=None) - if isinstance(array, zarr.Array) and array.ndim == 2 - } - assert "quality/probability/r60m/cld" in chunks - assert "quality/probability/r120m/cld" in chunks - mismatched = { - path: (shape, chunk) - for path, (shape, chunk) in chunks.items() - if chunk != tuple(min(_BEHAVIOR_SPATIAL_CHUNK, size) for size in shape) - } - assert not mismatched, mismatched - - -# --------------------------------------------------------------------------- -# _coarsen_variable -# --------------------------------------------------------------------------- - - -@pytest.mark.parametrize("factor", [2, 3]) -@pytest.mark.parametrize("var_name", ["scl", "b00"]) -def test_coarsen_variable_classification(var_name: str, factor: int) -> None: - """Classification variables (SCL, L1C cloud bitmask) take the centre pixel of each block. - - The output coordinates are the block centres, so the centre pixel keeps the - classes aligned with the averaged bands. For an even factor there is no single - centre pixel and the lower-right one of the middle four is taken. - """ - size = 2 * factor - data = np.arange(size * size, dtype="uint8").reshape(size, size) - coords = {"y": np.arange(float(size)), "x": np.arange(float(size))} - var = xr.DataArray(data, dims=["y", "x"], coords=coords) - result = _coarsen_variable(var_name, var, factor=factor) - assert result.shape == (2, 2) - assert result.dtype == np.uint8 - centre = factor // 2 - np.testing.assert_array_equal(result.values, data[centre::factor, centre::factor]) - # The sampled pixel lies on the block centre for odd factors, half a pixel off for even ones. - block_centres = np.arange(2) * factor + (factor - 1) / 2 - np.testing.assert_array_equal(result["x"].values, block_centres) - np.testing.assert_array_equal(result["y"].values, block_centres) - sampled = coords["x"][centre::factor] - assert np.abs(sampled - block_centres).max() == (0 if factor % 2 else 0.5) - - -@pytest.mark.parametrize( - ("attrs", "expected_fill"), - [({}, 0), ({"fill_value": 255}, None)], - ids=["undeclared", "declared"], -) -def test_declare_scl_nodata(attrs: dict, expected_fill: int | None) -> None: - """SCL gets its NO_DATA class as `_FillValue` only when the source declares no nodata.""" - scl = xr.DataArray(np.zeros((2, 2), dtype="uint8"), dims=["y", "x"], attrs=attrs) - cld = xr.DataArray(np.zeros((2, 2), dtype="uint8"), dims=["y", "x"]) - result = _declare_scl_nodata(xr.Dataset({"scl": scl, "cld": cld})) - assert result["scl"].encoding.get("_FillValue") == expected_fill - # 0 is a valid probability, so other variables are left alone. - assert "_FillValue" not in result["cld"].encoding - - -def test_coarsen_variable_quality_mask() -> None: - """Quality mask downsampling is disabled, so it should raise.""" - data = np.array([[0, 1], [2, 3]], dtype="uint8") - var = xr.DataArray(data, dims=["y", "x"], coords={"y": np.arange(2.0), "x": np.arange(2.0)}) - with pytest.raises(ValueError, match="quality_mask"): - _coarsen_variable("quality_cirrus", var, factor=2) - - -# --------------------------------------------------------------------------- -# inject_missing_bands -# --------------------------------------------------------------------------- - - -def _make_reflectance_datatree() -> xr.DataTree: - """Build a minimal DataTree with /measurements/reflectance/r10m and r20m.""" - size_10m = 120 # must be divisible by 2 (→60) and 6 (→20) - x10 = np.arange(size_10m, dtype="float64") - y10 = np.arange(size_10m, dtype="float64") - - r10m_ds = xr.Dataset( - { - "b02": (["y", "x"], np.ones((size_10m, size_10m), dtype="uint16")), - "b03": (["y", "x"], np.ones((size_10m, size_10m), dtype="uint16")), - "b04": (["y", "x"], np.ones((size_10m, size_10m), dtype="uint16")), - "b08": (["y", "x"], np.full((size_10m, size_10m), 42, dtype="uint16")), - }, - coords={"x": x10, "y": y10}, - ) - - size_20m = size_10m // 2 - x20 = np.arange(size_20m, dtype="float64") - y20 = np.arange(size_20m, dtype="float64") - r20m_ds = xr.Dataset( - { - "b05": (["y", "x"], np.ones((size_20m, size_20m), dtype="uint16")), - }, - coords={"x": x20, "y": y20}, - ) - - dt = xr.DataTree() - dt["measurements/reflectance/r10m"] = xr.DataTree(r10m_ds) - dt["measurements/reflectance/r20m"] = xr.DataTree(r20m_ds) - return dt - - -@pytest.mark.parametrize("scale_offset_codec", [True, False]) -def test_inject_missing_bands_skips_unmasked_nodata(scale_offset_codec: bool) -> None: - """Decoded Zarr v3 input keeps its nodata unmasked; injection must still skip it. - - xarray only masks `_FillValue`, so a decoded CPM Zarr v3 band shows nodata - as `0 * scale_factor + add_offset` and declares it only in the EOPF - `fill_value` attribute. The codec mode injects decoded float32 values; the - ESA layout injects packed integers, with no cast to float. - """ - dt = _make_reflectance_datatree() - decoded = np.full((120, 120), 0.3) - decoded[0, 0] = -0.1 # nodata (DN 0) in the top-left 2x2 block - decoded[2:4, 2:4] = -0.1 # a fully nodata 2x2 block - b08 = xr.DataArray( - decoded, - dims=["y", "x"], - coords=dt["measurements/reflectance/r10m"].to_dataset().coords, - attrs={"fill_value": 0}, - ) - b08.encoding = {"scale_factor": 0.0001, "add_offset": -0.1, "dtype": np.dtype("uint16")} - r10m = dt["measurements/reflectance/r10m"].to_dataset().assign(b08=b08) - dt["measurements/reflectance/r10m"] = xr.DataTree(r10m) - r20m_ds = dt["measurements/reflectance/r20m"].to_dataset() - - result = inject_missing_bands( - r20m_ds, - dt, - target_resolution=20, - bands={"b08"}, - spatial_chunk=1024, - scale_offset_codec=scale_offset_codec, - ) - - values = result["b08"].values - if scale_offset_codec: - assert values.dtype == np.float32 - assert values[0, 0] == pytest.approx(0.3) # the nodata pixel is not averaged in - assert np.isnan(values[1, 1]) # a fully nodata block stays nodata - assert np.isnan(values).sum() == 1 - else: - assert values.dtype == np.uint16 - assert result["b08"].attrs["scale_factor"] == pytest.approx(0.0001) - assert result["b08"].attrs["add_offset"] == pytest.approx(-0.1) - assert result["b08"].encoding["_FillValue"] == 0 - assert values[0, 0] == 4000 # (0.3 + 0.1) / 0.0001: nodata is not averaged in - assert values[1, 1] == 0 # a fully nodata block stays nodata - assert (values == 0).sum() == 1 - - -def test_inject_missing_bands_respects_bands_filter() -> None: - """With bands={"b08"}, only b08 should be injected even when others are eligible.""" - dt = _make_reflectance_datatree() - r20m_ds = dt["measurements/reflectance/r20m"].to_dataset() - - result = inject_missing_bands( - r20m_ds, dt, target_resolution=20, bands={"b08"}, spatial_chunk=1024 - ) - - assert "b08" in result.data_vars - assert result["b08"].shape == (60, 60) - assert result["b08"].dtype == np.uint16 - # b02/b03/b04 are also eligible (10m native, missing from r20m) but excluded - for excluded in ("b02", "b03", "b04"): - assert excluded not in result.data_vars - - -def test_inject_missing_bands_skips_existing() -> None: - """Bands already present in the dataset should not be overwritten.""" - dt = _make_reflectance_datatree() - r20m_ds = dt["measurements/reflectance/r20m"].to_dataset() - - # Pre-populate b08 with a sentinel value so we can verify it is NOT replaced. - sentinel = np.full((60, 60), 999, dtype="uint16") - r20m_ds["b08"] = (["y", "x"], sentinel) - - result = inject_missing_bands( - r20m_ds, dt, target_resolution=20, bands={"b08"}, spatial_chunk=1024 - ) - - # b08 was already present — inject_missing_bands must leave it untouched. - np.testing.assert_array_equal(result["b08"].values, sentinel) - - -def test_inject_missing_bands_noop_when_no_source() -> None: - """If the source group is missing from the DataTree, return dataset unchanged.""" - dt = xr.DataTree() - ds = xr.Dataset({"b05": (["y", "x"], np.ones((60, 60)))}) - - result = inject_missing_bands(ds, dt, target_resolution=20, spatial_chunk=1024) - - assert "b08" not in result.data_vars - - -def test_inject_missing_bands_default_injects_all() -> None: - """With bands=None (default), all eligible finer bands should be injected.""" - size_10m = 120 - x10 = np.arange(size_10m, dtype="float64") - y10 = np.arange(size_10m, dtype="float64") - - r10m_ds = xr.Dataset( - { - "b02": (["y", "x"], np.ones((size_10m, size_10m), dtype="uint16")), - "b03": (["y", "x"], np.ones((size_10m, size_10m), dtype="uint16")), - "b04": (["y", "x"], np.ones((size_10m, size_10m), dtype="uint16")), - "b08": (["y", "x"], np.full((size_10m, size_10m), 42, dtype="uint16")), - }, - coords={"x": x10, "y": y10}, - ) - - size_20m = 60 - x20 = np.arange(size_20m, dtype="float64") - y20 = np.arange(size_20m, dtype="float64") - r20m_ds = xr.Dataset( - { - "b05": (["y", "x"], np.ones((size_20m, size_20m), dtype="uint16")), - "b06": (["y", "x"], np.ones((size_20m, size_20m), dtype="uint16")), - }, - coords={"x": x20, "y": y20}, - ) - - size_60m = 20 - x60 = np.arange(size_60m, dtype="float64") - y60 = np.arange(size_60m, dtype="float64") - r60m_ds = xr.Dataset( - { - "b01": (["y", "x"], np.ones((size_60m, size_60m), dtype="uint16")), - }, - coords={"x": x60, "y": y60}, - ) - - dt = xr.DataTree() - dt["measurements/reflectance/r10m"] = xr.DataTree(r10m_ds) - dt["measurements/reflectance/r20m"] = xr.DataTree(r20m_ds) - dt["measurements/reflectance/r60m"] = xr.DataTree(r60m_ds) - - result = inject_missing_bands(r60m_ds, dt, target_resolution=60, spatial_chunk=1024) - - # All 10m bands (b02, b03, b04, b08) and 20m bands (b05, b06) should be injected - for band in ("b02", "b03", "b04", "b08", "b05", "b06"): - assert band in result.data_vars, f"{band} missing from r60m" - assert result[band].shape == (size_60m, size_60m) diff --git a/tests/test_titiler_integration.py b/tests/test_titiler_integration.py index 925e019e..443cd307 100644 --- a/tests/test_titiler_integration.py +++ b/tests/test_titiler_integration.py @@ -27,6 +27,8 @@ from starlette.testclient import TestClient from titiler.xarray.factory import TilerFactory +from eopf_geozarr.s2_optimization.s2_converter import convert_s2_optimized + s2_source_path = pathlib.Path("/tmp/s2_source.zarr") pytestmark = [ @@ -44,8 +46,6 @@ def converted_s2_path() -> pathlib.Path: This fixture is module-scoped so the conversion only runs once for all tests. """ - from eopf_geozarr.s2_optimization.s2_converter import convert_s2 - tmpdir = tempfile.mkdtemp(prefix="titiler_test_") output_path = str(pathlib.Path(tmpdir) / "s2_optimized.zarr") @@ -55,12 +55,10 @@ def converted_s2_path() -> pathlib.Path: chunks="auto", ) - convert_s2( + convert_s2_optimized( dt_input, output_path=output_path, validate_output=False, - enable_sharding=False, - spatial_chunk=512, ) return pathlib.Path(output_path) From 38a969bde13d393ab0e422bf3ccdf3434594f83c Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Mon, 16 Nov 2026 09:00:04 +0100 Subject: [PATCH 41/45] fix(s2-write): refuse unsafe casts, existing outputs and policy deviations before writing Apply the review findings on the plan-driven writer: - The CPM writer checks the Sentinel-2 write policy before it prepares the target, so a refused option no longer removes an existing product. The check is `check_s2_write_policy`, which `convert_s2_optimized` also calls. - The writer refuses input values whose data type does not cast safely to the planned one. zarr casts on assignment, which stored float reflectance as 0 and 1 in the planned uint16 band without an error. - An output location that already holds a different hierarchy raises `FileExistsError` saying to remove it, in place of zarr's `ContainsGroupError`. - The quickstart and examples pages no longer pass `spatial_chunk=256`, which the policy refuses. The CPM writer's docstring, CLI help and options table describe the Sentinel-2 options as fixed. Assisted-by: ClaudeCode:claude-fable-5.2 Co-Authored-By: Claude Fable 5.2 --- docs/cpm-driver.md | 8 +-- docs/examples.md | 3 - docs/quickstart.md | 3 - src/eopf_geozarr/cpm/writer.py | 48 ++++++++++------ src/eopf_geozarr/data_api/s2_write.py | 30 +++++++++- .../s2_optimization/s2_converter.py | 55 +++++++++++++------ tests/test_cpm_writer.py | 18 ++++++ tests/test_data_api/test_s2_write.py | 29 ++++++++++ 8 files changed, 148 insertions(+), 46 deletions(-) diff --git a/docs/cpm-driver.md b/docs/cpm-driver.md index e5c7269a..4b94816f 100644 --- a/docs/cpm-driver.md +++ b/docs/cpm-driver.md @@ -109,10 +109,10 @@ arguments (with `write_datatree`). Unknown options raise `NotImplementedError`. | `s2_optimized` | `None` | `True` forces the Sentinel-2 pipeline, `False` forces the generic pipeline, `None` detects the product. | | `s3_olci_optimized` | `None` | `True` forces the Sentinel-3 OLCI pipeline, `False` falls back to Sentinel-2 or generic detection, `None` detects the product. | | `generic_rechunker` | `None` | `True` sends products other than Sentinel-2 and Sentinel-3 OLCI to the generic rechunker; Sentinel-2 and OLCI products still go to their optimized pipelines, so it cannot be combined with `s2_optimized=False` or `s3_olci_optimized=False`. Only one of `s2_optimized`, `s3_olci_optimized` and `generic_rechunker` may be `True`. | -| `spatial_chunk` | per pipeline | 256 (Sentinel-2), 4096 (generic), 1024 (generic rechunker). Sentinel-3 OLCI: accepted, not applied yet. | -| `enable_sharding` | `False` | Enable Zarr v3 sharding. Sentinel-3 OLCI: accepted, not applied yet. | -| `scale_offset_codec` | `False` | Sentinel-2 and generic rechunker: `True` packs reflectance (or every packed variable) with the Zarr `scale_offset` + `cast_value` codecs. `False` keeps the ESA layout with CF scale attributes. | -| `compression_level` | `3` | Sentinel-2 and generic rechunker: Blosc zstd compression level. Sentinel-3 OLCI: accepted, not applied yet. | +| `spatial_chunk` | per pipeline | 4096 (generic), 1024 (generic rechunker, Sentinel-2). Sentinel-2: fixed by the write policy, so any value other than 1024 is refused. Sentinel-3 OLCI: accepted, not applied yet. | +| `enable_sharding` | `False` | Generic and generic rechunker: enable Zarr v3 sharding. Sentinel-2: the output is always sharded, and the option is not applied. Sentinel-3 OLCI: accepted, not applied yet. | +| `scale_offset_codec` | `False` | Generic rechunker: `True` packs every packed variable with the Zarr `scale_offset` + `cast_value` codecs. `False` keeps the ESA layout with CF scale attributes. Sentinel-2: `True` is refused, because the write policy fixes the ESA layout. | +| `compression_level` | `3` | Generic rechunker: Blosc zstd compression level. Sentinel-2: fixed by the write policy, so any value other than 3 is refused. Sentinel-3 OLCI: accepted, not applied yet. | | `validate_output` | `False` | Sentinel-2: validate the output after writing. | | `output_grid` | `"native"` | Sentinel-3 OLCI: `native` or a CRS string to warp onto. | | `min_dimension` | `256` | Sentinel-3 OLCI and generic: minimum dimension of the coarsest overview level. | diff --git a/docs/examples.md b/docs/examples.md index 7b1ba21d..c5720070 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -106,9 +106,6 @@ dt_input = xr.open_datatree("s2_l2a_input.zarr", engine="zarr", chunks={}) dt = convert_s2_optimized( dt_input, output_path="s2_l2a.zarr", - enable_sharding=True, - spatial_chunk=256, - compression_level=3, validate_output=False, ) diff --git a/docs/quickstart.md b/docs/quickstart.md index 47e8b6c2..de1dde06 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -54,9 +54,6 @@ opens the result. Install eopf-geozarr first (see [Installation](installation.md convert_s2_optimized( dt, output_path="out.zarr", - enable_sharding=True, - spatial_chunk=256, - compression_level=3, validate_output=True, ) ``` diff --git a/src/eopf_geozarr/cpm/writer.py b/src/eopf_geozarr/cpm/writer.py index 5a5e472e..38e4283d 100644 --- a/src/eopf_geozarr/cpm/writer.py +++ b/src/eopf_geozarr/cpm/writer.py @@ -53,7 +53,10 @@ select_pipeline, ) from eopf_geozarr.generic_optimization.generic_converter import create_generic_geozarr_dataset -from eopf_geozarr.s2_optimization.s2_converter import convert_s2_optimized +from eopf_geozarr.s2_optimization.s2_converter import ( + check_s2_write_policy, + convert_s2_optimized, +) from eopf_geozarr.s3_olci_optimization.olci_converter import convert_olci_optimized if TYPE_CHECKING: @@ -161,10 +164,12 @@ def write( pipeline; None auto-detects from the product type. Mutually exclusive with ``s2_optimized=True`` and ``generic_rechunker=True``. spatial_chunk - Spatial chunk size; defaults to 256 (S2 optimized), 1024 (OLCI - optimized), 4096 (generic), or 1024 (generic rechunker). + Spatial chunk size; defaults to 1024 (S2 optimized, OLCI + optimized, generic rechunker) or 4096 (generic). The S2 optimized + pipeline refuses any value other than 1024. enable_sharding - Enable Zarr v3 sharding for spatial dimensions. + Enable Zarr v3 sharding for spatial dimensions. The S2 optimized + pipeline always shards and does not apply this option. max_retries Retries for network operations inside the pipelines. groups @@ -180,13 +185,15 @@ def write( Generic pipeline only: minimum dimension of the coarsest overview level. compression_level - S2 optimized pipeline only: blosc-zstd compression level. + Generic rechunker: blosc-zstd compression level. The S2 optimized + pipeline refuses any value other than 3. scale_offset_codec - S2 optimized pipeline only: pack reflectance with the Zarr - ``scale_offset`` + ``cast_value`` codecs. By default it is written - as in the ESA product: source integers with CF + Generic rechunker: pack every packed variable with the Zarr + ``scale_offset`` + ``cast_value`` codecs. By default data is + written as in the ESA product: source integers with CF ``scale_factor``/``add_offset``/``_FillValue``, and STAC - ``raster:scale``/``raster:offset``/``nodata``. + ``raster:scale``/``raster:offset``/``nodata``. The S2 optimized + pipeline refuses ``True``. keep_scale_offset Deprecated. ``keep_scale_offset=True`` is the default ESA layout; ``keep_scale_offset=False`` selects ``scale_offset_codec=True``. @@ -246,6 +253,17 @@ def write( "DataTree groups to convert (e.g. groups=['/measurements']). Sentinel-1 " "products additionally require 'gcp_group' (e.g. '/conditions/gcp').", ) + if selected_pipeline == "s2-optimized": + # The plan-driven S2 writer has a fixed write policy. It is checked + # here, before the target is prepared, so that a refused option + # leaves an existing product in place. enable_sharding is not + # checked: sharding is fixed on, and this writer's own default + # (False) is indistinguishable from an explicit False. + check_s2_write_policy( + spatial_chunk=resolved_spatial_chunk, + compression_level=compression_level, + scale_offset_codec=scale_offset_codec, + ) output_path = self._prepare_target(filename_or_obj, mode=mode) log.info( "Writing GeoZarr product", @@ -256,12 +274,7 @@ def write( ) if selected_pipeline == "s2-optimized": - # The plan-driven S2 writer has a fixed write policy. The options - # whose explicit deviation is detectable (spatial_chunk, - # compression_level, scale_offset_codec) are forwarded so the - # policy check refuses them loudly; enable_sharding is not, - # because sharding is fixed on and this writer's own default - # (False) is indistinguishable from an explicit False. + # the layout options passed the policy check above return convert_s2_optimized( dt_input=dtree, output_path=output_path, @@ -554,8 +567,9 @@ def get_cli_command() -> click.Command: "--scale-offset-codec", is_flag=True, help=( - "S2 optimized pipeline: pack reflectance with the Zarr scale_offset + cast_value " - "codecs instead of the default ESA layout (CF scale_factor/add_offset/_FillValue)." + "Generic rechunker: pack every packed variable with the Zarr scale_offset + " + "cast_value codecs instead of the default ESA layout (CF " + "scale_factor/add_offset/_FillValue). Refused by the S2 optimized pipeline." ), ) @click.option( diff --git a/src/eopf_geozarr/data_api/s2_write.py b/src/eopf_geozarr/data_api/s2_write.py index 24e19cf4..73566ebe 100644 --- a/src/eopf_geozarr/data_api/s2_write.py +++ b/src/eopf_geozarr/data_api/s2_write.py @@ -33,6 +33,7 @@ import xarray as xr import zarr from pydantic_zarr.v3 import is_group_spec +from zarr.errors import ContainsArrayAndGroupError, ContainsArrayError, ContainsGroupError from eopf_geozarr.conversion.encoding_utils import find_fill_value from eopf_geozarr.data_api.s2_plan import level_meters, plan_geozarr @@ -183,11 +184,34 @@ def write_geozarr( ) plan = plan_geozarr(root, coordinate_values=reader.values) # the metadata plane: every group and array document, exactly as planned - output = plan.to_zarr(store, path="") # type: ignore[arg-type] + try: + output = plan.to_zarr(store, path="") # type: ignore[arg-type] + except (ContainsArrayError, ContainsGroupError, ContainsArrayAndGroupError) as error: + msg = ( + f"The output {store!r} already holds a Zarr hierarchy that differs from " + "the planned one; remove it before converting" + ) + raise FileExistsError(msg) from error _fill_group(plan, reader, output, "") return plan +def _store_values(output: zarr.Group, path: str, values: np.ndarray) -> None: + """ + Store `values` in the planned array at `path`. Refuses values whose data + type does not cast safely to the planned one: zarr casts on assignment, + which would turn, say, float reflectance into the planned uint16 silently. + """ + out_array = _output_array(output, path) + if not np.can_cast(values.dtype, out_array.dtype, casting="safe"): + msg = ( + f"The input values for {path!r} have data type {values.dtype}, which does " + f"not cast safely to the planned data type {out_array.dtype}" + ) + raise ValueError(msg) + out_array[...] = values + + def _fill_group(spec: AnyGroupSpec, source: SourceReader, output: zarr.Group, path: str) -> None: """Fill the data of every array under one planned group (recursively).""" for name, member in spec.members.items(): @@ -212,7 +236,7 @@ def _fill_carried_array(source: SourceReader, output: zarr.Group, path: str) -> if values is None: msg = f"The input source holds no array at {path!r}" raise ValueError(msg) - out_array[...] = values + _store_values(output, path, values) def _fill_pyramid(spec: AnyGroupSpec, source: SourceReader, output: zarr.Group, path: str) -> None: @@ -263,7 +287,7 @@ def _fill_pyramid(spec: AnyGroupSpec, source: SourceReader, output: zarr.Group, native=native, ) for var, values in {**data, **coords}.items(): - _output_array(output, f"{level_path}/{var}")[...] = values + _store_values(output, f"{level_path}/{var}", values) if "spatial_ref" in level_spec.members: _output_array(output, f"{level_path}/spatial_ref")[...] = 0 previous_data, previous_coords, previous_meters = data, coords, meters diff --git a/src/eopf_geozarr/s2_optimization/s2_converter.py b/src/eopf_geozarr/s2_optimization/s2_converter.py index 1fc4e7c2..bcc4164d 100644 --- a/src/eopf_geozarr/s2_optimization/s2_converter.py +++ b/src/eopf_geozarr/s2_optimization/s2_converter.py @@ -146,6 +146,39 @@ def _validate_s2_input(dt_input: xr.DataTree) -> None: ) +def check_s2_write_policy( + *, + enable_sharding: bool = True, + spatial_chunk: int = 1024, + compression_level: int = 3, + scale_offset_codec: bool = False, +) -> None: + """ + Refuse layout options that deviate from the Sentinel-2 write policy. + + The plan-driven writer has one layout, so each option is accepted only at + its policy value. Raises `ValueError` naming every deviating option. + Callers that prepare the output first (and may remove an existing one) + call this before they do. + """ + deviations = [ + name + for name, held in ( + ("enable_sharding=False", not enable_sharding), + (f"spatial_chunk={spatial_chunk}", spatial_chunk != 1024), + (f"compression_level={compression_level}", compression_level != 3), + ("scale_offset_codec=True", scale_offset_codec), + ) + if held + ] + if deviations: + msg = ( + f"The plan-driven S2 writer has a fixed write policy ({_PLAN_POLICY}); " + f"unsupported option(s): {', '.join(deviations)}" + ) + raise ValueError(msg) + + def convert_s2_optimized( dt_input: xr.DataTree, *, @@ -193,22 +226,12 @@ def convert_s2_optimized( output_path=output_path, ) - deviations = [ - name - for name, held in ( - ("enable_sharding=False", not enable_sharding), - (f"spatial_chunk={spatial_chunk}", spatial_chunk != 1024), - (f"compression_level={compression_level}", compression_level != 3), - ("scale_offset_codec=True", scale_offset_codec), - ) - if held - ] - if deviations: - msg = ( - f"The plan-driven S2 writer has a fixed write policy ({_PLAN_POLICY}); " - f"unsupported option(s): {', '.join(deviations)}" - ) - raise ValueError(msg) + check_s2_write_policy( + enable_sharding=enable_sharding, + spatial_chunk=spatial_chunk, + compression_level=compression_level, + scale_offset_codec=scale_offset_codec, + ) _validate_s2_input(dt_input) diff --git a/tests/test_cpm_writer.py b/tests/test_cpm_writer.py index 50c26d9c..085f1d67 100644 --- a/tests/test_cpm_writer.py +++ b/tests/test_cpm_writer.py @@ -110,6 +110,24 @@ def test_write_s2_scale_offset_codec_is_refused(tmp_path: pathlib.Path) -> None: _write_s2(tmp_path, scale_offset_codec=True) +@pytest.mark.parametrize( + "options", + [{"spatial_chunk": 256}, {"compression_level": 5}, {"scale_offset_codec": True}], + ids=lambda options: next(iter(options)), +) +def test_write_s2_refused_option_leaves_an_existing_target( + tmp_path: pathlib.Path, options: dict[str, Any] +) -> None: + """A layout option the S2 write policy refuses is refused before the + writer replaces an existing target.""" + target = tmp_path / "output.zarr" + target.mkdir() + (target / "marker").write_text("kept") + with pytest.raises(ValueError, match="fixed write policy"): + _write_s2(tmp_path, **options) + assert (target / "marker").read_text() == "kept" + + def test_write_s2_keep_scale_offset_is_deprecated(tmp_path: pathlib.Path) -> None: """`keep_scale_offset=False` still maps to `scale_offset_codec=True` with a deprecation warning, which the S2 write policy then refuses.""" diff --git a/tests/test_data_api/test_s2_write.py b/tests/test_data_api/test_s2_write.py index c15ed041..57d9dd73 100644 --- a/tests/test_data_api/test_s2_write.py +++ b/tests/test_data_api/test_s2_write.py @@ -284,6 +284,35 @@ def test_write_geozarr_refuses_a_source_missing_the_planned_arrays( write_geozarr(root, empty_source, str(tmp_path / "out.zarr")) +def test_write_geozarr_refuses_values_that_do_not_cast_safely(tmp_path: pathlib.Path) -> None: + """A band whose input data type does not cast safely to the planned one + (float32 reflectance, planned as uint16) is refused, not cast silently.""" + document = json.loads(_L2A_PATH.read_text()) + reflectance = document["members"]["measurements"]["members"]["reflectance"] + reflectance["members"]["r10m"]["members"]["b02"]["dtype"] = " None: + """An output location that already holds a different hierarchy is refused + with an error that says to remove it.""" + input_path = create_zarrv2_group_from_json(_L2A_PATH, tmp_path) + _seed_input_store(zarr.open_group(input_path, mode="r+", zarr_format=2)) + source = zarr.open_group(input_path, mode="r", zarr_format=2) + output_path = tmp_path / "out.zarr" + zarr.create_group(output_path, attributes={"written": "before"}) + with pytest.raises(FileExistsError, match="remove it before converting"): + write_geozarr(load_sentinel2(source), source, str(output_path)) + + def _store_contents(path: pathlib.Path) -> dict[str, object]: """Every file of a store: metadata documents as parsed JSON (their key order is not semantic), chunk files as content digests.""" From 93ef8f7dbbedfe8008188aaa1d9326c8140c9992 Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Mon, 16 Nov 2026 17:36:39 +0100 Subject: [PATCH 42/45] fix(deps)!: support pydantic-zarr 0.12 and remove the pyz wrapper pydantic-zarr 0.12.0 removes from_zarr/to_zarr and makes GroupSpec's second type parameter the whole members mapping. eopf-geozarr 0.13.1 requires pydantic-zarr>=0.8.0 with no upper bound, so a fresh install gets 0.12.0, and Sentinel-2 detection and validate_store raise AttributeError: from_zarr. - Require pydantic-zarr>=0.12.0,<0.13. The cap is deliberate: pydantic-zarr breaks its API in minor releases before 1.0. - Remove eopf_geozarr.pyz. The product models use pydantic_zarr.v2/v3 directly; pyz's GroupSpec existed to take a members TypedDict, which pydantic-zarr's GroupSpec now does. Its ArraySpec subclassed ArraySpecV2[Any], so ArraySpec[X] never enforced X: attribute types are enforced now, and the OLCI models declare Mapping[str, object] where they declared object. - Write the GeoZarr groups' members as Mapping[str, Item] where 0.11 took the item type. - Add eopf_geozarr.zarr_io: read_documents reads a node's stored metadata documents for from_stored_metadata_json, leaving out consolidated metadata, and write_hierarchy writes a spec's documents with zarr.create_hierarchy. Every from_zarr/to_zarr call moves onto them. BREAKING CHANGE: eopf_geozarr.pyz is removed; import GroupSpec and ArraySpec from pydantic_zarr.v2 or pydantic_zarr.v3. ArraySpec[X] in the product models now validates attributes against X. Assisted-by: ClaudeCode:claude-opus-5.5 Co-Authored-By: Claude Opus 5.5 --- docs/architecture.md | 1 - pyproject.toml | 4 +- src/eopf_geozarr/data_api/geozarr/store.py | 2 +- src/eopf_geozarr/data_api/geozarr/v2.py | 9 +- src/eopf_geozarr/data_api/geozarr/v3.py | 11 +- .../data_api/geozarr/validation.py | 7 +- src/eopf_geozarr/data_api/s1.py | 5 +- src/eopf_geozarr/data_api/s1_rtc.py | 6 +- src/eopf_geozarr/data_api/s2.py | 5 +- src/eopf_geozarr/data_api/s3_olci.py | 60 +-- src/eopf_geozarr/pyz/__init__.py | 4 - src/eopf_geozarr/pyz/common.py | 466 ------------------ src/eopf_geozarr/pyz/v2.py | 75 --- src/eopf_geozarr/pyz/v3.py | 75 --- .../s2_optimization/s2_converter.py | 8 +- .../s3_olci_optimization/olci_converter.py | 7 +- src/eopf_geozarr/zarr_io.py | 94 ++++ .../_test_data/s1_grdh_examples/regenerate.py | 6 +- .../_test_data/s1_rtc_examples/regenerate.py | 3 +- tests/conftest.py | 15 +- tests/test_data_api/test_s1.py | 2 +- tests/test_data_api/test_s1_rtc.py | 9 +- tests/test_data_api/test_s3_olci.py | 11 +- tests/test_data_api/test_v2.py | 4 +- tests/test_data_api/test_v3.py | 11 +- tests/test_olci_integration.py | 17 +- tests/test_s2_multiscale.py | 10 +- tests/test_zarr_io.py | 85 ++++ uv.lock | 25 +- 29 files changed, 316 insertions(+), 721 deletions(-) delete mode 100644 src/eopf_geozarr/pyz/__init__.py delete mode 100644 src/eopf_geozarr/pyz/common.py delete mode 100644 src/eopf_geozarr/pyz/v2.py delete mode 100644 src/eopf_geozarr/pyz/v3.py create mode 100644 src/eopf_geozarr/zarr_io.py create mode 100644 tests/test_zarr_io.py diff --git a/docs/architecture.md b/docs/architecture.md index 00a06a4c..185986ef 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -54,7 +54,6 @@ graph LR | `conversion/` | Generic pipeline (`geozarr.py`), Sentinel-1 GRD RTC ingestion (`s1_ingest.py`), Sentinel-1 reprojection, source opening, storage and metadata utilities. | | `stac/` | STAC item builders (Sentinel-1 GRD RTC). | | `data_api/` | pydantic-zarr models of the EOPF products and of GeoZarr, and the mini spec validator (`data_api/geozarr/validation.py`). | -| `pyz/` | pydantic-zarr helpers used by the models. | | `codecs/` | Helpers for the Zarr `scale_offset` codec. | ## Core Components diff --git a/pyproject.toml b/pyproject.toml index b3cfd37b..c064a9ca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,7 +44,9 @@ classifiers = [ ] requires-python = ">=3.12" dependencies = [ - "pydantic-zarr>=0.8.0", + # pydantic-zarr makes breaking changes in minor releases before 1.0 (0.12 removed + # from_zarr/to_zarr, which broke eopf-geozarr 0.13.1), so cap at the next minor. + "pydantic-zarr>=0.12.0,<0.13", "pydantic>=2.14.1", # <3.3.0: open_source_datatree uses zarr's experimental CacheStore, whose # location/API may change between minor releases; bump deliberately. diff --git a/src/eopf_geozarr/data_api/geozarr/store.py b/src/eopf_geozarr/data_api/geozarr/store.py index ddb5b3b6..5c5ca4ba 100644 --- a/src/eopf_geozarr/data_api/geozarr/store.py +++ b/src/eopf_geozarr/data_api/geozarr/store.py @@ -202,7 +202,7 @@ def validate_conventions_declared(self) -> Self: GeoZarrMember = GroupSpec[Any, Any] | ArraySpec -class GeoZarr(GroupSpec[GeoZarrStoreAttrs, GeoZarrMember]): +class GeoZarr(GroupSpec[GeoZarrStoreAttrs, Mapping[str, GeoZarrMember]]): """A GeoZarr store. Pairs the required store-root attributes with arbitrary Zarr children. diff --git a/src/eopf_geozarr/data_api/geozarr/v2.py b/src/eopf_geozarr/data_api/geozarr/v2.py index 772f13d0..074a1772 100644 --- a/src/eopf_geozarr/data_api/geozarr/v2.py +++ b/src/eopf_geozarr/data_api/geozarr/v2.py @@ -2,6 +2,7 @@ from __future__ import annotations +from collections.abc import Mapping from typing import TYPE_CHECKING, Any, Literal, Self, cast from pydantic import ConfigDict, Field, model_validator @@ -20,7 +21,7 @@ from eopf_geozarr.data_api.geozarr.types import XARRAY_DIMS_KEY if TYPE_CHECKING: - from collections.abc import Iterable, Mapping + from collections.abc import Iterable from pydantic.experimental.missing_sentinel import MISSING as MISSING @@ -116,7 +117,7 @@ class GridMappingVariable(ArraySpec[GridMappingAttrs]): """ -class Dataset(GroupSpec[DatasetAttrs, DataArray | GridMappingVariable]): +class Dataset(GroupSpec[DatasetAttrs, Mapping[str, DataArray | GridMappingVariable]]): """ A GeoZarr Dataset. """ @@ -147,7 +148,9 @@ def check_grid_mapping(self) -> Self: return self -class MultiscaleGroup(GroupSpec[MultiscaleGroupAttrs, DataArray | GroupSpec[Any, Any]]): +class MultiscaleGroup( + GroupSpec[MultiscaleGroupAttrs, Mapping[str, DataArray | GroupSpec[Any, Any]]] +): """ A GeoZarr Multiscale Group. """ diff --git a/src/eopf_geozarr/data_api/geozarr/v3.py b/src/eopf_geozarr/data_api/geozarr/v3.py index ee2a487c..c5665250 100644 --- a/src/eopf_geozarr/data_api/geozarr/v3.py +++ b/src/eopf_geozarr/data_api/geozarr/v3.py @@ -2,10 +2,11 @@ from __future__ import annotations -from typing import Any, Self, cast +from collections.abc import Mapping +from typing import Self, cast from pydantic import model_validator -from pydantic_zarr.v3 import ArraySpec, GroupSpec +from pydantic_zarr.v3 import AnyGroupSpec, ArraySpec, GroupSpec from eopf_geozarr.data_api.geozarr.common import ( BaseDataArrayAttrs, @@ -40,7 +41,7 @@ def array_dimensions(self) -> tuple[str, ...]: return self.dimension_names -class Dataset(GroupSpec[DatasetAttrs, GroupSpec[Any, Any] | DataArray]): +class Dataset(GroupSpec[DatasetAttrs, Mapping[str, AnyGroupSpec | DataArray]]): """ A GeoZarr Dataset. """ @@ -55,7 +56,7 @@ def check_valid_coordinates(self) -> Self: Returns ------- - GroupSpec[Any, Any] + AnyGroupSpec The validated GeoZarr DataSet. """ # ``self`` structurally satisfies the ``GroupLike`` protocol, but mypy cannot bind the @@ -71,7 +72,7 @@ def validate_grid_mapping(self) -> Self: return self -class MultiscaleGroup(GroupSpec[MultiscaleGroupAttrs, DataArray | GroupSpec[Any, Any]]): +class MultiscaleGroup(GroupSpec[MultiscaleGroupAttrs, Mapping[str, DataArray | AnyGroupSpec]]): """ A GeoZarr Multiscale Group. """ diff --git a/src/eopf_geozarr/data_api/geozarr/validation.py b/src/eopf_geozarr/data_api/geozarr/validation.py index 88766a52..0aacbc4f 100644 --- a/src/eopf_geozarr/data_api/geozarr/validation.py +++ b/src/eopf_geozarr/data_api/geozarr/validation.py @@ -19,8 +19,8 @@ ``dimension_names``) and every data-variable dimension must have a matching 1-D coordinate array; 0-D CF grid-mapping container arrays are tolerated. -The validation snapshot is taken with :meth:`pydantic_zarr.v3.GroupSpec.from_zarr`, -so all checks run on metadata only — no chunk data is read. +The validation snapshot is the store's metadata documents, read with +:func:`eopf_geozarr.zarr_io.read_documents`, so all checks run on metadata only — no chunk data is read. """ from __future__ import annotations @@ -42,6 +42,7 @@ GeoZarrStoreAttrs, declared_convention_uuids, ) +from eopf_geozarr.zarr_io import read_documents if TYPE_CHECKING: from collections.abc import Iterator @@ -420,7 +421,7 @@ def validate_store( ) return ValidationReport(issues=issues, roles={"/": ["store-root"]}) - spec = GroupSpec.from_zarr(root) + spec = GroupSpec.from_stored_metadata_json(read_documents(root)) for path, node, inherited in _walk(spec, "/"): attrs = dict(node.attributes or {}) diff --git a/src/eopf_geozarr/data_api/s1.py b/src/eopf_geozarr/data_api/s1.py index 00f0bed5..4eb6d49d 100644 --- a/src/eopf_geozarr/data_api/s1.py +++ b/src/eopf_geozarr/data_api/s1.py @@ -1,7 +1,7 @@ """ Pydantic-zarr integrated models for Sentinel-1A EOPF Zarr data structure. -Uses the new pyz.GroupSpec with TypedDict members to enforce strict structure validation. +Uses pydantic-zarr's GroupSpec with TypedDict members to enforce strict structure validation. """ from __future__ import annotations @@ -15,12 +15,13 @@ if TYPE_CHECKING: from pydantic.experimental.missing_sentinel import MISSING as MISSING +from pydantic_zarr.v2 import ArraySpec, GroupSpec + from eopf_geozarr.data_api.geozarr.common import ( BaseDataArrayAttrs, CFStandardName, DatasetAttrs, ) -from eopf_geozarr.pyz.v2 import ArraySpec, GroupSpec # Member type for groups with any nested structures (groups or arrays) # Used for groups with dynamic or variable nested structures diff --git a/src/eopf_geozarr/data_api/s1_rtc.py b/src/eopf_geozarr/data_api/s1_rtc.py index 41e7aa5c..e20c8ca3 100644 --- a/src/eopf_geozarr/data_api/s1_rtc.py +++ b/src/eopf_geozarr/data_api/s1_rtc.py @@ -1,8 +1,8 @@ """ Pydantic-zarr integrated models for Sentinel-1 GRD gamma0T RTC GeoZarr stores. -Uses the pyz.v3 GroupSpec/ArraySpec with TypedDict members to enforce strict -structure validation — same pattern as s2.py (which uses pyz.v2 for Zarr V2). +Uses pydantic-zarr's v3 GroupSpec/ArraySpec with TypedDict members to enforce strict +structure validation — same pattern as s2.py (which uses the v2 models for Zarr V2). These models validate time-series Zarr V3 stores built from S1Tiling GeoTIFFs on the Sentinel-2 MGRS grid. This is a *different data product* from the EOPF @@ -38,6 +38,7 @@ from typing import TYPE_CHECKING, Any, Literal, Self from pydantic import BaseModel, Field, model_validator +from pydantic_zarr.v3 import ArraySpec, GroupSpec from typing_extensions import TypedDict from zarr_cm import geo_proj from zarr_cm import multiscales as multiscales_cm @@ -45,7 +46,6 @@ from eopf_geozarr.data_api.geozarr.common import DatasetAttrs from eopf_geozarr.data_api.geozarr.multiscales.zcm import Multiscales -from eopf_geozarr.pyz.v3 import ArraySpec, GroupSpec if TYPE_CHECKING: from collections.abc import Mapping diff --git a/src/eopf_geozarr/data_api/s2.py b/src/eopf_geozarr/data_api/s2.py index c86c48a7..bc4bbf5d 100644 --- a/src/eopf_geozarr/data_api/s2.py +++ b/src/eopf_geozarr/data_api/s2.py @@ -1,7 +1,7 @@ """ Pydantic-zarr integrated models for Sentinel-2 EOPF Zarr data structure. -Uses the new pyz.GroupSpec with TypedDict members to enforce strict structure validation. +Uses pydantic-zarr's GroupSpec with TypedDict members to enforce strict structure validation. """ from __future__ import annotations @@ -14,12 +14,13 @@ if TYPE_CHECKING: from pydantic.experimental.missing_sentinel import MISSING as MISSING +from pydantic_zarr.v2 import ArraySpec, GroupSpec + from eopf_geozarr.data_api.geozarr.common import ( BaseDataArrayAttrs, CFStandardName, DatasetAttrs, ) -from eopf_geozarr.pyz.v2 import ArraySpec, GroupSpec from eopf_geozarr.s2_optimization.s2_band_mapping import BAND_INFO # ============================================================================ diff --git a/src/eopf_geozarr/data_api/s3_olci.py b/src/eopf_geozarr/data_api/s3_olci.py index 7b55f8f0..e4f12254 100644 --- a/src/eopf_geozarr/data_api/s3_olci.py +++ b/src/eopf_geozarr/data_api/s3_olci.py @@ -9,10 +9,10 @@ from collections.abc import Mapping # noqa: TC003 from pydantic import BaseModel +from pydantic_zarr.v2 import ArraySpec, GroupSpec from typing_extensions import TypedDict from eopf_geozarr.data_api.geozarr.common import DatasetAttrs -from eopf_geozarr.pyz.v2 import ArraySpec, GroupSpec class Sentinel3OlciRootAttrs(BaseModel): @@ -30,32 +30,32 @@ class Sentinel3OlciMeasurementsMembers(TypedDict, closed=True, total=False): validate; the converter checks for the bands it needs. """ - latitude: ArraySpec[object] - longitude: ArraySpec[object] - altitude: ArraySpec[object] - time_stamp: ArraySpec[object] - orphans: GroupSpec[Mapping[str, object], Mapping[str, ArraySpec[object]]] - oa01_radiance: ArraySpec[object] - oa02_radiance: ArraySpec[object] - oa03_radiance: ArraySpec[object] - oa04_radiance: ArraySpec[object] - oa05_radiance: ArraySpec[object] - oa06_radiance: ArraySpec[object] - oa07_radiance: ArraySpec[object] - oa08_radiance: ArraySpec[object] - oa09_radiance: ArraySpec[object] - oa10_radiance: ArraySpec[object] - oa11_radiance: ArraySpec[object] - oa12_radiance: ArraySpec[object] - oa13_radiance: ArraySpec[object] - oa14_radiance: ArraySpec[object] - oa15_radiance: ArraySpec[object] - oa16_radiance: ArraySpec[object] - oa17_radiance: ArraySpec[object] - oa18_radiance: ArraySpec[object] - oa19_radiance: ArraySpec[object] - oa20_radiance: ArraySpec[object] - oa21_radiance: ArraySpec[object] + latitude: ArraySpec[Mapping[str, object]] + longitude: ArraySpec[Mapping[str, object]] + altitude: ArraySpec[Mapping[str, object]] + time_stamp: ArraySpec[Mapping[str, object]] + orphans: GroupSpec[Mapping[str, object], Mapping[str, ArraySpec[Mapping[str, object]]]] + oa01_radiance: ArraySpec[Mapping[str, object]] + oa02_radiance: ArraySpec[Mapping[str, object]] + oa03_radiance: ArraySpec[Mapping[str, object]] + oa04_radiance: ArraySpec[Mapping[str, object]] + oa05_radiance: ArraySpec[Mapping[str, object]] + oa06_radiance: ArraySpec[Mapping[str, object]] + oa07_radiance: ArraySpec[Mapping[str, object]] + oa08_radiance: ArraySpec[Mapping[str, object]] + oa09_radiance: ArraySpec[Mapping[str, object]] + oa10_radiance: ArraySpec[Mapping[str, object]] + oa11_radiance: ArraySpec[Mapping[str, object]] + oa12_radiance: ArraySpec[Mapping[str, object]] + oa13_radiance: ArraySpec[Mapping[str, object]] + oa14_radiance: ArraySpec[Mapping[str, object]] + oa15_radiance: ArraySpec[Mapping[str, object]] + oa16_radiance: ArraySpec[Mapping[str, object]] + oa17_radiance: ArraySpec[Mapping[str, object]] + oa18_radiance: ArraySpec[Mapping[str, object]] + oa19_radiance: ArraySpec[Mapping[str, object]] + oa20_radiance: ArraySpec[Mapping[str, object]] + oa21_radiance: ArraySpec[Mapping[str, object]] class Sentinel3OlciMeasurementsGroup(GroupSpec[DatasetAttrs, Sentinel3OlciMeasurementsMembers]): @@ -70,14 +70,16 @@ class Sentinel3OlciRootMembers(TypedDict, closed=True, total=False): Mapping[str, object], Mapping[ str, - GroupSpec[Mapping[str, object], Mapping[str, ArraySpec[object]]] | ArraySpec[object], + GroupSpec[Mapping[str, object], Mapping[str, ArraySpec[Mapping[str, object]]]] + | ArraySpec[Mapping[str, object]], ], ] conditions: GroupSpec[ Mapping[str, object], Mapping[ str, - GroupSpec[Mapping[str, object], Mapping[str, ArraySpec[object]]] | ArraySpec[object], + GroupSpec[Mapping[str, object], Mapping[str, ArraySpec[Mapping[str, object]]]] + | ArraySpec[Mapping[str, object]], ], ] diff --git a/src/eopf_geozarr/pyz/__init__.py b/src/eopf_geozarr/pyz/__init__.py deleted file mode 100644 index b20434ff..00000000 --- a/src/eopf_geozarr/pyz/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -""" -Pydantic Zarr utilities specific to EOPF-Explorer. Some of this functionality may be added to -pydantic-zarr in the future, in which case this code can be replaced with that functionality -""" diff --git a/src/eopf_geozarr/pyz/common.py b/src/eopf_geozarr/pyz/common.py deleted file mode 100644 index fd21b00f..00000000 --- a/src/eopf_geozarr/pyz/common.py +++ /dev/null @@ -1,466 +0,0 @@ -from collections.abc import Mapping -from html import escape -from typing import Any - -from pydantic import BaseModel - -type TBaseAttr = Mapping[str, object] | BaseModel - - -def get_member_names(members: Any) -> list[str]: - """Get list of member names from members dict/mapping.""" - if members is None: - return [] - if isinstance(members, Mapping): - return list(members.keys()) - return [] - - -def format_text_repr(class_name: str, member_names: list[str], max_members: int = 5) -> str: - """Format a condensed text representation of a GroupSpec. - - Args: - class_name: Name of the GroupSpec class - member_names: List of member names - max_members: Maximum number of members to display before truncating - - Returns: - Formatted text representation - """ - if not member_names: - members_str = "(empty)" - elif len(member_names) <= max_members: - members_str = ", ".join(member_names) - else: - displayed = ", ".join(member_names[:max_members]) - remaining = len(member_names) - max_members - members_str = f"{displayed}, +{remaining} more" - - return f"{class_name}(members={{{members_str}}})" - - -def _get_array_info(arr: Any) -> str: - """Get concise info about an array or ArraySpec.""" - # ArraySpec objects (from pydantic-zarr) have shape and either dtype or data_type - if hasattr(arr, "shape"): - shape_tuple = str(arr.shape) # e.g., "(100, 200)" - - # Try to get dtype first (V2 or real arrays) - dtype = getattr(arr, "dtype", None) - if dtype is None: - # Try data_type (V3 ArraySpec) - dtype = getattr(arr, "data_type", None) - - if dtype is None: - return f"Array{shape_tuple}" - return f"Array{shape_tuple} dtype={dtype}" - - return type(arr).__name__ - - -def _format_array_html(arr: Any) -> str: - """Format an array/ArraySpec as HTML with expandable metadata and attributes. - - Shows all array properties in key-value format with attributes as an expandable section. - """ - if not hasattr(arr, "shape"): - return f"
{type(arr).__name__}
" - - class_name = type(arr).__name__ - html_parts = [ - "
", - f"
{class_name}
", - ] - - # Build metadata dict for display - include all available properties - metadata = {} - - # Define the order of properties to display (most important first) - property_names = [ - "zarr_format", - "shape", - "dtype", - "data_type", - "chunks", - "order", - "dimension_separator", - "fill_value", - "compressor", - "filters", - ] - - for prop_name in property_names: - value = getattr(arr, prop_name, None) - - # Skip None/empty values - if value is None: - continue - - # Handle dtype specially - may come from dtype or data_type - if prop_name == "dtype": - if value is None: - value = getattr(arr, "data_type", None) - if value is None: - continue - dtype_str = str(value).strip() - value_str = dtype_str or "(not set)" - # Skip data_type if we already handled it via dtype - elif prop_name == "data_type": - if getattr(arr, "dtype", None) is not None: - continue - if value is None: - continue - value_str = str(value).strip() - if not value_str: - continue - # Skip empty/None filters and compressor - elif prop_name in ("filters", "compressor"): - if value is None: - continue - value_str = str(value) - else: - # For all other properties, show them - value_str = repr(value) if prop_name == "fill_value" else str(value) - - if "value_str" in locals(): - metadata[prop_name] = value_str - del value_str - - # Display metadata in key-value format - for key, value in metadata.items(): - escaped_value = escape(str(value)) - html_parts.append( - f"
• {key}: {escaped_value}
" - ) - - # Get attributes if available - attributes = getattr(arr, "attributes", None) - - # Show attributes if present and non-empty - # Handle both dict and Pydantic BaseModel - if attributes: - is_dict_attrs = isinstance(attributes, dict) and len(attributes) > 0 - is_model_attrs = isinstance(attributes, BaseModel) - - if is_dict_attrs or is_model_attrs: - html_parts.append( - "
" - "attributes" - "
" - ) - - # Get items based on type. Use direct isinstance checks (not the - # boolean flags) so the type checker narrows `attributes`. - if isinstance(attributes, dict): - items = list(attributes.items()) - else: - items = list(attributes.model_dump().items()) - - for key, value in items: - if isinstance(value, dict): - # Render dicts as expandable - value_summary = escape(_format_value_repr(value)) - html_parts.append( - f"
" - f"{key}: {value_summary}" - ) - html_parts.append(_render_dict_html(value)) - html_parts.append("
") - elif isinstance(value, list): - # Render lists as expandable - list_summary = f"list[{len(value)}]" - html_parts.append( - f"
" - f"{key}: {list_summary}" - ) - html_parts.append(_render_list_html(value)) - html_parts.append("
") - else: - value_repr = escape(repr(value)) - html_parts.append( - f"
• {key}: {value_repr}
" - ) - - html_parts.extend( - [ - "
", - "
", - ] - ) - - html_parts.append("
") - - return "".join(html_parts) - - -def _get_attributes_repr(attributes: Any) -> str: - """Get a useful repr for attributes object.""" - if attributes is None: - return "(no attributes)" - - if isinstance(attributes, BaseModel): - # For Pydantic models, show the model dump - fields = attributes.model_fields_set if hasattr(attributes, "model_fields_set") else set() - if fields: - return f"{type(attributes).__name__}({', '.join(sorted(fields))})" - return f"{type(attributes).__name__}()" - - if isinstance(attributes, Mapping): - keys = list(attributes.keys())[:5] - if len(keys) < len(attributes): - keys_str = ", ".join(keys) + f", +{len(attributes) - len(keys)} more" - else: - keys_str = ", ".join(keys) - return f"{{{keys_str}}}" - - return type(attributes).__name__ - - -def _format_value_repr(value: Any) -> str: - """Format a value for display in HTML repr (summary only). - - Returns a brief representation - dict keys, list length, or scalar value. - """ - if isinstance(value, dict): - keys = list(value.keys())[:3] - if len(keys) < len(value): - keys_str = ", ".join(keys) + f", +{len(value) - len(keys)} more" - else: - keys_str = ", ".join(keys) - return f"{{{keys_str}}}" - if isinstance(value, list): - return f"list[{len(value)}]" - return repr(value) - - -def _render_list_html(lst: list[Any]) -> str: - """Render a list as HTML with expandable items.""" - if not lst: - return "" - - html_parts = ["
"] - - items = lst[:15] # Show up to 15 items - for i, item in enumerate(items): - if isinstance(item, dict): - # Render nested dicts as expandable - dict_summary = _format_value_repr(item) - escaped_summary = escape(dict_summary) - html_parts.append( - f"
" - f"[{i}]: {escaped_summary}" - ) - html_parts.append(_render_dict_html(item)) - html_parts.append("
") - elif isinstance(item, list): - # Render nested lists as expandable - list_summary = f"list[{len(item)}]" - html_parts.append( - f"
" - f"[{i}]: {list_summary}" - ) - html_parts.append(_render_list_html(item)) - html_parts.append("
") - else: - item_repr = escape(repr(item)) - html_parts.append( - f"
• [{i}]: {item_repr}
" - ) - - if len(lst) > 15: - remaining = len(lst) - 15 - html_parts.append(f"
+{remaining} more items
") - - html_parts.append("
") - return "".join(html_parts) - - -def _render_dict_html(d: dict[str, Any], indent: int = 0) -> str: - """Render a dictionary as HTML with expandable key-value pairs.""" - if not d: - return "" - - html_parts = ["
"] - - items = list(d.items())[:15] # Show up to 15 items - for key, value in items: - if isinstance(value, dict): - # Render nested dicts as expandable - value_summary = _format_value_repr(value) - escaped_summary = escape(value_summary) - html_parts.append( - f"
" - f"{key}: {escaped_summary}" - ) - html_parts.append(_render_dict_html(value, indent + 1)) - html_parts.append("
") - elif isinstance(value, list): - # Render lists as expandable - list_summary = f"list[{len(value)}]" - html_parts.append( - f"
" - f"{key}: {list_summary}" - ) - html_parts.append(_render_list_html(value)) - html_parts.append("
") - else: - value_repr = escape(repr(value)) - html_parts.append( - f"
• {key}: {value_repr}
" - ) - - if len(d) > 15: - remaining = len(d) - 15 - html_parts.append(f"
+{remaining} more items
") - - html_parts.append("
") - return "".join(html_parts) - - -def format_html_repr( - class_name: str, - member_names: list[str], - members_dict: dict[str, Any] | None = None, - attributes: Any = None, - indent_level: int = 0, -) -> str: - """Format an HTML tree representation of a GroupSpec for Jupyter/IPython. - - Args: - class_name: Name of the GroupSpec class - member_names: List of member names - members_dict: Optional dict of actual member objects for recursive repr - attributes: Optional attributes object to display - indent_level: Current indentation level for recursion - - Returns: - HTML string with collapsible tree structure - """ - indent = indent_level * 20 - - html_parts = [ - f"
", - "
", - f"{class_name}", - "
", - ] - - # Show attributes section if present - if attributes is not None: - attrs_repr = _get_attributes_repr(attributes) - html_parts.append( - "
" - "attributes: " - + attrs_repr - + "" - "
" - ) - - if isinstance(attributes, Mapping): - attrs_list = list(attributes.keys())[:10] - for attr_name in attrs_list: - attr_value = attributes[attr_name] - value_repr = escape(_format_value_repr(attr_value)) - html_parts.append( - f"
• {attr_name}: {value_repr}
" - ) - if len(attributes) > 10: - remaining = len(attributes) - 10 - html_parts.append(f"
+{remaining} more attributes
") - elif isinstance(attributes, BaseModel): - # Show Pydantic model fields with values using model_dump - attrs_dict = attributes.model_dump() - attrs_items = list(attrs_dict.items())[:10] - for field_name, field_value in attrs_items: - if isinstance(field_value, dict): - # Render dicts as expandable sections - value_summary = escape(_format_value_repr(field_value)) - html_parts.append( - f"
" - f"{field_name}: {value_summary}" - ) - html_parts.append(_render_dict_html(field_value)) - html_parts.append("
") - elif isinstance(field_value, list): - # Render lists as expandable sections - list_summary = f"list[{len(field_value)}]" - html_parts.append( - f"
" - f"{field_name}: {list_summary}" - ) - html_parts.append(_render_list_html(field_value)) - html_parts.append("
") - else: - value_repr = escape(_format_value_repr(field_value)) - html_parts.append( - f"
• {field_name}: {value_repr}
" - ) - if len(attrs_dict) > 10: - remaining = len(attrs_dict) - 10 - html_parts.append(f"
+{remaining} more fields
") - else: - html_parts.append(f"
{type(attributes).__name__}
") - - html_parts.extend( - [ - "
", - "
", - ] - ) - - # Show members section - if not member_names: - html_parts.append("
(no members)
") - else: - html_parts.append( - "
" - "members" - "
" - ) - - for member_name in member_names: - member_obj = None - if members_dict and member_name in members_dict: - member_obj = members_dict[member_name] - - # Check if member is a GroupSpec (has _repr_html_ method) - if member_obj is not None and hasattr(member_obj, "_repr_html_"): - # Recursively render nested group - html_parts.append(f"
{member_name}:
") - # Add indented nested repr - nested_html = member_obj._repr_html_() - # Wrap nested content with proper indentation - html_parts.append(f"
{nested_html}
") - else: - # Render as simple item - arrays get detailed html, others get simple text - if member_obj is not None: - if hasattr(member_obj, "shape"): - # It's an array or ArraySpec - use detailed HTML repr - html_parts.append( - f"
{member_name}:
" - ) - array_html = _format_array_html(member_obj) - html_parts.append(f"
{array_html}
") - else: - # Unknown object - show type name - member_info = _get_array_info(member_obj) - html_parts.append(f"
• {member_name}: {member_info}
") - else: - html_parts.append(f"
• {member_name}: Unknown
") - - html_parts.extend( - [ - "
", - "
", - ] - ) - - html_parts.extend( - [ - "
", - "
", - "
", - ] - ) - - return "".join(html_parts) diff --git a/src/eopf_geozarr/pyz/v2.py b/src/eopf_geozarr/pyz/v2.py deleted file mode 100644 index 52605eb1..00000000 --- a/src/eopf_geozarr/pyz/v2.py +++ /dev/null @@ -1,75 +0,0 @@ -""" -Zarr V2 models - -The generic type parameter TMembers allows the use of typeddicts to more explicitly model -the key structure of the members of a zarr group: - -```python -from typing import TypedDict - -class MyMembers(TypedDict, closed=True): - a: GroupSpec[Any, Any] - b: GroupSpec[Any, Any] - -# this class will enforce that the members have keys "a" and "b" -class MyGroup(GroupSpec[Any, MyMembers]) - ... -``` -""" - -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeAlias, TypeVar, Union - -from pydantic_zarr.v2 import ArraySpec as ArraySpecV2 -from pydantic_zarr.v2 import GroupSpec as GroupSpecV2 - -from eopf_geozarr.pyz.common import ( - TBaseAttr, - _format_array_html, - format_html_repr, - format_text_repr, - get_member_names, -) - -TBaseMember: TypeAlias = Mapping[str, Union["GroupSpec[Any, Any]", "ArraySpec[Any]"]] # noqa: UP040 - -TAttr = TypeVar("TAttr", bound=TBaseAttr) -TMembers = TypeVar("TMembers", bound=TBaseMember) -TArraySpecType = TypeVar("TArraySpecType") - - -class GroupSpec(GroupSpecV2[TAttr, TMembers]): # type: ignore[type-var] - # TMembers is bound to the full members mapping (e.g. a TypedDict) by design, - # whereas the parent's second type parameter expects a single member item type. - attributes: TAttr - # members holds the full mapping (TMembers) rather than the parent's - # Mapping[str, TItem] | None; this is the intended structure for this subclass. - members: TMembers # type: ignore[assignment] - - def __repr__(self) -> str: - """Return a condensed text representation of the GroupSpec.""" - class_name = self.__class__.__name__ - member_names = get_member_names(self.members) - return format_text_repr(class_name, member_names) - - def _repr_html_(self) -> str: - """Return an HTML representation for Jupyter/IPython.""" - class_name = self.__class__.__name__ - member_names = get_member_names(self.members) - members_dict = dict(self.members.items()) if self.members else None - return format_html_repr( - class_name, - member_names, - members_dict=members_dict, - attributes=self.attributes, - ) - - -class ArraySpec[TArraySpecType](ArraySpecV2[Any]): - """Zarr V2 ArraySpec with enhanced HTML representation for Jupyter/IPython.""" - - def _repr_html_(self) -> str: - """Return an HTML representation for Jupyter/IPython.""" - return _format_array_html(self) diff --git a/src/eopf_geozarr/pyz/v3.py b/src/eopf_geozarr/pyz/v3.py deleted file mode 100644 index 405c8590..00000000 --- a/src/eopf_geozarr/pyz/v3.py +++ /dev/null @@ -1,75 +0,0 @@ -""" -Zarr V3 models - -The generic type parameter TMembers allows the use of typeddicts to more explicitly model -the key structure of the members of a zarr group: - -```python -from typing import TypedDict - -class MyMembers(TypedDict, closed=True): - a: GroupSpec[Any, Any] - b: GroupSpec[Any, Any] - -# this class will enforce that the members have keys "a" and "b" -class MyGroup(GroupSpec[Any, MyMembers]) - ... -``` -""" - -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeAlias, TypeVar, Union - -from pydantic_zarr.v3 import ArraySpec as ArraySpecV3 -from pydantic_zarr.v3 import GroupSpec as GroupSpecV3 - -from eopf_geozarr.pyz.common import ( - TBaseAttr, - _format_array_html, - format_html_repr, - format_text_repr, - get_member_names, -) - -TBaseMember: TypeAlias = Mapping[str, Union["GroupSpec[Any, Any]", "ArraySpec[Any]"]] # noqa: UP040 - -TAttr = TypeVar("TAttr", bound=TBaseAttr) -TMembers = TypeVar("TMembers", bound=TBaseMember) -TArraySpecType = TypeVar("TArraySpecType") - - -class GroupSpec(GroupSpecV3[TAttr, TMembers]): # type: ignore[type-var] - # TMembers is bound to the full members mapping (e.g. a TypedDict) by design, - # whereas the parent's second type parameter expects a single member item type. - attributes: TAttr - # members holds the full mapping (TMembers) rather than the parent's - # Mapping[str, TItem] | None; this is the intended structure for this subclass. - members: TMembers # type: ignore[assignment] - - def __repr__(self) -> str: - """Return a condensed text representation of the GroupSpec.""" - class_name = self.__class__.__name__ - member_names = get_member_names(self.members) - return format_text_repr(class_name, member_names) - - def _repr_html_(self) -> str: - """Return an HTML representation for Jupyter/IPython.""" - class_name = self.__class__.__name__ - member_names = get_member_names(self.members) - members_dict = dict(self.members.items()) if self.members else None - return format_html_repr( - class_name, - member_names, - members_dict=members_dict, - attributes=self.attributes, - ) - - -class ArraySpec[TArraySpecType](ArraySpecV3[Any]): - """Zarr V3 ArraySpec with enhanced HTML representation for Jupyter/IPython.""" - - def _repr_html_(self) -> str: - """Return an HTML representation for Jupyter/IPython.""" - return _format_array_html(self) diff --git a/src/eopf_geozarr/s2_optimization/s2_converter.py b/src/eopf_geozarr/s2_optimization/s2_converter.py index 64583802..2c7bf493 100644 --- a/src/eopf_geozarr/s2_optimization/s2_converter.py +++ b/src/eopf_geozarr/s2_optimization/s2_converter.py @@ -11,12 +11,14 @@ import xarray as xr import zarr from pydantic import TypeAdapter +from pydantic_zarr.v2 import GroupSpec from pyproj import CRS from eopf_geozarr.conversion import utils from eopf_geozarr.conversion.geozarr import get_zarr_group from eopf_geozarr.data_api.s1 import Sentinel1Root from eopf_geozarr.data_api.s2 import Sentinel2Root +from eopf_geozarr.zarr_io import read_documents from .s2_multiscale import ( _AUX_MULTISCALES, @@ -362,11 +364,11 @@ def is_sentinel2_dataset(group: zarr.Group) -> bool: if group.metadata.zarr_format == 3: return _is_sentinel2_dataset_v3(group) - from eopf_geozarr.pyz.v2 import GroupSpec - adapter = TypeAdapter(Sentinel1Root | Sentinel2Root) try: - model = adapter.validate_python(GroupSpec.from_zarr(group).model_dump()) + model = adapter.validate_python( + GroupSpec.from_stored_metadata_json(read_documents(group)).model_dump() + ) except ValueError as e: log.warning("Could not validate Sentinel-2 dataset", error=str(e)) return False diff --git a/src/eopf_geozarr/s3_olci_optimization/olci_converter.py b/src/eopf_geozarr/s3_olci_optimization/olci_converter.py index 33b956f6..f6de6eb5 100644 --- a/src/eopf_geozarr/s3_olci_optimization/olci_converter.py +++ b/src/eopf_geozarr/s3_olci_optimization/olci_converter.py @@ -23,6 +23,7 @@ swath_spatial_attrs, ) from eopf_geozarr.s3_olci_optimization.olci_reproject import GRID_DIMS, reproject_olci +from eopf_geozarr.zarr_io import read_documents if TYPE_CHECKING: from zarr.core.common import JSON @@ -63,12 +64,10 @@ def is_sentinel3_olci_dataset(group: zarr.Group) -> bool: converter in the CLI). Users with such near-miss products should use the explicit ``convert-s3-olci-optimized`` subcommand, which skips detection. """ - from eopf_geozarr.pyz.v2 import GroupSpec - try: - model = Sentinel3OlciRoot.model_validate(GroupSpec.from_zarr(group).model_dump()) + model = Sentinel3OlciRoot.from_stored_metadata_json(read_documents(group)) except Exception as e: - # Classify, never raise: from_zarr/model_dump can fail with types + # Classify, never raise: reading the documents can fail with types # other than ValidationError on malformed or unexpected stores, and # any failure simply means "not a recognised OLCI product". log.debug("Not an OLCI dataset", error=str(e)) diff --git a/src/eopf_geozarr/zarr_io.py b/src/eopf_geozarr/zarr_io.py new file mode 100644 index 00000000..a9eb0aad --- /dev/null +++ b/src/eopf_geozarr/zarr_io.py @@ -0,0 +1,94 @@ +""" +Reading and writing pydantic-zarr specs with zarr-python. + +pydantic-zarr models metadata documents and, from 0.12, does no IO of its own: +a spec's ``to_stored_metadata_json`` gives the documents a store holds, keyed +as the store keys them, and ``from_stored_metadata_json`` reads such a mapping +back. These two functions move the documents in and out of a store with +zarr-python, for Zarr V2 and V3 alike. They follow the ``examples/zarr_io.py`` +module of pydantic-zarr, which documents this split. +""" + +from __future__ import annotations + +import json +from typing import TYPE_CHECKING + +import zarr +from pydantic_zarr import v2, v3 +from zarr.core.buffer import default_buffer_prototype +from zarr.core.group import GroupMetadata +from zarr.core.metadata import ArrayV2Metadata, ArrayV3Metadata + +if TYPE_CHECKING: + from zarr.abc.store import Store + +#: The store key of a Zarr V2 hierarchy's consolidated metadata. +_ZMETADATA = ".zmetadata" + + +def write_hierarchy( + spec: v2.AnyArraySpec | v2.AnyGroupSpec | v3.AnyArraySpec | v3.AnyGroupSpec, + store: Store, + path: str = "", + *, + overwrite: bool = False, +) -> zarr.Array | zarr.Group: + """ + Write the metadata documents of `spec` to `store` at `path` and return the + node written there. No array data is written. + + `zarr.create_hierarchy` writes every node, refusing to overwrite an + existing node unless `overwrite` is set. + """ + flat = v2.to_flat(spec) if spec.zarr_format == 2 else v3.to_flat(spec) + nodes: dict[str, ArrayV2Metadata | ArrayV3Metadata | GroupMetadata] = {} + for node_path, node in flat.items(): + # the document as JSON holds it, with tuples as arrays + document = json.loads(json.dumps(node.to_metadata_json())) + key = "/".join(part for part in (path.strip("/"), node_path.strip("/")) if part) + if "shape" not in document: + nodes[key] = GroupMetadata.from_dict(document) + elif document["zarr_format"] == 2: + nodes[key] = ArrayV2Metadata.from_dict(document) + else: + nodes[key] = ArrayV3Metadata.from_dict(document) + written = dict(zarr.create_hierarchy(store=store, nodes=nodes, overwrite=overwrite)) + return written[path.strip("/")] + + +def _own_document(document: object) -> object: + """ + `document` without the ``consolidated_metadata`` of a Zarr V3 group: + zarr-python's copy of the documents below the group, which + `read_documents` reads from each node instead. (zarr-python before 3.4 + also writes ``"consolidated_metadata": null``, which the readers refuse.) + """ + if isinstance(document, dict) and "consolidated_metadata" in document: + return {key: value for key, value in document.items() if key != "consolidated_metadata"} + return document + + +def read_documents(node: zarr.Array | zarr.Group) -> dict[str, object]: + """ + The metadata documents of `node` and, for a group, of every node under it, + keyed by store key relative to `node`: the mapping + ``from_stored_metadata_json`` takes. + + Consolidated metadata is left out (a Zarr V2 ``.zmetadata`` document, a + Zarr V3 group's ``consolidated_metadata`` field): it repeats the documents + of the nodes below, which are read here one by one. Lists in the documents + stay lists, as JSON holds them. + """ + prototype = default_buffer_prototype() + nodes: list[tuple[str, zarr.Array | zarr.Group]] = [("", node)] + if isinstance(node, zarr.Group): + nodes.extend(node.members(max_depth=None)) + documents: dict[str, object] = {} + for member_path, member in nodes: + for name, buffer in member.metadata.to_buffer_dict(prototype).items(): + if name == _ZMETADATA: + continue + key = f"{member_path}/{name}" if member_path else name + documents[key] = _own_document(json.loads(buffer.to_bytes())) + return documents diff --git a/tests/_test_data/s1_grdh_examples/regenerate.py b/tests/_test_data/s1_grdh_examples/regenerate.py index 457ed9ac..b315ee9f 100644 --- a/tests/_test_data/s1_grdh_examples/regenerate.py +++ b/tests/_test_data/s1_grdh_examples/regenerate.py @@ -25,6 +25,8 @@ from eopf.store.convert import convert from pydantic_zarr.v3 import GroupSpec +from eopf_geozarr.zarr_io import read_documents + OUTPUT_DIR = Path(__file__).parent @@ -39,7 +41,9 @@ def safe_to_json(safe_path: Path, output_dir: Path = OUTPUT_DIR) -> Path: source_store_kwargs={"engine": "safe", "mode": "r"}, target_store_kwargs={"engine": "cpm_zarr", "mode": "w"}, ) - spec = GroupSpec.from_zarr(zarr.open_group(str(store_path), mode="r")) + spec = GroupSpec.from_stored_metadata_json( + read_documents(zarr.open_group(str(store_path), mode="r")) + ) # mode="json" makes the dump JSON-safe (NaN fill values -> "NaN", tuples -> lists). output.write_text(json.dumps(spec.model_dump(mode="json"), indent=2, sort_keys=True) + "\n") return output diff --git a/tests/_test_data/s1_rtc_examples/regenerate.py b/tests/_test_data/s1_rtc_examples/regenerate.py index 6080554b..e1063608 100644 --- a/tests/_test_data/s1_rtc_examples/regenerate.py +++ b/tests/_test_data/s1_rtc_examples/regenerate.py @@ -37,6 +37,7 @@ ingest_s1tiling_acquisition, ingest_s1tiling_conditions, ) +from eopf_geozarr.zarr_io import read_documents # 31TCH is UTM zone 31N with its north-west corner at (500000, 5000000). The real tile is # 10980 px at 10 m; 1080 is a decade-smaller stand-in sharing the corner and the pixel size. @@ -136,7 +137,7 @@ def main() -> None: root = zarr.open_group(str(store_path), mode="r", zarr_format=3) # The *generic* GroupSpec, never S1RtcRoot: the fixture must record what the writer # emits, not what the model already accepts, or the drift this closes reopens. - spec = GroupSpec.from_zarr(root) + spec = GroupSpec.from_stored_metadata_json(read_documents(root)) OUTPUT.write_text(json.dumps(spec.model_dump(mode="json"), indent=2) + "\n") print(f"Wrote {OUTPUT}") diff --git a/tests/conftest.py b/tests/conftest.py index 44d1f48e..e1f8122c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -9,6 +9,9 @@ import zarr from pydantic_zarr.v2 import GroupSpec as GroupSpecV2 from pydantic_zarr.v3 import GroupSpec as GroupSpecV3 +from zarr.storage import LocalStore, MemoryStore + +from eopf_geozarr.zarr_io import write_hierarchy # Paths to example data / metadata s1_example_json_paths = tuple(pathlib.Path("tests/_test_data/s1_examples").glob("*.json")) @@ -46,8 +49,7 @@ def create_zarrv2_group_from_json( """ out_dir = out_path / (source_path.stem + ".zarr") g: GroupSpecV2 = GroupSpecV2.model_validate(read_json(source_path)) - # to_zarr is annotated to take a Store but accepts a path-like at runtime. - g.to_zarr(out_dir, path="") # type: ignore[arg-type] + write_hierarchy(g, LocalStore(out_dir)) return out_dir @@ -59,8 +61,7 @@ def create_zarrv3_group_from_json( """ out_dir = out_path / (source_path.stem + ".zarr") g: GroupSpecV3 = GroupSpecV3.model_validate(read_json(source_path)) - # to_zarr is annotated to take a Store but accepts a path-like at runtime. - g.to_zarr(out_dir, path="") # type: ignore[arg-type] + write_hierarchy(g, LocalStore(out_dir)) return out_dir @@ -112,9 +113,9 @@ def s2_geozarr_group_example(request: pytest.FixtureRequest) -> zarr.Group: Return a memory-backed Zarr V3 Group based on a sentinel 2 product converted to geozarr """ source_path: pathlib.Path = request.param - store: dict[str, bytes] = {} - # to_zarr is annotated to take a Store but accepts a dict-backed store at runtime. - return GroupSpecV3.model_validate(read_json(source_path)).to_zarr(store, path="") # type: ignore[arg-type] + group = write_hierarchy(GroupSpecV3.model_validate(read_json(source_path)), MemoryStore()) + assert isinstance(group, zarr.Group) + return group @pytest.fixture(params=zcm_multiscales_example_paths, ids=get_stem) diff --git a/tests/test_data_api/test_s1.py b/tests/test_data_api/test_s1.py index ed0c3a29..8a58b8ae 100644 --- a/tests/test_data_api/test_s1.py +++ b/tests/test_data_api/test_s1.py @@ -14,10 +14,10 @@ from typing import Any import pytest +from pydantic_zarr.v2 import GroupSpec import eopf_geozarr.data_api.s1 as s1_module from eopf_geozarr.data_api.s1 import Sentinel1PolarizationGroup, Sentinel1Root -from eopf_geozarr.pyz.v2 import GroupSpec def test_sentinel1_roundtrip(s1_json_example: dict[str, object]) -> None: diff --git a/tests/test_data_api/test_s1_rtc.py b/tests/test_data_api/test_s1_rtc.py index 4ade56ea..74d46477 100644 --- a/tests/test_data_api/test_s1_rtc.py +++ b/tests/test_data_api/test_s1_rtc.py @@ -31,6 +31,7 @@ ) from eopf_geozarr.data_api.s1_rtc import CONDITION_ARRAY_PREFIXES as _CONDITION_PREFIXES from eopf_geozarr.data_api.s1_rtc import S1RtcRoot +from eopf_geozarr.zarr_io import read_documents from tests.test_s1_rtc_ingest import ACQ1_TAGS, SIZE, _create_synthetic_geotiff if TYPE_CHECKING: @@ -265,7 +266,7 @@ def test_ingested_store_validates(self, tmp_path: Path, condition_kwargs: list[s """A store built by the ingester opens through the model.""" store_path = _ingest_store(tmp_path, condition_kwargs) - model = S1RtcRoot.from_zarr(_open_store(store_path)) + model = S1RtcRoot.from_stored_metadata_json(read_documents(_open_store(store_path))) assert model.ascending is not None assert model.ascending.conditions is not None @@ -287,7 +288,7 @@ def test_overview_missing_coordinate_is_rejected(self, tmp_path: Path, coordinat """ store_path = _ingest_store(tmp_path, ["gamma_area_path"]) # Sanity: the untouched store validates, so a failure below is the deletion talking. - S1RtcRoot.from_zarr(_open_store(store_path)) + S1RtcRoot.from_stored_metadata_json(read_documents(_open_store(store_path))) orbit = zarr.open_group( str(store_path / "ascending"), mode="r+", zarr_format=3, use_consolidated=False @@ -298,7 +299,7 @@ def test_overview_missing_coordinate_is_rejected(self, tmp_path: Path, coordinat consolidate_s1_store(store_path, "ascending") with pytest.raises(Exception, match="coordinate arrays"): - S1RtcRoot.from_zarr(_open_store(store_path)) + S1RtcRoot.from_stored_metadata_json(read_documents(_open_store(store_path))) def test_fixture_still_matches_writer_output( self, tmp_path: Path, s1_rtc_json_example: dict[str, object] @@ -315,7 +316,7 @@ def test_fixture_still_matches_writer_output( fixture's tile and this synthetic store, so they are compared by prefix, not verbatim. """ store_path = _ingest_store(tmp_path, ["gamma_area_path"]) - ingested = S1RtcRoot.from_zarr(_open_store(store_path)) + ingested = S1RtcRoot.from_stored_metadata_json(read_documents(_open_store(store_path))) fixture_orbit = _nav(s1_rtc_json_example, "members", "descending") ingested_root = ingested.model_dump(by_alias=True, mode="json") diff --git a/tests/test_data_api/test_s3_olci.py b/tests/test_data_api/test_s3_olci.py index 0625ec84..a672988e 100644 --- a/tests/test_data_api/test_s3_olci.py +++ b/tests/test_data_api/test_s3_olci.py @@ -2,9 +2,11 @@ import pytest from pydantic import ValidationError +from pydantic_zarr.v2 import ArraySpec +from zarr.storage import LocalStore from eopf_geozarr.data_api.s3_olci import Sentinel3OlciRoot -from eopf_geozarr.pyz.v2 import ArraySpec, GroupSpec # noqa: F401 +from eopf_geozarr.zarr_io import read_documents, write_hierarchy def _olci_arr() -> dict[str, object]: @@ -85,7 +87,7 @@ def test_detector_accepts_olci_zarr(tmp_path: object) -> None: } assert isinstance(tmp_path, pathlib.Path) out = tmp_path / "olci.zarr" - Sentinel3OlciRoot.model_validate(root_dict).to_zarr(out, path="") # type: ignore[arg-type] + write_hierarchy(Sentinel3OlciRoot.model_validate(root_dict), LocalStore(out)) group = zarr.open_group(str(out), mode="r") assert is_sentinel3_olci_dataset(group) is True @@ -123,10 +125,7 @@ def test_real_olci_product_validates_model(s3_olci_group_example: object) -> Non import zarr - from eopf_geozarr.data_api.s3_olci import Sentinel3OlciRoot - from eopf_geozarr.pyz.v2 import GroupSpec as PyzGroupSpec - assert isinstance(s3_olci_group_example, pathlib.Path) group = zarr.open_group(str(s3_olci_group_example), mode="r") - model = Sentinel3OlciRoot.model_validate(PyzGroupSpec.from_zarr(group).model_dump()) + model = Sentinel3OlciRoot.from_stored_metadata_json(read_documents(group)) assert "oa01_radiance" in model.measurements.members diff --git a/tests/test_data_api/test_v2.py b/tests/test_data_api/test_v2.py index dd4c6941..72619860 100644 --- a/tests/test_data_api/test_v2.py +++ b/tests/test_data_api/test_v2.py @@ -41,7 +41,7 @@ def test_valid(data_shape: tuple[int, ...]) -> None: f"dim_{idx}": DataArray.from_array(np.arange(s), dimension_names=(f"dim_{idx}",)) for idx, s in enumerate(data_shape) } - group = GroupSpec[Mapping[str, object], DataArray]( + group = GroupSpec[Mapping[str, object], Mapping[str, DataArray]]( attributes={}, members={"base": base_array, **coords_arrays} ) # ``group`` structurally satisfies ``GroupLike``, but mypy cannot bind the @@ -68,7 +68,7 @@ def test_invalid_coordinates( f"dim_{idx}": DataArray.from_array(np.arange(s + 1), dimension_names=(f"dim_{idx}",)) for idx, s in enumerate(data_shape) } - group = GroupSpec[Mapping[str, object], DataArray]( + group = GroupSpec[Mapping[str, object], Mapping[str, DataArray]]( attributes={}, members={"base": base_array, **coords_arrays} ) msg = "Dimension .* for array 'base' has a shape mismatch:" diff --git a/tests/test_data_api/test_v3.py b/tests/test_data_api/test_v3.py index 51c85419..6b4d77cc 100644 --- a/tests/test_data_api/test_v3.py +++ b/tests/test_data_api/test_v3.py @@ -15,6 +15,7 @@ MultiscaleGroup, check_valid_coordinates, ) +from eopf_geozarr.zarr_io import read_documents if TYPE_CHECKING: from eopf_geozarr.data_api.geozarr.common import GroupLike @@ -36,7 +37,7 @@ def test_valid(data_shape: tuple[int, ...]) -> None: f"dim_{idx}": DataArray.from_array(np.arange(s), dimension_names=(f"dim_{idx}",)) for idx, s in enumerate(data_shape) } - group = GroupSpec[Mapping[str, object], DataArray]( + group = GroupSpec[Mapping[str, object], Mapping[str, DataArray]]( attributes={}, members={"base": base_array, **coords_arrays} ) # ``group`` structurally satisfies ``GroupLike``, but mypy cannot bind the @@ -63,7 +64,7 @@ def test_invalid_coordinates( f"dim_{idx}": DataArray.from_array(np.arange(s + 1), dimension_names=(f"dim_{idx}",)) for idx, s in enumerate(data_shape) } - group = GroupSpec[Mapping[str, object], DataArray]( + group = GroupSpec[Mapping[str, object], Mapping[str, DataArray]]( attributes={}, members={"base": base_array, **coords_arrays} ) msg = "Dimension .* for array 'base' has a shape mismatch:" @@ -75,7 +76,9 @@ def test_dataarray_round_trip(s2_geozarr_group_example: zarr.Group) -> None: """ Ensure that we can round-trip dataarray attributes through the `Multiscales` model. """ - source_untyped: GroupSpec = GroupSpec.from_zarr(s2_geozarr_group_example) + source_untyped: GroupSpec = GroupSpec.from_stored_metadata_json( + read_documents(s2_geozarr_group_example) + ) flat = source_untyped.to_flat() for val in flat.values(): if isinstance(val, ArraySpec) and val.dimension_names is not None: @@ -90,7 +93,7 @@ def test_multiscale_attrs_round_trip(s2_geozarr_group_example: zarr.Group) -> No source_group_members = dict(s2_geozarr_group_example.members(max_depth=None)) for val in source_group_members.values(): if isinstance(val, zarr.Group) and "multiscales" in val.attrs.asdict(): - model_json = MultiscaleGroup.from_zarr(val).model_dump() + model_json = MultiscaleGroup.from_stored_metadata_json(read_documents(val)).model_dump() # tuplify both sides: level groups may carry list-valued attributes # (e.g. ``spatial:bbox``) that are JSON-equivalent to tuples but not # normalised by ``model_dump`` alone. diff --git a/tests/test_olci_integration.py b/tests/test_olci_integration.py index 60524f9a..3f8fd797 100644 --- a/tests/test_olci_integration.py +++ b/tests/test_olci_integration.py @@ -14,13 +14,13 @@ import xarray as xr import zarr from affine import Affine -from pydantic_zarr.core import tuplify_json from pydantic_zarr.v3 import GroupSpec from eopf_geozarr.data_api.geozarr.validation import validate_store from eopf_geozarr.s3_olci_optimization.olci_converter import ( _sanitize_olci_array_attrs_keep_fill, ) +from eopf_geozarr.zarr_io import read_documents if TYPE_CHECKING: import pathlib @@ -550,7 +550,7 @@ def test_olci_conversion_matches_snapshot( out = str(tmp_path / "out.zarr") convert_olci_optimized(dt_in, output_path=out, min_dimension=8, output_grid=output_grid) - # Each consolidated block is a snapshot, and GroupSpec.from_zarr below reads the + # Each consolidated block is a snapshot, and read_documents below reads the # levels through the `measurements` block, so a stale block would hide a late # write. Re-consolidating a current store rewrites the same bytes (#303). for path in ("measurements", ""): @@ -561,7 +561,9 @@ def test_olci_conversion_matches_snapshot( assert meta.read_bytes() == before, f"/{path}: consolidated block is stale" observed_group = zarr.open_group(out, use_consolidated=False) - observed_structure_json = GroupSpec.from_zarr(observed_group).model_dump() + observed_structure_json = GroupSpec.from_stored_metadata_json( + read_documents(observed_group) + ).model_dump() expected_path = Path("tests/_test_data/optimized_olci_examples") / ( f"{s3_olci_group_example.stem}-{golden_suffix}.json" @@ -571,11 +573,10 @@ def test_olci_conversion_matches_snapshot( # expected_path.parent.mkdir(parents=True, exist_ok=True) # expected_path.write_text(json.dumps(observed_structure_json, indent=2, sort_keys=True)) - observed_structure = GroupSpec(**tuplify_json(observed_structure_json)) - observed_structure_flat = observed_structure.to_flat() - expected_structure_json = tuplify_json(json.loads(expected_path.read_text())) - expected_structure = GroupSpec(**expected_structure_json) - expected_structure_flat = expected_structure.to_flat() + observed_structure_flat = GroupSpec.model_validate(observed_structure_json).to_flat() + expected_structure_flat = GroupSpec.model_validate( + json.loads(expected_path.read_text()) + ).to_flat() o_keys = set(observed_structure_flat.keys()) e_keys = set(expected_structure_flat.keys()) diff --git a/tests/test_s2_multiscale.py b/tests/test_s2_multiscale.py index 851c8009..b0b9cfc4 100644 --- a/tests/test_s2_multiscale.py +++ b/tests/test_s2_multiscale.py @@ -14,7 +14,6 @@ import xarray as xr import zarr from affine import Affine -from pydantic_zarr.core import tuplify_json from pydantic_zarr.v3 import GroupSpec from pyproj import CRS from structlog.testing import capture_logs @@ -39,6 +38,7 @@ generic_multiscales, inject_missing_bands, ) +from eopf_geozarr.zarr_io import read_documents from .conftest import create_zarrv2_group_from_json, get_stem, s2_example_json_paths @@ -301,8 +301,8 @@ def test_create_multiscale_from_datatree_snapshot( crs=_TILE_CRS, ) - observed_json = GroupSpec.from_zarr( - zarr.open_group(output_path, use_consolidated=False) + observed_json = GroupSpec.from_stored_metadata_json( + read_documents(zarr.open_group(output_path, use_consolidated=False)) ).model_dump() snapshot_path = pathlib.Path("tests/_test_data/optimized_geozarr_examples") / ( source_path.stem + ".json" @@ -310,8 +310,8 @@ def test_create_multiscale_from_datatree_snapshot( if os.environ.get("REGENERATE_SNAPSHOTS"): snapshot_path.write_text(json.dumps(observed_json, indent=2, sort_keys=True) + "\n") - observed = GroupSpec(**tuplify_json(observed_json)).to_flat() - expected = GroupSpec(**tuplify_json(json.loads(snapshot_path.read_text()))).to_flat() + observed = GroupSpec.model_validate(observed_json).to_flat() + expected = GroupSpec.model_validate(json.loads(snapshot_path.read_text())).to_flat() assert set(observed) == set(expected) # Compare as JSON: a NaN fill value never equals itself as a float. diff --git a/tests/test_zarr_io.py b/tests/test_zarr_io.py new file mode 100644 index 00000000..eae22870 --- /dev/null +++ b/tests/test_zarr_io.py @@ -0,0 +1,85 @@ +"""Tests for the zarr-python glue in `eopf_geozarr.zarr_io`.""" + +from __future__ import annotations + +from typing import Literal + +import numpy as np +import pytest +import zarr +from pydantic_zarr import v2, v3 +from zarr.errors import ContainsGroupError +from zarr.storage import MemoryStore + +from eopf_geozarr.zarr_io import read_documents, write_hierarchy + + +def _spec( + zarr_format: Literal[2, 3], kind: Literal["array", "group"] +) -> v2.AnyArraySpec | v2.AnyGroupSpec | v3.AnyArraySpec | v3.AnyGroupSpec: + """A small hierarchy: a group with an array and a nested group, or one array.""" + data = np.zeros((4, 4), dtype="uint8") + if zarr_format == 2: + array_v2 = v2.ArraySpec.from_array(data, attributes={"flag_values": [0, 1]}) + if kind == "array": + return array_v2 + return v2.GroupSpec( + attributes={"title": "t"}, + members={"x": array_v2, "sub": v2.GroupSpec(members={"y": array_v2})}, + ) + array_v3 = v3.ArraySpec.from_array(data, attributes={"flag_values": [0, 1]}) + if kind == "array": + return array_v3 + return v3.GroupSpec( + attributes={"title": "t"}, + members={"x": array_v3, "sub": v3.GroupSpec(members={"y": array_v3})}, + ) + + +@pytest.mark.parametrize("zarr_format", [2, 3]) +@pytest.mark.parametrize( + ("kind", "consolidated"), [("array", False), ("group", False), ("group", True)] +) +@pytest.mark.parametrize("path", ["", "a/b"]) +@pytest.mark.parametrize("overwrite", [False, True]) +def test_write_then_read_round_trips( + zarr_format: Literal[2, 3], + kind: Literal["array", "group"], + consolidated: bool, + path: str, + overwrite: bool, +) -> None: + """ + `read_documents` of the node `write_hierarchy` wrote gives back the spec + written, at the root or a nested path, with or without consolidated + metadata, and over an existing node when `overwrite` is set. + """ + spec = _spec(zarr_format, kind) + store = MemoryStore() + if overwrite: + # a different node already at the path, which overwrite replaces + other = _spec(zarr_format, "group" if kind == "array" else "array") + write_hierarchy(other, store, path) + + written = write_hierarchy(spec, store, path, overwrite=overwrite) + assert isinstance(written, zarr.Group if kind == "group" else zarr.Array) + if consolidated: + zarr.consolidate_metadata(store, path=path or None, zarr_format=zarr_format) + + node = zarr.open(store, path=path, mode="r", zarr_format=zarr_format) + documents = read_documents(node) + assert ".zmetadata" not in documents + assert all( + "consolidated_metadata" not in document + for document in documents.values() + if isinstance(document, dict) + ) + assert type(spec).from_stored_metadata_json(documents) == spec + + +def test_write_refuses_an_existing_node() -> None: + """Without `overwrite`, writing where a node already exists raises.""" + store = MemoryStore() + write_hierarchy(_spec(3, "group"), store, "a") + with pytest.raises(ContainsGroupError): + write_hierarchy(_spec(3, "array"), store, "a") diff --git a/uv.lock b/uv.lock index e64cf862..38b0ff9f 100644 --- a/uv.lock +++ b/uv.lock @@ -1660,7 +1660,7 @@ wheels = [ [[package]] name = "eopf-geozarr" -version = "0.13.0" +version = "0.13.1" source = { editable = "." } default-groups = ["dev", "test"] dependencies = [ @@ -1734,7 +1734,7 @@ requires-dist = [ { name = "eopf", marker = "python_full_version >= '3.13' and extra == 'cpm'", specifier = ">=3.0.0" }, { name = "numpy", specifier = ">=2.3.1" }, { name = "pydantic", specifier = ">=2.14.1" }, - { name = "pydantic-zarr", specifier = ">=0.8.0" }, + { name = "pydantic-zarr", specifier = ">=0.12.0,<0.13" }, { name = "pygit2", specifier = ">=1.20.1" }, { name = "pyproj", specifier = ">=3.7.0" }, { name = "pystac", specifier = ">=1.8.0" }, @@ -4532,17 +4532,19 @@ wheels = [ [[package]] name = "pydantic-zarr" -version = "0.10.0" +version = "0.12.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "numpy", version = "2.4.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.13'" }, { name = "numpy", version = "2.5.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.13'" }, { name = "packaging" }, { name = "pydantic" }, + { name = "typing-extensions" }, + { name = "zarr-metadata" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/2f/57/aac9e500abe15719b7406d55871fc8787e7d0ebf83de5f98d44471139f70/pydantic_zarr-0.10.0.tar.gz", hash = "sha256:996b5b4225fb05757e7fff831ee7a75c61f54514a4c2493c7b79635bade7b415", size = 80374, upload-time = "2026-04-23T14:23:12.575Z" } +sdist = { url = "https://files.pythonhosted.org/packages/07/f6/6d89d2b6eae13407b853c43cd4771341a832660e1c1ec3d05ad9e5984dcf/pydantic_zarr-0.12.0.tar.gz", hash = "sha256:6c83ffdd790a60fb273242656c7e260a08c789486693457b4dcfb5d4d8d42b0b", size = 422831, upload-time = "2026-11-16T16:07:44.61Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/c7/05/04af0ca9c5747c95591a549509ebbb0a986155015de59f1e4c984e3af9ab/pydantic_zarr-0.10.0-py3-none-any.whl", hash = "sha256:d15769dab43346b070051fdf6e83509d7f55259dd00c6d12be2400935117e230", size = 52809, upload-time = "2026-04-23T14:23:11.011Z" }, + { url = "https://files.pythonhosted.org/packages/8e/b8/67ab84a221d843d1a095fd45560310de02279f98741f7d6f516fdb3529b6/pydantic_zarr-0.12.0-py3-none-any.whl", hash = "sha256:2c55abd8e06771f4a9f0c472f9a79f9f58a94eb98ee80118c18b784474c269be", size = 88105, upload-time = "2026-11-16T16:07:42.773Z" }, ] [[package]] @@ -6736,6 +6738,19 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/85/fb/8c17b2956a248be9398f6727490976ab3e69cd419af9d983164a46d830da/zarr_cm-0.5.0-py3-none-any.whl", hash = "sha256:99fef56dae5eb5ee2a7126d8a18e669944494e0778832577ae8ae922b0207b12", size = 55585, upload-time = "2026-09-26T07:57:41.935Z" }, ] +[[package]] +name = "zarr-metadata" +version = "0.9.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "annotated-types" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/7f/5d/5f1778697e0022d5cf7b215554a96827949a1d065b51913059b83b770ab3/zarr_metadata-0.9.0.tar.gz", hash = "sha256:7c7612ccb0177f2d1abb05cc38cdb89a54f31558edccf78d848a1c68d95415f7", size = 616077, upload-time = "2026-11-16T13:12:44.238Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/35/26/c1eb0a10cbbe9cc7d759ee66261f2461f09e964359dd4d3e6a0c74824bba/zarr_metadata-0.9.0-py3-none-any.whl", hash = "sha256:61714b08a7eacd4bef4e1ccc485e331de2ac5b7afda624094a711e474641338a", size = 339074, upload-time = "2026-11-16T13:12:42.616Z" }, +] + [[package]] name = "zict" version = "3.0.0" From 2f346399dfe19d9501225a48c16f99377eaa6327 Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Mon, 16 Nov 2026 18:10:28 +0100 Subject: [PATCH 43/45] build(deps): require tornado 6.6.1 for CVE-2026-126347 The security workflow's pip-audit refuses the locked tornado 6.6, which CVE-2026-126347 affects and 6.6.1 fixes. main locks the same version. Raise the constraint and relock tornado alone. Assisted-by: ClaudeCode:claude-opus-5.5 Co-Authored-By: Claude Opus 5.5 --- pyproject.toml | 2 +- uv.lock | 94 +++++++++++++++++++++++++------------------------- 2 files changed, 48 insertions(+), 48 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c064a9ca..8f668290 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -252,7 +252,7 @@ constraint-dependencies = [ "urllib3>=2.8.0", "requests>=2.33.0", "cryptography>=46.0.6", - "tornado>=6.6", + "tornado>=6.6.1", "msgpack>=1.2.3", "multidict>=6.9.1", "filelock>=3.20.3", diff --git a/uv.lock b/uv.lock index 38b0ff9f..3f06e5a3 100644 --- a/uv.lock +++ b/uv.lock @@ -24,7 +24,7 @@ constraints = [ { name = "multidict", specifier = ">=6.9.1" }, { name = "pygments", specifier = ">=2.20.0" }, { name = "requests", specifier = ">=2.33.0" }, - { name = "tornado", specifier = ">=6.6" }, + { name = "tornado", specifier = ">=6.6.1" }, { name = "urllib3", specifier = ">=2.8.0" }, { name = "virtualenv", specifier = ">=21.7.13" }, ] @@ -6062,52 +6062,52 @@ wheels = [ [[package]] name = "tornado" -version = "6.6" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/d0/02/5f549b1ad5da6267ed1e1fac2eef69257b1979cc812497002499b7895ff9/tornado-6.6.tar.gz", hash = "sha256:34c4aa916d7f2b2d5cadee2c6850f5a4a7f3d688cbf58399ea9bd3057af4abd5", size = 617998, upload-time = "2026-10-21T15:31:04.733Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/df/f5/d3e6f76b945f9812842db742d0708a3b6287e850e81be3ca10e290c103c6/tornado-6.6-cp311-abi3-macosx_10_9_universal2.whl", hash = "sha256:01abf15429d64f04ccfafc238b191cc2c177108b7a331f4461707ad77198c8c2", size = 528326, upload-time = "2026-10-21T15:30:05.528Z" }, - { url = "https://files.pythonhosted.org/packages/30/69/b20cf3a8bf641ec792a5a6050aa153e8f120604f9c23471142de535113e5/tornado-6.6-cp311-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:11bb97c00981eb8254e55bd6a5ad960c983ae343fef8ae3ae5584cd1fb70236a", size = 529544, upload-time = "2026-10-21T15:30:07.126Z" }, - { url = "https://files.pythonhosted.org/packages/0f/f4/d9d8d3ac345aa9df3a132ad03bd443160c2ab24ad4003b4e8d6d5af06371/tornado-6.6-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4e152a3b2d3eae113b836d979823f7bb2320f7e334a84449729964921f374a4c", size = 530523, upload-time = "2026-10-21T15:30:08.478Z" }, - { url = "https://files.pythonhosted.org/packages/ad/82/1296ade1c14dee5a4906e5ca092997622ece7c4dc768c68ed9caaf895d1b/tornado-6.6-cp311-abi3-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e912d4c4babd04db6f34b25b748174a4a176debe86c8610beedf1815f9af7fdd", size = 530739, upload-time = "2026-10-21T15:30:09.98Z" }, - { url = "https://files.pythonhosted.org/packages/66/30/6ac1eab66c81af46dafd93c9b24bd311f82e199d9d7b8ce2a64a91b6a200/tornado-6.6-cp311-abi3-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:33aabe8a03d426cef4e0fe5669f0643cadd983b54957f1a7ac2789ec326e9644", size = 529738, upload-time = "2026-10-21T15:30:11.498Z" }, - { url = "https://files.pythonhosted.org/packages/24/b4/6c1f6aa1fd148e4d0f500a10cd0c9949e7bf385e161ff497c81de5b3ae4f/tornado-6.6-cp311-abi3-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:9aaf0e1c2fb9f046f30e2036b8d2060666399e8464d0a72769e43c754089567b", size = 527908, upload-time = "2026-10-21T15:30:13.298Z" }, - { url = "https://files.pythonhosted.org/packages/54/5b/67d3d452b1179bc9e265cebd381a56ab4cf2d7b2a54607aedd8d6e1ebc2e/tornado-6.6-cp311-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:61fc5513cea97720ab9bf54b04827ac0f4500c63f0b072b963d6145c798b4661", size = 530367, upload-time = "2026-10-21T15:30:15.183Z" }, - { url = "https://files.pythonhosted.org/packages/74/14/4e8e9a14f77bcafb2408634b2d4c8c676ad7a43bf8dac4ee2d48370698f9/tornado-6.6-cp311-abi3-musllinux_1_2_ppc64le.whl", hash = "sha256:31e1a0d5cd704d2fe8a008c1cc27a0e2b67269ca263630a27985dddc160b5537", size = 530456, upload-time = "2026-10-21T15:30:16.741Z" }, - { url = "https://files.pythonhosted.org/packages/56/12/e3ddef99a2089ccfc86f32bd3f39caaad87bee4868be1bacbf213a0b07a2/tornado-6.6-cp311-abi3-musllinux_1_2_riscv64.whl", hash = "sha256:74416e41e9bdf70fbc2fb242f6fbbc7a58ec11e59d39f15fc5a421ecb6845118", size = 529610, upload-time = "2026-10-21T15:30:18.031Z" }, - { url = "https://files.pythonhosted.org/packages/35/3d/62a692343d46b37e852e5078e0f6513534d925f70a04580072e3c127b129/tornado-6.6-cp311-abi3-musllinux_1_2_s390x.whl", hash = "sha256:8cdd69104ae9d705b3f04d2563aa96e357043e267a455802daae9a1e633a37c8", size = 529803, upload-time = "2026-10-21T15:30:19.326Z" }, - { url = "https://files.pythonhosted.org/packages/49/04/6c59a9413adfe4810f648a4dd9fdf476f13b0495f9cc25ef856b71f9ce1e/tornado-6.6-cp311-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:fc7c8a3263501fbe97518cd699101bc3c5f499a7dd4f75fc6cbb3bd9ee1db1f1", size = 529751, upload-time = "2026-10-21T15:30:20.826Z" }, - { url = "https://files.pythonhosted.org/packages/31/36/a1b3b84cd347ae43f982d3bf95628de6c6365668dba2543af47c6a1c888e/tornado-6.6-cp311-abi3-win32.whl", hash = "sha256:b54ca69ff93d0374efb083a12a1e9ec2dd2036e8496d197e0e8ef77b8d9135c3", size = 530643, upload-time = "2026-10-21T15:30:22.428Z" }, - { url = "https://files.pythonhosted.org/packages/b7/50/dc813fe35a672e14ee8bed8b5c634eeb343a05c98eb455318a169de24567/tornado-6.6-cp311-abi3-win_amd64.whl", hash = "sha256:48f26ed9d7beb64e5f06adc864524e581ab6d62ba8ff46eaaa1ac2d0e6d753fd", size = 530886, upload-time = "2026-10-21T15:30:23.975Z" }, - { url = "https://files.pythonhosted.org/packages/0d/71/62a9b9e980026d38874740d0a7c162f53eb0563f6a441e3aff84c48db7e8/tornado-6.6-cp311-abi3-win_arm64.whl", hash = "sha256:29114ffd4e4de869d390393df9e9a0f191065aae1a96f38a58d35e464c04a867", size = 530899, upload-time = "2026-10-21T15:30:25.264Z" }, - { url = "https://files.pythonhosted.org/packages/ac/4c/633e3568eb574df555d6ddd2dac44b7793a5c26cd63b444e653fcfb1d6ec/tornado-6.6-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:63fc8d243b52fd8dd9ed4ad02d0df08f2024f9aea632a433a8a6c91075076d44", size = 528432, upload-time = "2026-10-21T15:30:26.578Z" }, - { url = "https://files.pythonhosted.org/packages/37/eb/b525d1870ad28a56f47b664dd8fd3fab4f7ddd237c87c14e97248bf4762f/tornado-6.6-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:8d4b85cac795bfc6a7f20ba81871abb8c2ae8fba019061b8a9ae1c2f97e29637", size = 532586, upload-time = "2026-10-21T15:30:28.027Z" }, - { url = "https://files.pythonhosted.org/packages/b7/35/909a33c253352346ca081a27ca66b45c1398468adf784b767597ca773c28/tornado-6.6-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e035c065edadfa696529d05eebcbeb25154c129b5aee6dbfb697a6abf5d4f697", size = 533641, upload-time = "2026-10-21T15:30:29.318Z" }, - { url = "https://files.pythonhosted.org/packages/6f/64/100202666d6e3d96288ab184827762415456c139798a15c962547f9fabf9/tornado-6.6-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:5b94e589ab855090c448b5c0937b3a75f1c1a604b7b36207e8236d209f720b9c", size = 533869, upload-time = "2026-10-21T15:30:30.882Z" }, - { url = "https://files.pythonhosted.org/packages/b1/e0/af3ed62bc15830d60328d5b4a1a9076b35ea0ba142cb17b1c1772cb15c59/tornado-6.6-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:1a394c8c9db9137f2a2b42869d9f7b91398fcf19da120d0dde4c4546172710f7", size = 532767, upload-time = "2026-10-21T15:30:32.273Z" }, - { url = "https://files.pythonhosted.org/packages/24/d7/1e2e1a6932eb62d63324b64dba2f62e6eaf79ad883dd209352c297b7848c/tornado-6.6-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0215d1df6e4b5e736ddad5adf0af4138cf7437fdd39c77c5e69768e37850a632", size = 530956, upload-time = "2026-10-21T15:30:33.746Z" }, - { url = "https://files.pythonhosted.org/packages/70/65/3b9a0e53d7a4c39f2ebe95486540fa8eeb67bfb6e8c437d603c00d35b128/tornado-6.6-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:4d711790e0a9576ad924d942c4607e4e401d697588ea6f30f6662824008a7add", size = 533372, upload-time = "2026-10-21T15:30:35.085Z" }, - { url = "https://files.pythonhosted.org/packages/44/48/90979cbfaa3ff941324a2605eb794af0f087c670cd99f18a69ab40498073/tornado-6.6-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:034a66bae0f55421d007803e2385d2a59707d8829b2f026373d42f08256e9922", size = 533425, upload-time = "2026-10-21T15:30:36.425Z" }, - { url = "https://files.pythonhosted.org/packages/bb/c4/ce743a86d91f85c255b77a4282eb5b2716b61e74430eb9d1df8578a539d2/tornado-6.6-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:5cb38483b077129056a94dd415a71d29ab4e42b46da894fee8b4657003f10b21", size = 532545, upload-time = "2026-10-21T15:30:37.789Z" }, - { url = "https://files.pythonhosted.org/packages/02/5e/a82131e35778540fc19139229d02aa8cf2453a8022e202be50c88f0f8ac3/tornado-6.6-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:46bbbd107efa37777ac4b83601866d19b4dbd5b770a7a9123582633d95959ad3", size = 532700, upload-time = "2026-10-21T15:30:39.336Z" }, - { url = "https://files.pythonhosted.org/packages/3a/09/6dac8c2c677c65d60b3d7dae94176dbfe392f314e7c8e2d709623edd6a26/tornado-6.6-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:b85e9d0263cdbc027b95947c8b873a7bc7fd6a08d16bfb4f5047350b0808e464", size = 532712, upload-time = "2026-10-21T15:30:40.698Z" }, - { url = "https://files.pythonhosted.org/packages/b2/ac/71e5776cbcdc3264e81aa6db28c69717ba50607a9eb8d5b766f11a4b020e/tornado-6.6-cp314-cp314t-win32.whl", hash = "sha256:4276eef0880e5fe4488e6799c2842f59af3b06637e9313ab4fb506f9c9c2d6cb", size = 530491, upload-time = "2026-10-21T15:30:42.115Z" }, - { url = "https://files.pythonhosted.org/packages/d8/0f/0b6a6908a5b5aa8320009dfdb84434b1cf160b577a00456e59ab9e6ea598/tornado-6.6-cp314-cp314t-win_amd64.whl", hash = "sha256:10d4af98c6df09f8429b1340ccaea3a72887b86f695dfb8056bda517c8115a00", size = 530780, upload-time = "2026-10-21T15:30:43.414Z" }, - { url = "https://files.pythonhosted.org/packages/3c/39/c152e1cc5371f75f5f9f0a4f44bf2dc9396be9407d384de7428446fb4651/tornado-6.6-cp314-cp314t-win_arm64.whl", hash = "sha256:b1f0ef20a5278854f5fdac31637bafadb055405df28b7fc945e54add12b172e3", size = 530781, upload-time = "2026-10-21T15:30:44.741Z" }, - { url = "https://files.pythonhosted.org/packages/0c/c5/f96c7d7a8895745bb37dfb6e6107e1ee40ad02a4b162d7d6c143644455ab/tornado-6.6-cp315-cp315t-macosx_10_15_universal2.whl", hash = "sha256:8f8e382da30fe042f27f27a871e21aefc2613870e5a41648de18446c72d6ea59", size = 528446, upload-time = "2026-10-21T15:30:46.112Z" }, - { url = "https://files.pythonhosted.org/packages/c0/dd/ab8f6500d274b9c55b025798eb54e92591bcff27515799bec443bd54e35a/tornado-6.6-cp315-cp315t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:8c7a8a328396c2195454a2ecd9499512441bbce99505544a717e6a87d16ff6f9", size = 532774, upload-time = "2026-10-21T15:30:47.393Z" }, - { url = "https://files.pythonhosted.org/packages/87/23/b78e7d1bf329160b8157284005395421ea941864c16c7f04c3e48c98bcf9/tornado-6.6-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ca025bb0da81c294aef26f27427316df1525220820315f4bf32dc1e84a4d2232", size = 533872, upload-time = "2026-10-21T15:30:48.884Z" }, - { url = "https://files.pythonhosted.org/packages/e0/4f/ab66b614ad0bc9a219484be6bc2c002c8de9916a7b6c7b27fe6273838e5c/tornado-6.6-cp315-cp315t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:59c22ebc905ac2a267f8d9d8a878f86afbcbbde329d75c485f1422fc45a81b83", size = 534027, upload-time = "2026-10-21T15:30:50.157Z" }, - { url = "https://files.pythonhosted.org/packages/da/63/501fa15a36bace2f4b9158228cf922d606403261bf71c960c433ec3ca0a4/tornado-6.6-cp315-cp315t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f89802bc0bcd15f988d9325b4e6d2171bb04ea68d188732556335e10d3fd00bd", size = 532936, upload-time = "2026-10-21T15:30:51.45Z" }, - { url = "https://files.pythonhosted.org/packages/7f/b7/82d643f635f0300bda98613ca2660b4f3134b6fb594c6fddfa4de706806c/tornado-6.6-cp315-cp315t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:70043256d5958f9c655066153d23d60ea3e29bf9854f7fb75850e223c477758a", size = 531254, upload-time = "2026-10-21T15:30:52.865Z" }, - { url = "https://files.pythonhosted.org/packages/d4/53/92c40891a94750bc09257310af964bf25c59e3531d6199736c318baa864f/tornado-6.6-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:82b49495e3849d644b841ef33b35491160055997deaa93720ff647ef019421db", size = 533566, upload-time = "2026-10-21T15:30:54.15Z" }, - { url = "https://files.pythonhosted.org/packages/7e/88/b82f5c5efde731b88d839ad99cb6ace2a521f03bb6d7346d2de089c76da8/tornado-6.6-cp315-cp315t-musllinux_1_2_ppc64le.whl", hash = "sha256:07b2bcaa4bf447bdbfb664e4c28344226540db3f0ebccd74886528338a240765", size = 533567, upload-time = "2026-10-21T15:30:55.451Z" }, - { url = "https://files.pythonhosted.org/packages/02/2c/e9a7f5d0fca0bdbcd48b2d9c7884dd0b32669c9945d98bc6d303a80ecfea/tornado-6.6-cp315-cp315t-musllinux_1_2_riscv64.whl", hash = "sha256:c36b921374c302e54909bae17d9f354061d80e7ae7d8c94f73abbcc217866460", size = 532849, upload-time = "2026-10-21T15:30:56.729Z" }, - { url = "https://files.pythonhosted.org/packages/d0/f5/4ade737340ca6ce9c677ea0c2843591c8ad065d07f0913c28d922c7e078e/tornado-6.6-cp315-cp315t-musllinux_1_2_s390x.whl", hash = "sha256:7412d9e37aa9f7048e4b591f520a95f7a097278ffab15f1ddf3f5c2320cf6648", size = 532873, upload-time = "2026-10-21T15:30:58.067Z" }, - { url = "https://files.pythonhosted.org/packages/8e/04/6acdc937d0bb6189ddb34ceded517d7bd1c7b3bded5d4e1b3442160e6b6f/tornado-6.6-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:15bc95112b2d24b0bfaee9a004e3f974da929e33b4244a7f695a22f45b08a5e5", size = 532883, upload-time = "2026-10-21T15:30:59.395Z" }, - { url = "https://files.pythonhosted.org/packages/ab/27/0a766fac6b1cc629d96346329a0485287fd2857c51a887a3a154f2a69938/tornado-6.6-cp315-cp315t-win32.whl", hash = "sha256:f661c21117b875d612371f3eb243d0c69f56d9bdd6aee38b7c24453419dfe554", size = 530488, upload-time = "2026-10-21T15:31:00.77Z" }, - { url = "https://files.pythonhosted.org/packages/5c/80/3e4142570883da27b3f60ae82c638ac96e60997eac684740613557519c96/tornado-6.6-cp315-cp315t-win_amd64.whl", hash = "sha256:ee8853ab35da510dc952879ebd9995c82bc10ffb7925fd87930dc0d6916f4b39", size = 530777, upload-time = "2026-10-21T15:31:02.087Z" }, - { url = "https://files.pythonhosted.org/packages/17/57/4a85c617b6349962320b4afbe1386d5b05fd57218ee8ad6e82e0110ec9ee/tornado-6.6-cp315-cp315t-win_arm64.whl", hash = "sha256:7de62e2dfdf559fd7154d2b9aa58ff3d9cff8304ae0519341feb082618bc2a33", size = 530780, upload-time = "2026-10-21T15:31:03.425Z" }, +version = "6.6.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/64/2b/8ff2b41620cbba0eeb0862fed21dcaa5a2ad36c6dd9bb465f9ff7a147be2/tornado-6.6.1.tar.gz", hash = "sha256:28e6311402af59c8b02e3fa0f5e7d8eb465b25081381803b127d97e6a4395d5a", size = 623388, upload-time = "2026-11-09T21:09:22.71Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/77/d3/ef3a4d38d1a72c52ad07483ed760dbb93027d28f19c3a2d98148abdd63e1/tornado-6.6.1-cp311-abi3-macosx_10_9_universal2.whl", hash = "sha256:a8d3e6acde5a80d13b13b5e4c7c226ca682f31d0a62b6c33cea038714bc2de1b", size = 533249, upload-time = "2026-11-09T21:08:22.475Z" }, + { url = "https://files.pythonhosted.org/packages/38/4d/c65ea949a3cdc185f1afac8c337074d4f2d029b48293d2db4d2c3dea4849/tornado-6.6.1-cp311-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:1b6ff57cc69b339f8feb9e7b567b0e0eacb16bfaf234159496623ef7a67ba640", size = 534470, upload-time = "2026-11-09T21:08:24.27Z" }, + { url = "https://files.pythonhosted.org/packages/03/ff/20911f85dd399b56761496e8138810e8608ea25f0912377f4205d52af853/tornado-6.6.1-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:da6ce2da215810d56539fa6cac77d9e27f4d8139c6868c53436b2fe933f43c79", size = 535446, upload-time = "2026-11-09T21:08:25.625Z" }, + { url = "https://files.pythonhosted.org/packages/be/70/a4a159dd4f1fef39ff8eadae655b133a85722b39087a89e21ce463af9832/tornado-6.6.1-cp311-abi3-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:8cd28b2cacbe63d53e28a38546a3492b488417eeb3f7ecf10954476fc2508882", size = 535664, upload-time = "2026-11-09T21:08:27.191Z" }, + { url = "https://files.pythonhosted.org/packages/ed/d5/db70d5d23d3b4eaea0b26b710f28d2ca387bb44e68ccfede60ba3bbc2096/tornado-6.6.1-cp311-abi3-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:25b2619274bca77d0eb7b4d96dcf2d1142bb9bf172ad6a7491a1e1f82e6e48fa", size = 534660, upload-time = "2026-11-09T21:08:28.78Z" }, + { url = "https://files.pythonhosted.org/packages/f7/f6/0528ee039266902e707edd9996ee3ce7364dc1baf08bed585d8e6fb3ccd0/tornado-6.6.1-cp311-abi3-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:77dd6e0c659fdc45824e0746988ac5c060c2a9fee9b8cbbcdb999b3f29d3cd10", size = 532834, upload-time = "2026-11-09T21:08:30.432Z" }, + { url = "https://files.pythonhosted.org/packages/a6/bb/b733df2d487a78283080663bd6d96955121b58b6d445d9cb832607da9786/tornado-6.6.1-cp311-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:b62fded687e55acaf9e36c1230b006066a35b3f6df093ba1fd3b2ff592070e1d", size = 535289, upload-time = "2026-11-09T21:08:31.692Z" }, + { url = "https://files.pythonhosted.org/packages/a7/7c/c81cb83f2bbb5740fcba1eb83d794b6d6fab2063b16a475cc9039266091e/tornado-6.6.1-cp311-abi3-musllinux_1_2_ppc64le.whl", hash = "sha256:ecef88054d8a77878f61061ff67dfc5e1c17d1f7334890ab508b310e8e68ee46", size = 535382, upload-time = "2026-11-09T21:08:33.282Z" }, + { url = "https://files.pythonhosted.org/packages/8a/ae/c499da4cc8be1c1f31a5d8df2328f2aae091de2db13302ad5c20ed704ec4/tornado-6.6.1-cp311-abi3-musllinux_1_2_riscv64.whl", hash = "sha256:ca95e762df1ca761f330e3f2a034c15ac144569844b52527a5a9eca9f524c0f1", size = 534534, upload-time = "2026-11-09T21:08:34.57Z" }, + { url = "https://files.pythonhosted.org/packages/61/7c/6b163c9e58ca9df0c941bda9ba2dcabbd87ecb81c5fa546f54eeac689232/tornado-6.6.1-cp311-abi3-musllinux_1_2_s390x.whl", hash = "sha256:8cae3d8f2585be01670da9fd5010c61724c51b61ecd4c06820e95874739daf7c", size = 534728, upload-time = "2026-11-09T21:08:35.828Z" }, + { url = "https://files.pythonhosted.org/packages/18/11/b5107ac6a278387635d73d283e7ab5a5c76fb8ccf402efa57006ea25852f/tornado-6.6.1-cp311-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:6596f3e939962f13099ce8d1a96b83226e908ca369b193370a6efa84585a1601", size = 534676, upload-time = "2026-11-09T21:08:37.209Z" }, + { url = "https://files.pythonhosted.org/packages/65/df/0574c4479c565d9233def796afc9179fa840f41f8c240f740609f746da67/tornado-6.6.1-cp311-abi3-win32.whl", hash = "sha256:0f0f596a0dab6826aa21d103c7bc242e3fb7cfc99c5c3d44a35ba8c83abbdca4", size = 535565, upload-time = "2026-11-09T21:08:38.518Z" }, + { url = "https://files.pythonhosted.org/packages/36/57/35439a779582e3b19c98e799b6a41519fb3bdaa3a21b7a94ce4dd7b3b732/tornado-6.6.1-cp311-abi3-win_amd64.whl", hash = "sha256:5cb82ca38596e1350fceaf994f287847f82f7b8436380d36ba0937a03107d0ee", size = 535806, upload-time = "2026-11-09T21:08:39.892Z" }, + { url = "https://files.pythonhosted.org/packages/89/b8/2cb42845af01ea7e70ac23e6f6fe2f26b9b158bce186c6991c057c9abe1d/tornado-6.6.1-cp311-abi3-win_arm64.whl", hash = "sha256:58d2f47e7b54fded3407dbbbe4e59d29ca627f85bf6c0f21f0b151c6c7fc9c53", size = 535825, upload-time = "2026-11-09T21:08:41.339Z" }, + { url = "https://files.pythonhosted.org/packages/10/de/cfeae9e75c144ca22018ee3b858e343c1658d6edd2184f35d810ec1ef789/tornado-6.6.1-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:ed0bc5a1a9f6346e7bdadc106fa2d4c6e79d71d8b2df4366260ab3baf36a8399", size = 533356, upload-time = "2026-11-09T21:08:42.603Z" }, + { url = "https://files.pythonhosted.org/packages/3d/d8/7812a729c797fb8c15748c9a69faeaaa13630075cf9b76ba9f7fbcfb7f42/tornado-6.6.1-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:54c80f9bed0bf1533ecf5a90dc59651645622d62b0bcffa2692d108a1f794917", size = 537511, upload-time = "2026-11-09T21:08:43.84Z" }, + { url = "https://files.pythonhosted.org/packages/70/47/ebef304487feea6d8efb6a7d2642964ecb1f5cc785f687628e1d7cac4326/tornado-6.6.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:eb67ba2cbf598e842f14684eab029a5a4ba7ab587e8c4e40940a77ed0596b31e", size = 538566, upload-time = "2026-11-09T21:08:45.203Z" }, + { url = "https://files.pythonhosted.org/packages/a3/6a/87532e6745c415eb2daa9bc1c9c89c69ce9e8255b1c0bde9938f3299440b/tornado-6.6.1-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:d83bac141bd9360d8e995ec512097be19ead2e9213c3e7088510a036f3192b8d", size = 538793, upload-time = "2026-11-09T21:08:46.478Z" }, + { url = "https://files.pythonhosted.org/packages/e4/c7/26af60f71f7c32f19257bad58711500628f579edf1a2c3d8328ad15aae04/tornado-6.6.1-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:60aad449dbcebaa8d69bff50c6ba39858fab8d256e779a99bb30ebf6724b9b48", size = 537691, upload-time = "2026-11-09T21:08:47.975Z" }, + { url = "https://files.pythonhosted.org/packages/ba/9d/af233b8bf4311d3466099ab267eb595ec6f1655607d290dc7f706b6dbd6f/tornado-6.6.1-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:b9ce0d6548bd73b1329075b247d3fdc61538922f558ee42059e08f5df53fc197", size = 535877, upload-time = "2026-11-09T21:08:49.76Z" }, + { url = "https://files.pythonhosted.org/packages/95/66/78e7583ce69f66e5177c65988a98373be2ab25c1d22405d274e037acbc58/tornado-6.6.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:ce5a18654f5d56d11400ab5d87103660e14deceab41818a06a42acc8dbbe427d", size = 538295, upload-time = "2026-11-09T21:08:51.221Z" }, + { url = "https://files.pythonhosted.org/packages/a3/3a/ad336d4994547cf268a3bd6d10f6ef691e1e888fc776940c0bfe02e8d85c/tornado-6.6.1-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:3298fce72c35f836eab4c4db8b960104ff1ea718033a6b5e236f04efe3a1b6e1", size = 538349, upload-time = "2026-11-09T21:08:52.761Z" }, + { url = "https://files.pythonhosted.org/packages/cf/cf/563d24516afd266f6b3c3f1c7ac15ad39b8668966d2bccce917c169ab0c0/tornado-6.6.1-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:0223e827cedf4e35ebb035e57a0d9974563cd043e3a53f8bb72a859b6f53777e", size = 537469, upload-time = "2026-11-09T21:08:54.279Z" }, + { url = "https://files.pythonhosted.org/packages/c8/ea/1705ff4014c8bad5d7045022647156cfebd6c7014886da47e13512d27c08/tornado-6.6.1-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:533185c89be3ffb01656c9425da4ff42587a3af784b37d39fe762e8fce3b2dbe", size = 537624, upload-time = "2026-11-09T21:08:55.648Z" }, + { url = "https://files.pythonhosted.org/packages/50/5d/421168e62c8b80e3ef88f80d642e9a7e5b1d0c6e8cd136d99064f663951c/tornado-6.6.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:fbaa022a49a27b65668592cf43b898ff3978cbe4e6926fdfe24dbef59053bd26", size = 537632, upload-time = "2026-11-09T21:08:57.797Z" }, + { url = "https://files.pythonhosted.org/packages/6a/b4/13b2f98a3141c152915fa3e69531a04bdc1cd7dd203f442136f3792a486f/tornado-6.6.1-cp314-cp314t-win32.whl", hash = "sha256:4bc6c60faf86162df25ba2ff5611d27b6ef8226de9d61c07a0fab53c169630a5", size = 535424, upload-time = "2026-11-09T21:08:59.145Z" }, + { url = "https://files.pythonhosted.org/packages/84/83/6d54c37b3e437ab0ff2bddd71249c6ea2a17051104dd2995cb4e181e95a7/tornado-6.6.1-cp314-cp314t-win_amd64.whl", hash = "sha256:71c16b382b22d3234913a3f74a1ea84bede197d11eb03871df17bb123088dfa5", size = 535715, upload-time = "2026-11-09T21:09:00.456Z" }, + { url = "https://files.pythonhosted.org/packages/d4/38/75419d8cd577b7c4f335f4c5e75f127af286545ad49047a73afffdf877fe/tornado-6.6.1-cp314-cp314t-win_arm64.whl", hash = "sha256:510c7261ed986ecd6f74edc1a13412759e7abc2e8be3a6c85e15f6c53e1f3c84", size = 535718, upload-time = "2026-11-09T21:09:01.783Z" }, + { url = "https://files.pythonhosted.org/packages/91/8b/96e460653f3e2ad83d70328414394132d73d5655047c692ce7b69ae2f6c0/tornado-6.6.1-cp315-cp315t-macosx_10_15_universal2.whl", hash = "sha256:01dc73e3697eb94d78c42e03931ab621da97d12fdfb6339e64ff5a934b220fcf", size = 533376, upload-time = "2026-11-09T21:09:03.097Z" }, + { url = "https://files.pythonhosted.org/packages/1a/1e/644bace0700e533235f01ffa68a7b5e3d6cc9eb7380e3929039d04b648b9/tornado-6.6.1-cp315-cp315t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:95bd4751357bef52aa655e236b9667ff054885de4b118e4ce9ba5c06e12ef5d0", size = 537696, upload-time = "2026-11-09T21:09:04.519Z" }, + { url = "https://files.pythonhosted.org/packages/e6/0a/afccc23d1ed71bcb1ce4a5b6e0f61f82c7a0b275f3b377ee7aee6680a565/tornado-6.6.1-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:29bce3190c2973fcd2171c95eeab8bf06d2f7a7eb107455ce3e4662c704aecdb", size = 538796, upload-time = "2026-11-09T21:09:05.956Z" }, + { url = "https://files.pythonhosted.org/packages/e5/24/69692f8ba851ed2738c2623eab592360d646f0a2e16b6deea16516aa8595/tornado-6.6.1-cp315-cp315t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:b777fbe0bdb2c4dc764aadf5f70e9b23b2e536c339d61c799d3ea1b575a7c285", size = 538951, upload-time = "2026-11-09T21:09:07.298Z" }, + { url = "https://files.pythonhosted.org/packages/00/82/234306b41b33600a470da7e595b8064b85e2f509f64f5c1d39387c0abbb8/tornado-6.6.1-cp315-cp315t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:15443805d6b7aa11610cc6c5be7e71b4a93369aeb2ca5a13c2def53a3af5ba45", size = 537861, upload-time = "2026-11-09T21:09:08.857Z" }, + { url = "https://files.pythonhosted.org/packages/5b/87/6d13a60c320c0379cbfa4c2520b4ba076780c33e6a01ba3073fff74b71db/tornado-6.6.1-cp315-cp315t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:b77ab23d1520c807d11e703e79b020d3bc3676a0f5ebc8531f46d3fac8aecb2f", size = 536178, upload-time = "2026-11-09T21:09:10.424Z" }, + { url = "https://files.pythonhosted.org/packages/96/c7/e27f2a21e05d7c5aa9886db7368436e6436880b85349072988b4f62422e3/tornado-6.6.1-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:872249311539281c1e8a5d8d6f27f478bf705a9bd931bf374b6b31b05177dfda", size = 538491, upload-time = "2026-11-09T21:09:11.968Z" }, + { url = "https://files.pythonhosted.org/packages/f3/c7/1f981336039c51d81ee6f895e3412178edc409bd709e38767365c55c0daa/tornado-6.6.1-cp315-cp315t-musllinux_1_2_ppc64le.whl", hash = "sha256:08b808e8d3312c268f9fe1ffebfcfaaf342e7fe4ac40d219a7e1b58bac547d6f", size = 538491, upload-time = "2026-11-09T21:09:13.226Z" }, + { url = "https://files.pythonhosted.org/packages/5d/4f/7dafc65726778ac148b68c91920605892e84bf0ffcc02890aaf1a7d0ba8d/tornado-6.6.1-cp315-cp315t-musllinux_1_2_riscv64.whl", hash = "sha256:8d475f4053c693b5c1483eb4845824129b0b51c65712e736b3c2ea1c8f6080cd", size = 537775, upload-time = "2026-11-09T21:09:14.697Z" }, + { url = "https://files.pythonhosted.org/packages/a1/25/85c852307f9e49896b6dc5119f6a0131f5f6d97c478a687654c2c0c3f0f4/tornado-6.6.1-cp315-cp315t-musllinux_1_2_s390x.whl", hash = "sha256:e923e75c9d641cdb8bbac60070a2dccdb684fc555af2bff48b0eaded0f88c2dc", size = 537798, upload-time = "2026-11-09T21:09:15.946Z" }, + { url = "https://files.pythonhosted.org/packages/60/43/a37ec29b0f98c3c639da495e1d547d6c44c69a6727b9864cf149bf346433/tornado-6.6.1-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:a72f70b1aa630fa2106d39a025e2be75c272b7ec8233da94e2f407ea754cc32d", size = 537809, upload-time = "2026-11-09T21:09:17.265Z" }, + { url = "https://files.pythonhosted.org/packages/3b/d4/13973391071552e03acb308d93f6deb4fb535a769a6bbdafdb4cafcb2f91/tornado-6.6.1-cp315-cp315t-win32.whl", hash = "sha256:2fbfd2510b6163b189773155a8246c025cb260ccc7cd12ad18c36c54f5617bb9", size = 535422, upload-time = "2026-11-09T21:09:18.525Z" }, + { url = "https://files.pythonhosted.org/packages/19/94/c952b625904b63fdac5b747f2eeaca64ab5d36cdb8faff57effa57162d87/tornado-6.6.1-cp315-cp315t-win_amd64.whl", hash = "sha256:3c35091add5863feb9cf651851bb1b23592f1f9551b5dfed72837c83ea4e5b85", size = 535713, upload-time = "2026-11-09T21:09:20.061Z" }, + { url = "https://files.pythonhosted.org/packages/f8/62/8d0c0c42f3346f3f2455738d3bc689bbd8efba38abf7b90ab2b8294eae83/tornado-6.6.1-cp315-cp315t-win_arm64.whl", hash = "sha256:065bc741478b168df9baf754956a3010c04d1330bb45a84833d807c29e11b257", size = 535719, upload-time = "2026-11-09T21:09:21.317Z" }, ] [[package]] From b505193c4e5394be6d4c532ff13f908a3526e9ce Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Mon, 16 Nov 2026 18:13:36 +0100 Subject: [PATCH 44/45] fix(s2-write): check the written root's type without assert Bandit flags assert (B101) in src, and the security workflow does not read the project's B101 skip. Raise TypeError instead if the plan's root was not written as a group. Assisted-by: ClaudeCode:claude-opus-5.5 Co-Authored-By: Claude Opus 5.5 --- src/eopf_geozarr/data_api/s2_write.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/eopf_geozarr/data_api/s2_write.py b/src/eopf_geozarr/data_api/s2_write.py index 891f17d2..94dfad4e 100644 --- a/src/eopf_geozarr/data_api/s2_write.py +++ b/src/eopf_geozarr/data_api/s2_write.py @@ -203,7 +203,9 @@ def write_geozarr( ) raise FileExistsError(msg) from error written = zarr.open_group(store, mode="r+", use_consolidated=False) - assert isinstance(written, zarr.Group) + if not isinstance(written, zarr.Group): + msg = f"The plan's root was written as {type(written).__name__}, not a group" + raise TypeError(msg) output = written _fill_group(plan, reader, output, "") return plan From 28d81794db83e05143aa2c709c118eb50e06328a Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Mon, 16 Nov 2026 18:47:07 +0100 Subject: [PATCH 45/45] refactor(zarr-io): type write_hierarchy's result by the kind of spec write_hierarchy returned zarr.Array | zarr.Group, so every caller had to narrow the result, and the conftest fixture did it with an assert outside a test. Overloads now return zarr.Group for a group spec and zarr.Array for an array spec, which is what create_hierarchy writes at the path, and the fixture's assert goes. Assisted-by: ClaudeCode:claude-opus-5.5 Co-Authored-By: Claude Opus 5.5 --- src/eopf_geozarr/zarr_io.py | 25 +++++++++++++++++++++++-- tests/conftest.py | 4 +--- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/eopf_geozarr/zarr_io.py b/src/eopf_geozarr/zarr_io.py index a9eb0aad..ab95d657 100644 --- a/src/eopf_geozarr/zarr_io.py +++ b/src/eopf_geozarr/zarr_io.py @@ -12,7 +12,7 @@ from __future__ import annotations import json -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, overload import zarr from pydantic_zarr import v2, v3 @@ -27,6 +27,26 @@ _ZMETADATA = ".zmetadata" +@overload +def write_hierarchy( + spec: v2.AnyGroupSpec | v3.AnyGroupSpec, + store: Store, + path: str = "", + *, + overwrite: bool = False, +) -> zarr.Group: ... + + +@overload +def write_hierarchy( + spec: v2.AnyArraySpec | v3.AnyArraySpec, + store: Store, + path: str = "", + *, + overwrite: bool = False, +) -> zarr.Array: ... + + def write_hierarchy( spec: v2.AnyArraySpec | v2.AnyGroupSpec | v3.AnyArraySpec | v3.AnyGroupSpec, store: Store, @@ -36,7 +56,8 @@ def write_hierarchy( ) -> zarr.Array | zarr.Group: """ Write the metadata documents of `spec` to `store` at `path` and return the - node written there. No array data is written. + node written there: a `zarr.Group` for a group spec, a `zarr.Array` for an + array spec. No array data is written. `zarr.create_hierarchy` writes every node, refusing to overwrite an existing node unless `overwrite` is set. diff --git a/tests/conftest.py b/tests/conftest.py index e1f8122c..f812d2c8 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -113,9 +113,7 @@ def s2_geozarr_group_example(request: pytest.FixtureRequest) -> zarr.Group: Return a memory-backed Zarr V3 Group based on a sentinel 2 product converted to geozarr """ source_path: pathlib.Path = request.param - group = write_hierarchy(GroupSpecV3.model_validate(read_json(source_path)), MemoryStore()) - assert isinstance(group, zarr.Group) - return group + return write_hierarchy(GroupSpecV3.model_validate(read_json(source_path)), MemoryStore()) @pytest.fixture(params=zcm_multiscales_example_paths, ids=get_stem)