cngi.dio.read_image
¶
-
read_image
(infile, chunks=None, consolidated=True, overwrite_encoded_chunks=True, **kwargs)[source]¶ Read xarray zarr format image from disk
- Parameters
infile (str) – input zarr image filename
chunks (dict) – sets specified chunk size per dimension. Dict is in the form of ‘dim’:chunk_size, for example {‘d0’:100, ‘d1’:100, ‘chan’:32, ‘pol’:1}. Default None uses the original zarr chunking.
consolidated (bool) – use zarr consolidated metadata capability. Only works for stores that have already been consolidated. Default True works with datasets produced by convert_image which automatically consolidates metadata.
overwrite_encoded_chunks (bool) – drop the zarr chunks encoded for each variable when a dataset is loaded with specified chunk sizes. Default True, only applies when chunks is not None.
s3_key (string, optional) – optional support for explicit authentication if infile is provided as S3 URL. If S3 url is passed as input but this argument is not specified then only publicly-available, read-only buckets are accessible (so output dataset will be read-only).
s3_secret (string, optional) – optional support for explicit authentication if infile is provided as S3 URL. If S3 url is passed as input but this argument is not specified then only publicly-available, read-only buckets are accessible (so output dataset will be read-only).
- Returns
New xarray Dataset of image contents
- Return type
xarray.core.dataset.Dataset