argopy.stores.ArgoKerchunker.translate#
- ArgoKerchunker.translate(ncfiles: str | Path | List, fs=None, chunker: Literal['first', 'auto', 'cdf3', 'hdf5'] = 'first')[source]#
Translate netcdf file(s) into kerchunk reference data
Kerchunk data are saved on the
ArgoKerchunkerinstance store.Once translated, netcdf file reference data are internally registered in the
ArgoKerchunker.kerchunk_referencesattribute.If more than 1 netcdf file is provided, the translation is executed in parallel:
if Dask is available we use
dask.delayed/dask.compute(),otherwise we use a
concurrent.futures.ThreadPoolExecutor.
- Parameters:
ncfiles (Union[str, Path, List]) – One or more netcdf files to translate
fs (None) – An argopy file store, inheriting from
ArgoStoreProto.chunker (Literal['first', 'auto', 'cdf3', 'hdf5'] = 'first') –
Define the kerchunker formater to use. Two formater are available:
kerchunk.netCDF3.NetCDF3ToZarrorkerchunk.hdf.SingleHdf5ToZarr:’first’: detect and select formater from the first netcdf file type
’auto’: detect and select formater for each netcdf of the nc files
’cdf3’: impose use of
kerchunk.netCDF3.NetCDF3ToZarrfor all nc files’hdf5’: impose use of
kerchunk.hdf.SingleHdf5ToZarrfor all nc files
- Return type:
List(dict)
See also