-
Notifications
You must be signed in to change notification settings - Fork 18
Description
Is your feature request related to a problem? Please describe.
In a leveled zarr with a homogeneous chunk size of 1x1024x1024 it may happen that the higher levels have a shape smaller than the chunk size. zarr defines that the data arrays written remain 1024x1024 if the chunk size specified is that dimension. It seems xcube adapts the chunk size to the shape in case a level gets smaller than the chunk size. I did not include this feature in the SNAP writer for cubes. It happened that the OderSO cube had been partially generated with xcube levels, and from now on daily with snap-cubes/jzarr. The resulting cube is not readable because of the different array sizes written.
Describe the solution you'd like
The way it is implemented in xcube to adapt chunk size to shape is fine. Just, I did not find this feature in the documentation.
Describe alternatives you've considered
none
Additional context
The exception we get when accessing variable values in 5.zarr is:
ValueError: cannot reshape array of size 1048576 into shape (482658,)