zarr2netcdf is a Python (command-line) utility that facilitates the conversion of .zarr stores to netCDF (.nc) files. This can be convenient for moving files over scp. It uses xarray and dask to handle the conversion. With optional flags, you can customize the output path and disable dask processing if needed.
- Convert
.zarrstores to.nc(netCDF) format. - Efficient handling of large datasets using
dask. - Optional progress bar for tracking the conversion process (only when
daskis enabled). - Command-line interface and utility for easy integration into workflows.
You can install zarr2netcdf.py as a command line tool using:
pip install .Requirements are xarray zarr netCDF4 dask[complete].
To convert a .zarr store to a .nc (netCDF) file:
zarr2netcdf path_to_your_file.zarr-
zlib encoding (compression): The
-eflag activates encoding usingzlib. Use the-lflag to specify the encoding level (default is 3). This is used for all data variables. -
Specify Output Path: Use the
--outputor-oflag to specify a custom path for the output.ncfile:zarr2netcdf path_to_your_file.zarr --output=path_to_output_file.netcdf
If not provided, the output will have the same name as the input with a
.ncextension. -
Use Dask Parallelization: Use the
--use_daskor-dflag to enabledaskparallelization and the progress bar:zarr2netcdf path_to_your_file.zarr -d