(
product_path: esa_safe.PathType,
output_store: Any,
groups: Dict[str, str] | None = None,
**kwargs: Any,
)
| 6 | |
| 7 | |
| 8 | def to_group_zarr( |
| 9 | product_path: esa_safe.PathType, |
| 10 | output_store: Any, |
| 11 | groups: Dict[str, str] | None = None, |
| 12 | **kwargs: Any, |
| 13 | ) -> None: |
| 14 | root = xr.open_dataset(product_path, engine="sentinel-1") |
| 15 | root.to_zarr(output_store, mode="w", **kwargs) |
| 16 | |
| 17 | if groups is None: |
| 18 | groups = {g: g for g in root.attrs["subgroups"]} |
| 19 | |
| 20 | for group_out, group_in in groups.items(): |
| 21 | try: |
| 22 | group_ds = xr.open_dataset( |
| 23 | product_path, engine="sentinel-1", group=group_in |
| 24 | ) |
| 25 | group_ds.to_zarr(output_store, mode="a", group=group_out, **kwargs) |
| 26 | except FileNotFoundError: |
| 27 | pass |
| 28 | |
| 29 | |
| 30 | # Apparently there is no way to save SLC images because "netcdf4" doesn't support complex data |
nothing calls this directly
no test coverage detected