argopy.stores.ArgoKerchunker.translate

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 ArgoKerchunker instance store.

Once translated, netcdf file reference data are internally registered in the ArgoKerchunker.kerchunk_references attribute.

If more than 1 netcdf file is provided, the translation is executed in parallel:

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 formatter to use. Two formatter are available: kerchunk.netCDF3.NetCDF3ToZarr or kerchunk.hdf.SingleHdf5ToZarr:

    • ’first’: detect and select formatter from the first netcdf file type

    • ’auto’: detect and select formatter for each netcdf of the nc files

    • ’cdf3’: impose use of kerchunk.netCDF3.NetCDF3ToZarr for all nc files

    • ’hdf5’: impose use of kerchunk.hdf.SingleHdf5ToZarr for all nc files

Return type:

List(dict)