I have a Zarr file stored on a S3 custom storage (not AWS), that I want to save as a TIFF file locally. I'm trying to use GDAL for the first time here so I don't fully understand the methods. So far, I've been able to open the source file (Water Bodies from Copernicus land), but the 2 variables and all the dimensions (lat, lon, time) are opened each as a separate sub dataset :
ds.GetSubDatasets()
[('ZARR:"/vsis3/###/copernicus-land/water-bodies.zarr":/lat',
'Array /lat'),
('ZARR:"/vsis3/###/copernicus-land/water-bodies.zarr":/lon',
'Array /lon'),
('ZARR:"/vsis3/###/copernicus-land/water-bodies.zarr":/time',
'Array /time'),
('ZARR:"/vsis3/###/copernicus-land/water-bodies.zarr":/QUAL',
'Array /QUAL'),
('ZARR:"/vsis3/###/copernicus-land/water-bodies.zarr":/WB',
'Array /WB'),
('ZARR:"/vsis3/###/copernicus-land/water-bodies.zarr":/crs',
'Array /crs')]
So when I try to use gdal.Translate i get :
g = gdal.Translate("output.tif", ds, format="GTiff")
> RuntimeError: output.tif: Unable to export GeoTIFF files with zero bands.
And opening a subdataset :
sub_name = ds.GetSubDatasets()[4][0]
sub = gdal.Open(sub_name)
> RuntimeError: Indices of extra dimensions must be specified
I guess my problem is understanding the Dataset object, I don't get the transformation from dimensions to sub datasets.