Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
6d5a53c
feat(data-api): validate GeoZarr arrays strictly in a scope via pydan…
d-v-b Oct 28, 2026
9a6a555
feat(pyz): enforce the attributes type parameter and legalize the mem…
d-v-b Oct 28, 2026
717721f
feat(data-api): add the spec-level Sentinel-2 GeoZarr plan
d-v-b Oct 28, 2026
180d3e3
feat(data-api): extend the Sentinel-2 GeoZarr plan to conditions and …
d-v-b Oct 28, 2026
0cbf567
fix(s2-optimization): rechunk generated pyramid levels uniformly befo…
d-v-b Oct 28, 2026
178a1a7
chore(deps): bump pydantic-zarr to main at 9f2e847
d-v-b Oct 28, 2026
17a49eb
refactor(data-api): type the plan's metadata documents with zarr-meta…
d-v-b Oct 28, 2026
04c8771
feat(data-api): write the planned hierarchy without the DataTree writer
d-v-b Oct 28, 2026
85f1638
style(pyz): declare the wrapper generics with PEP 695 type parameters
d-v-b Oct 28, 2026
aaad976
feat(s2-optimization)!: drive convert_s2_optimized by the plan and re…
d-v-b Oct 28, 2026
611a83f
feat(data-api): read DataTree inputs through a GroupSpec-shaped view …
d-v-b Oct 29, 2026
6015d7f
fix(s2-optimization): apply the adversarial review's findings
d-v-b Oct 29, 2026
2217ea6
Merge branch 'main' of https://github.com/EOPF-Explorer/data-model in…
d-v-b Oct 29, 2026
3fab610
refactor(data-api): move to pydantic-zarr main and zarr-metadata 0.8
d-v-b Nov 13, 2026
9959549
docs(data-api): say the DataArray scope is ZARR_PYTHON_CONTEXT
d-v-b Nov 13, 2026
c433fc0
refactor(data-api): depend on pydantic-zarr 0.11 and read dtypes with it
d-v-b Nov 13, 2026
c298203
test(data-api): pin the V3 form of a carried datetime array
d-v-b Nov 13, 2026
6efb5db
fix(s2-plan): state spatial:shape on multiscale parent groups
d-v-b Nov 13, 2026
a2b8247
fix(s2-plan): put the carried CF attributes right
d-v-b Nov 13, 2026
24664e2
fix(s2-plan): do not shard an array that fits in one inner chunk
d-v-b Nov 13, 2026
6495d53
fix(conversion): keep valid_* on float arrays in sanitize_array_attrs
d-v-b Nov 13, 2026
c8c0fbd
fix(s2-plan): store fixed-length label arrays as the registered strin…
d-v-b Nov 13, 2026
bbd7637
fix(s2-plan): georeference the meteorology groups from their coordinates
d-v-b Nov 13, 2026
9936a26
test(s2): cover bytes labels planned and written as strings
d-v-b Nov 13, 2026
55b9ff1
test: fix the typing of the attribute guardrail and the label write test
d-v-b Nov 13, 2026
3ac4926
fix(s2-plan): carry a grid no transform describes instead of failing
d-v-b Nov 13, 2026
85366f4
fix(s2-plan): keep a meteorology bbox's longitudes within [-180, 180]
d-v-b Nov 13, 2026
3c881ac
feat!: stop writing the CF grid mapping; proj and spatial are the geo…
d-v-b Nov 13, 2026
85e4819
fix(s2-plan): normalize bbox longitudes by whole turns
d-v-b Nov 13, 2026
2d8e58a
fix(conversion): carry a grid mapping's CRS over before stripping it
d-v-b Nov 13, 2026
997b123
fix(conversion): extend declared conventions when carrying a grid map…
d-v-b Nov 13, 2026
d2d4512
docs(conversion): state when strip_cf_grid_mapping carries the CRS over
d-v-b Nov 13, 2026
dcac05b
build(deps): take pydantic-zarr 0.11.0 from PyPI
d-v-b Nov 15, 2026
7034a04
Merge PR 330's switch to pydantic-zarr from PyPI into the issue-349 f…
d-v-b Nov 15, 2026
47265cc
Merge EOPF-Explorer main into the plan-driven S2 writer, porting its …
d-v-b Nov 15, 2026
4091426
refactor(s2): parse level names in one place
d-v-b Nov 15, 2026
47481e8
Merge PR 330's port of EOPF main into the issue-349 fixes
d-v-b Nov 15, 2026
0af1dff
refactor(s2-plan): stop a parameter shadowing level_meters
d-v-b Nov 15, 2026
8c7598e
build(deps): upgrade tornado to 6.6.1 for CVE-2026-126347
d-v-b Nov 15, 2026
2c45577
Merge PR 330's tornado 6.6.1 upgrade into the issue-349 fixes
d-v-b Nov 15, 2026
f803d63
fix(s2-write): skip only the nodata the input declares when coarsening
d-v-b Nov 15, 2026
335b8db
Merge PR 330's coarsening fix into the issue-349 fixes
d-v-b Nov 15, 2026
0af84b4
refactor(s2-optimization): keep main's Sentinel-2 writer and leave th…
d-v-b Nov 16, 2026
d23170f
test(data-api): check the Sentinel-2 plan against the converter's output
d-v-b Nov 16, 2026
dbb39b0
docs(data-api): correct two plan docstrings after the writer split
d-v-b Nov 16, 2026
753844d
feat(s2-optimization)!: drive convert_s2_optimized by the plan and re…
d-v-b Nov 16, 2026
38a969b
fix(s2-write): refuse unsafe casts, existing outputs and policy devia…
d-v-b Nov 16, 2026
5ca920f
Merge the split writer branch into the issue-349 fixes
d-v-b Nov 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ 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 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.13.1 (2026-11-10)

## What's Changed
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
31 changes: 17 additions & 14 deletions docs/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,31 +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). |

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, 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 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`

Expand Down
30 changes: 15 additions & 15 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ output.zarr/
│ │ │ ├── b08/
│ │ │ ├── x/ # X coordinates
│ │ │ ├── y/ # Y coordinates
│ │ │ └── spatial_ref/ # CRS information
│ │ │ └── spatial_ref/ # CF grid mapping (generic converter only)
│ │ ├── 1/ # Overview level 1 (/2)
│ │ └── 2/ # Overview level 2 (/4)
│ ├── r20m/ # 20m resolution group
Expand Down Expand Up @@ -350,20 +350,20 @@ y_attrs = {
}
```

### 2. Grid Mapping Variables

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
}
```
### 2. CRS

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 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

Expand Down
47 changes: 26 additions & 21 deletions docs/converter.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand All @@ -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:

Expand All @@ -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

Expand Down Expand Up @@ -200,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.
Expand Down
14 changes: 7 additions & 7 deletions docs/cpm-driver.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down Expand Up @@ -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. |
Expand Down
23 changes: 9 additions & 14 deletions docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"},
)
```

Expand Down Expand Up @@ -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,
)

Expand Down Expand Up @@ -351,15 +348,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
Expand Down
Loading
Loading